Startup Scripts
CO has a number of startup scripts which are all copies of scripts/accords.in
with different names. Within the scripts, functionality is selected based on the filename.
The standard co-start
script performs the following actions:
- Start accords platform (e.g. OCCI servers)
- Start Provisioning services
- Start Proccis
- (Optional) start Nagios
Steps 2 onwards depend on the backends having certain categories (e.g. user
) initialised from xml files in the scripts
and manifest
directories.
Many use-cases will want to start CO with some pre-population of the backends. A backend-independent way to do this is to use the OCCI interface once the platform has been initialised, and before any other accesses have been done. Examples can be found on the OnApp branch in the following files:
-
scripts/accords.in
- in_co_start()
, there is a call to aseed_backend
script -
scripts/seed_backend
- usesxml_to_rest.py
to populate two categories -
tools/backend/xml_to_rest.py
- simple Python script for populating categories based on xml files in the same format as the xml backend. This script relies on the Pythonrequests
module, which can be easy-installed.
These scripts are very rough-and-ready, but could help as examples in the creation of production-robust scripts.
The default method of creating a working directory involves copying the initialisation xml files to the working directory. In order to support alternate backends which do not work with xml files, the following changes have been made on the OnApp branch:
- Split the script
co-platform
which covers steps 1 and 2 above.co-platform
now covers only 1.co-prov-services
starts 2. - Introduce new scripts to parse the xml files and insert them into the backend via the OCCI Rest interface. This operation is performed between steps 1. and 2. above.