-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
Ensure that the git code base has an up-to-date tag of the form #.#.# (e.g. 1.2.3). The version file is then auto-generated by navigating to ditto_web_api
and running:
./build_version_number.sh
This must be done outside the virtual machine (the
.git
folder is not mounted, so the git describe command doesn't recognise the code mounted in the VM as a git repository).
This will generate a version.py
file inside the DittoWebApi
folder with the contents
__version__ = '1.2.3-4-sha123abc'
Note this file is not committed because it depends on each commit
From within ditto_web_api
, source the virtual environment
- Unix
source venv/bin/activate
- Windows
source venv/Scripts/activate
Then run:
./build_package.sh
to build the DittoWebApi
whl file in ditto_web_api/dist
. This is what will be deployed onto the target machine.
Note: ensure you have Python 3.6 installed on the target system first.
Copy over the DittoWebApi-{version}-py3-none-any.whl
file to the target machine (e.g. to /usr/tmp
)
Make a folder to run the system in and make a new Python virtual environment
mkdir ~/ditto_web_api
cd ~/ditto_web_api
python36 -m venv .
Activate the environment and install the package
source ~/ditto_web_api/bin/activate
pip install /usr/tmp/DittoWebApi-{version}-py3-none-any.whl
This should download all the dependencies needed to run the system
The package will install an example configuration in ~/ditto_web_api/lib/python3.6/site-packages/DittoWebApi
. This needs to be copied and updated to ~/ditto_web_api/lib/python3.6/site-packages/DittoWebApi/configuration.ini
.
Never commit your configuration file to GitHub.
Options for the LoggingLevel
are:
- CRITICAL
- ERROR
- WARNING
- INFO
- DEBUG
Upper-case is required.
See here for more information.
As well as applying the standard S3 naming conventions for buckets, (see here) the bucket names must start with the prefix ditto
as specified in the configuration file. This will restrict the creation of all new bucket names to the standard format of ditto-bucketname
.
- Note prefix
ditto-
must be included in the specified name when creating a bucket.
As for the configuration, the package will install an example bucket settings file in ~/ditto_web_api/lib/python3.6/site-packages/DittoWebApi
. This needs to be copied and updated to ~/ditto_web_api/lib/python3.6/site-packages/DittoWebApi/bucket_settings.ini
.
With the package installed and whilst in the virtual environment, you can then run the server with
ditto_server