-
Notifications
You must be signed in to change notification settings - Fork 6
Crowbar UI Development (using offline mode)
The Crowbar UI has an "offline" mode that can be used for testing and development when no Chef server is available as a back end.
To collect the information needed for offline mode, you must start with from a working system and export the Chef objects (effectively the Crowbar DB). The export new to Crowbar 1.3 under the Utilities...Exported Items.
To activate this mode, you must:
- Edit your Rails environment
vi /opt/dell/crowbar_framework/config/environment.rb- note: you may only want to change it for development mode (
environments/development.rb) -
CHEF_ONLINEconfiguration property tofalse -
OFFLINE_DOMAINmust match the DNS top level domain (TLD) installed with Crowbar - (optional)
OFFLINE_FILES_DIRconfiguration defaults todbbut you can change if you want
- note: you may only want to change it for development mode (
- Populate the
/opt/dell/crowbar_framework/dbdirectory with the cachejsonfiles
This is a handy debugging tool because it allows developers to get a full system snapshot whenever all the files in db are deleted.
The cache files follow a simple naming pattern. Prefixes of node, role and databag indicate the type of Chef object being stored. The node name follows the prefix.
When data is edited in Offline mode, Crowbar will store the edited version int =tmp=. To undo the edit, simply remove the object(s) in the tmp directory. Crowbar always looks for updated objects in the tmp directory before returning the original object from the =db= directory. Only the last update is kept.
If the Chef models change then it is necessary to update the object cache in the test directory.
We have found this mode to be very helpful for UI development. All the code to support this capability is in the model and should not be exposed in the controllers or views. Please make sure that all Crowbar changes continue to work for this mode.