Docker based deployment of back end (manual)

Note: This is based on a deployment environment based on the Audienti repo, and that your development environment is setup correctly for development using Docker.

In general, the steps are:

  • Produce a new oma-processors image with a new tag on Dockerhub.

  • Build new rancher stacks docker-compose and rancher-compose files.

  • Push the stacks to Rancher for redeployment.

Producing a new oma-processors image.

Once you have a release to push, in your oma-processors repo, you type:

./release.sh

This will ask you for a new release version, tagging the current branch as that release. It also updates the VERSION and CHANGES files in the root of the repo. Once this is done, $>git push origin masterto push this tag to the server.

Build the image

cli build oma-processors

This will build the image, and push it to DockerHub. It will use the current tag, and will overwrite the tag if there is a duplicate tag on dockerhub. Ensure you are logged into dockerhub before you issue this command, or it will fail. It takes about 20 minutes currently.

Build rancher-compose and docker-compose yml files for deployment

cli write_rancher_stacks docker dc1

This command will delete and re-create the deploy folder's scripts. In the deploy folder there is a folder for each "stack" in rancher. Inside, there is a rancher-compose and a docker-compose file for each stack. These are what are pushed by the deploy commands. If you do NOT update these, you will push an old version.

Push to Rancher

cli deploy_all

This will deploy all the stacks. You can monitor progress on the command line, and the rancher web UI. This can take 2 to 5 hours. It's slow. But, you can be doing development in the background at the same time.

Note you can also do individual stack deployments by typing $>cli deploy automation-pipelinefor example. You can list them out too, like $>cli deploy automation-pipeline global opportunity-pipelineif you want to deploy a subset of the stacks.

Check that it's done

Sometimes there will a container or two that finish their upgrade, but don't complete (removing the old one). Go through each stack and ensure they are running. Click finish upgrade to finish.

Other notes

  • Scaling. There is a file in the deploy folder that stays, which is the scale. You can adjust this file to adjust the default number of each service that is deployed. If you delete it, the when you issue the command $>cli write_rancher_stacksit will build it, and abort with a message. Edit the config, type the command again, and it will build the stacks.

Last updated