/Dply

Container Build Management Mastering Program

Primary LanguageShell

Container Build Management Mastering Program



Install

The libraries installed by the program are as follows.



Additionally, the system only supports the Ubuntu OS and is not compatible with other operating systems.

To run this program, the following programs need to be installed using the provided commands.

Curl

sudo apt-get install curl

Docker

sudo apt-get install docker\
                 docker.io\
                 docker-compose

Python

sudo apt-get install python3\
                 python3-pip

Nvidia Docker (optional)

sudo apt-get update
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker

Container

This program deploys development environment containers using Docker API, so you need to install Container Images locally from the source. The installation process is as follows:

CPU

docker pull registry.gitlab.com/container-images4/docker-ssh-conteiner:centossshcotainer
docker pull registry.gitlab.com/container-images4/docker-ssh-conteiner:ubuntusshcontainer
docker pull registry.gitlab.com/container-images4/docker-ssh-conteiner:rockylinuxsshcontainer
docker pull registry.gitlab.com/container-images4/docker-ssh-conteiner:tensorflowsshcontainer

docker pull registry.gitlab.com/container-images4/docker-jupyter-container:containerjupytercentos
docker pull registry.gitlab.com/container-images4/docker-jupyter-container:containerjupyterubuntu
docker pull registry.gitlab.com/container-images4/docker-jupyter-container:containerjupyterrockylinux
docker pull registry.gitlab.com/container-images4/docker-jupyter-container:containerjupytertensorflow

GPU (optional)

docker pull registry.gitlab.com/container-images4/docker-ssh-conteiner:gpucentossshcontainer
docker pull registry.gitlab.com/container-images4/docker-ssh-conteiner:gpuubuntusshcontainer
docker pull registry.gitlab.com/container-images4/docker-ssh-conteiner:gpurockylinuxsshcontainer
docker pull registry.gitlab.com/container-images4/docker-ssh-conteiner:gputensorflowsshcontainer

docker pull registry.gitlab.com/container-images4/docker-jupyter-container:gpucontainerjupytercentos
docker pull registry.gitlab.com/container-images4/docker-jupyter-container:gpucontainerjupyterubuntu
docker pull registry.gitlab.com/container-images4/docker-jupyter-container:gpucontainerjupyterrockylinux
docker pull registry.gitlab.com/container-images4/docker-jupyter-container:gpucontainerjupytertensorflow

DataBase

docker pull mysql:latest 
docker pull mariadb:latest
docker pull mongo:latest
docker pull redis:latest

Note: Installer support will be provided in future updates.

API Run

In this version, the completeness of the API may be low.

Also, the program is structured into CPU and GPU versions, so please execute the API based on your environment.

docker-compose up -d

Remove

Before executing the command, please check if the container is working or if the data has been backed up. The following command will delete containers, volumes, and networks created by Dply.

docker-compose down
sudo sh remove.sh

API v0.0.2

The program is implemented as FastAPI and information can be obtained through Docs in FastAPI. The FastAPI connection method is as follows.

http://[IP]:8080/docs


The functions supported by the API are implemented as follows.

  • Build #Deploy project containers
  • Status #Change the status of the project container
  • Delete #Delete Project
  • Search #Project information

Build

The API is a program for deploying development environment containers.
The parameters required to use the API are as follows.

Variable Name Type Default Description
projectName str - Project Name
Processor str CPU Processor Allocation Parameters
OS str Ubuntu Development Environment Container Operating System Allocation Parameters
Type str Jupiter Development Environment Container Access Method Allocation Parameters
Password str None Project Distribution Container Password Allocation Parameters
databaseList list None Database Container Deployment Allocation Parameters

The result is output as shown below.


The API also specifies the types that it supports.
The specified type is configured as follows.

Variable Name Type Support Type (Case Check)
Processor str CPU, GPU
OS str ubuntu, centos, rockylinux, tensorflow
Type str SSH, Jupyter
databaseList list mysql, mariadb, mongo, redis

You have to check the case and enter the college to avoid errors.
In addition, these character interpretations are implemented without a separate filter.

Status Code

Status Code 200

The error was successfully distributed

{
    "devContainer": {
        "status": int,
        "port": int
    },
    "databaseContainer": [
        {
            "database": str,
            "status": bool
        },
        ...
    ]
}

Status Code 400

The corresponding error may occur when the Docker Image is not Full. Run the installer again and process it.

{
    "msg": "You do not have permission.",
    "NotBuildContainer": "The name is already registered."
}

Status Code 503

The error is an error that occurs when the project name is duplicated. Try again by changing the project name to another one.

{
    "msg": "You do not have permission.",
    "NotBuildContainer": "The name is already registered."
}



Status Code 403

This error is an error that occurs when the computing system attempts to assign an unprovided processor.

{
  "msg": "You do not have permission.",
  "SystemProcessorConfigurationError": "Your system does not support the processor you want. Please select a different processor."
}



Status

This function is a program for managing the execution of project containers.
The parameters required to use the API are as follows.


Variable Name Type Default Description
projectName str - Project Name
statusSetting str - Project Container Status Information

The result is output as shown below.



Status Code

Status Code 200

{
    "Status": {
        "devContainer": bool,
        "databaseContainer": {
            str: bool,
            ...
        }
    },
}



Status Code 404

{
    "msg": "Not found",
    "NotFoundProjects": "Projects that cannot be found"
}



Delete

The API is a program for deleting development environment containers.

The parameters required to use the API are as follows.

Variable Name Type Default Description
projectName str - Project Name

The result value is output as follows.



Status Code

Status Code 200

Project Delete Results

{
    "projectName": str,
    "projectStatus": {
        "devContainer": bool,
        "databaseContainers": {
            str: bool,
            ...
        },
        "containersNetwork": bool,
        "containersVolume": bool
    },
}



Status Code 404

If a project has already been deleted or is missing

{
    "msg": "Not found",
    "NotFoundProjects": "Projects that cannot be found"
}



Search

The API is a program for deleting development environment containers.
The parameters required to use the API are as follows.

Variable Name Type Default Description
projectName str None Project Name

The function will also print single project information if the value 'projectName' is entered and multiple project information if not entered.

The result is output as shown below.



Status Code

Status Code 200



Single Project Information
{
    "projectName": str,
    "createdTimes": float,
    "devContainer": {
        "type": str,
        "gpu": bool,
        "status": bool,
        "port": int,
    },
    "databaseContainers": {
        str: {
            "status": bool,
            "ip": str,
        },
        ...
    }
}

Multiple Project Information
[
    {
        "projectName": str,
        "devContainer": {
            "Type": str,
            "status": bool,
            "port": int,
            "gpu": int,
            "createdTimes": float,
        },
        "databaseContainer": [
            str,
            ...
        ],
    },
    ...
]

No data from multiple project information
[]

Status Code 404

Project information not found

{
    "msg": "Not found",
    "NotFoundProjects": "Projects that cannot be found"
}