Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Deployment

robert-clegg-tessella edited this page Dec 14, 2018 · 10 revisions

DITTO Deployment

Packaging the system

Updating the version number

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

Building the wheel

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.

Deploying DITTO

Note: ensure you have Python 3.6 installed on the target system first.

Installing the package

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

Configuration

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.

Logging

Options for the LoggingLevel are:

  • CRITICAL
  • ERROR
  • WARNING
  • INFO
  • DEBUG

Upper-case is required.

See here for more information.

Bucket naming standards

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.

Bucket settings

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.

Running the package

With the package installed and whilst in the virtual environment, you can then run the server with

ditto_server