Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

DataLab Deployment Proposal

viravit edited this page Nov 8, 2021 · 4 revisions
- To be updated

This is proposal of 3 different options for DataLab deployment.

## 1. Based on Python scripts (current deployment)

### Current deployment
Prerequisites:
 - python==2.7
 - python-pip
 - fabric==1.14 
 - git
 - docker-ce

For SSN node deployment we have to clone DataLab git repository and run deploy_datalab.py script.
This script will parse arguments, build docker images, generate docker command and run it.
Two docker images will be built - base and ssn. Base docker image will be from ubuntu 18.04, installs .deb and python dependencies and copies base scripts from DataLab repository.
SSN image will be from base image and copies necessary python scripts for SSN-node preparation (create cloud infrastructure) and SSN-nod configuration (install ui, billing, provisioning services on it). At the last step of SSN configuration docker images for Edge-node and notebooks from base image will be created. The entrypoint of base image is entrypoint.py script which will run specific script for any action - run, create, destroy, etc.
So, DataLab deployment is based on python scripts. To create cloud infrastructure we use boto3 for AWS, GCP API for GCP cloud and Azure API for Azure cloud.
To configure SSN-node, Edge-node and notebooks we use fabric and bash.

### Proposal
Prerequisites
 - python==3.6
 - python-pip3
 - fab-classic
 - git
 - docker-ce

We can leave the same algorithm with necessary changes to use python3 instead python, pip3 instead pip and with all python2 libraries removal.

| Pros                               | Cons                          |
|------------------------------------|-------------------------------|
| Fast for implementation            | Not stable                    |
|                                    | Terrible directory structure  | 

## 2. Based on Python scripts and Docker images
Prerequisites
 - pyhon==3
 - python-pip3
 - fabric
 - git

### Proposal:
We are going to refactor deployment scripts: in section of infrastructure building we still will use python script with boto3 for AWS, and GCP and Azure APIs as well, to prepare deployment scrip which could be uploaded to PyPi as python library which allows to automatically install all necessary dependencies to simplify DataLab SSN deployment; in section of provisioning we are going to use Docker images. The main issues in this case is the place to store Docker images.
In general it should be python script which should build cloud infrastructure with SSN-node instance, upload docker images with nginx, ui, billing, provisioning services and run docker containers on it.

| Pros                               | Cons                          |
|------------------------------------|-------------------------------|
| Deployment script as PyPi lib      | Takes more time to implement  |
| Always workable version            |                               |

## 3. Based on Terraform and Docker images
Prerequisites
 - Terraform
 - python==3

### Proposal:
Python script should parse arguments and run terraform command with specific action and parameters.
All cloud infrastructure should be built by terraform, and Docker images should be uploaded on SSN-node.
We still will need to use python scripts to create Edge-node, notebooks and infrastructure for them since terraform could not satisfy requirement to stop/start option for Edge-node and notebooks.

| Pros                                  | Cons                          |
|---------------------------------------|-------------------------------|
| Fast and easy infrastructure building | Takes more time to implement  |
| Always workable version               | Terraform state file          |
Clone this wiki locally