The NICE server is installed on a number of machines around the building. This includes actual instruments, VMs and developer desktops. Each of these instances is referred to as an installation.
Each installation references/depends on data from two broad categories:
Local data is only applicable to that particular installation and is not stored in the NICE code repository. Local data includes:
Instrument Configuration is applicable to ALL instruments of this type. A simulation of Spin Echo, running on a developer's desktop will have many things in common with the real Spin Echo machine. This type of data is stored in the NICE the repository and includes:
As a convenience to developers, it is useful to reset the local installation's data folder to a previously defined state. This state will typically represent an existing instrument in a reasonable state. However, any number of states can be created to restart the server in any useful state you'd like to repeatedly go to.
To start the server in a given state, start with the argument: --resetdata <state>
States are defined in the folder reset_server_data. When the --resetdata argument is used, the server:
deletes server_data (or whatever folder was configured to be used for local machine state)
copies reset_server_data/base --> server_data (contains boilerplate data which has to exist)
copies reset_server_data/<state> --> server_data (any conflicting files are overwritten)
Important: Reset would be dangerous if used on a real instrument! As a result, reset fails unless:
The file server_data/testing_machine exists and contains the string testing_machine. Conveniently, the reset_server_data/base folder already contains a file like this!
Important: When setting up a new instrument for the 1st time, you must change the Testing_machine file to mark the instrument as REAL! This has several effects, which including preventing an accidental and CATASTROPHIC reset!
On a new real instrument installation, edit server_data/testing_machine so that it contains the string real_machine.
To create a new reset state from your current state: