By Farruh
Nowadays, we have an extremely high-speed changing live environment. Most changes happen as a result of Artificial Intelligence (AI). The revolution does not only bring AI. It comes with other high-tech. One of the high-tech generators is containerization, and containers are part of MLOps. We start our MLOps journey with easy using containers. This article describes creating and preparing an environment to train or inference the AI model. Since Alibaba Cloud provides comprehensive tools and environments for deploying and using AI models, we will run example code and environment on it.
Containerization allows you to replicate your working environment quickly and easily. It makes it possible to initialize MLOps and reach the technical support L3 level quickly. Moreover, containerizing allows developers to generate the same results repeatedly on a different machine. However, creating containers is time-consuming and requires expert knowledge. As a container, we will use Docker images.
Docker is a popular open-source platform that helps automate the deployment, scaling, and management of applications and services. Its container-based approach to software development makes it easy to package and deploy applications consistently and repeatedly.
Alibaba Cloud is a leading cloud computing platform that offers a range of services, including Elastic Compute Service (ECS), which allows users to deploy and use Docker on any operating system (OS). We run ESC with Ubuntu OS as an example. However, ECS supports all OS and even user-defined OS images. Using Docker on ECS allows AI developers to build, deploy, and run their applications quickly and efficiently.
The use of Docker on ECS provides several benefits:
As an initial step, we signed up with an Alibaba Cloud account. Run instances that run an Ubuntu 20.04 operating system. Please see Create an instance by using the wizard for more information.
This article chose instances to run AI model inference. Developers not only consider inference models but also need to consider pricing, so an instance with T4 GPU will be an excellent choice to infer most of the AI models.
The Docker image should be connected to the ECS instance to deploy. Detailed information regarding ECS connection methods can be found at the following link. It's recommended to update the package sources list with the latest versions of the packages in the repositories. Then, install the packages to allow apt
to use a repository over HTTPS:
OS version and related information
apt update
apt install \
ca-certificates \
curl \
gnupg \
lsb-release
It's recommended to look at the official documentation (Install Docker on Ubuntu) before installing any software. The steps to install Docker on Ubuntu 20.04 are listed below:
1. It is recommended to check if the machine already has Docker installed. If so, uninstall existing versions first:
apt remove docker docker-engine docker.io containerd runc
2. Add the official GPG key of Docker and set up the repository:
mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
3. It needs to update apt
and install Docker Engine, containerd, adn Docker Compose
to get newly added repositories:
apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
The installation of Docker is finished, but we have to verify whether the installation has succeeded or not by checking its status and running the hello-world script:
systemctl status docker
The Docker status is running, which means we can go to the next step
docker run hello-world
Docker Image: Hello-World
The successful result can be defined after getting a similar response as shown in the pictures.
Let's check what Docker images the machine has:
docker images
Docker Image List
We have installed Docker and tested it. The next logical step will be to pull Docker images with TensorFlow and NVIDIA-Docker, which we will address in the next article.
Alibaba Cloud Community - March 3, 2023
Farruh - March 6, 2023
Alibaba Clouder - April 2, 2019
Alibaba Clouder - February 25, 2020
Alex - August 26, 2019
Alibaba Cloud Community - November 10, 2021
A platform that provides enterprise-level data modeling services based on machine learning algorithms to quickly meet your needs for data-driven operations.
Learn MoreThis technology can be used to predict the spread of COVID-19 and help decision makers evaluate the impact of various prevention and control measures on the development of the epidemic.
Learn MorePowerful parallel computing capabilities based on GPU technology.
Learn MoreAccelerate software development and delivery by integrating DevOps with the cloud
Learn MoreMore Posts by Farruh