Implementation details

The project structure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
├── AUTHORS.md, authors of this project
├── compose, the compose folder containing an example of a deployment from the 5G Lab atom
│   ├── db
│   ├── docker-compose.yml, the docker compose to deploy
│   ├── swagger
│   └── webapp
├── CONTRIBUTING.md, how to contribute
├── deploy.py, the deployment script
├── Dockerfile, the docker image to contain the deployment script and make it portable
├── docs
│   └── implementation.md
├── .gitlab-ci.yml, the deployment scenario and operations
├── LICENSE.md
├── output.html.j2, the template of the deployment report
└── README.md

The deployment

Script

On an original idea from Didier. This script uses the playground API and features (ssh towards sandboxes) to perform the deployment from end to end.

Basically, the script lets you choose between a compose or an image to deploy. It then starts a session on the playground, a sandbox instance (alpine or ubuntu are the options), and ssh into it to perform the rest of the actions. For a docker image, we stop at docker pull. For a compose, we go as far as deploying it, even if it has images to build locally in the sandbox. This is a very large use case, we hope it suits yours. Comments and enhancements are welcome.

Dockerfile and image

The Dockerfile contains the script and its dependencies.

  • To build locally (not in a CI job)
1
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy -t deploy:plugin https://gitlab.forge.orange-labs.fr/tqwt7730/plugin_deploy.git
  • To use it locally from your computer and deploy an image
1
docker run -it --rm deploy:plugin deploy.py --deploy image --docker-image dockerproxy-iva.si.francetelecom.fr/alpine:3.7 --log-level debug
  • To use locally from your computer and deploy a compose (if the compose folder contains a compose to deploy)
1
docker run -it -v $PWD/compose:/app/compose --rm deploy:plugin deploy.py --deploy compose  --compose-dir /app/compose --log-level debug