Creating a Compilation Container and a Deployment Container on the Compilation Node
To avoid installing extra software in the cluster, you are advised to use another server outside the cluster to create a container image. The server, referred to as the compilation node in this section, must use the same hardware configuration and OS as the cluster. To efficiently manage and perform software build and deployment, you need to build a compilation container and a deployment container on the compilation node.
- Download the openEuler-22.03-LTS-SP4 base image.
1wget http://repo.huaweicloud.com/openeuler/openEuler-22.03-LTS-SP4/docker_img/aarch64/openEuler-docker.aarch64.tar.xz - Import the downloaded base image.
1podman load -i openEuler-docker.aarch64.tar.xz
- Create a container based on the image. Before starting the container, run the unset commands to reset the proxy environment variables on the physical machine.
1 2 3
unset http_proxy unset https_proxy podman run -dit --name openeuler2203sp4_base --hostname openeuler2203sp4_base -p 10000:22 --privileged --ipc=host docker.io/library/openeuler-22.03-lts-sp4:latest
- Access the container.
1podman exec -it openeuler2203sp4_base /bin/bash
- Configure environment variables such as proxies in the container. You are not advised to configure the environment variables in bashrc.
1 2 3
export TMOUT=0 export http_proxy=http://xxx // Set it as required. export https_proxy=http://xxx // Set it as required.
- Install the software packages in the container.
1yum install openssh-server openssh-clients passwd vim perf sysstat dos2unix htop sshpass jq numactl hostname python3 python3-devel python3-pip tar createrepo ipmitool iproute git systemd psmisc udev wget rpmdevtools gtk-doc pam-devel xmlsec1-devel libtool libtool-ltdl-devel cmake gcc-c++ libstdc++-static java-1.8.0-openjdk java-1.8.0-openjdk-devel fio iputils make -y
- Install the RDMA dependency packages in the container.
1yum install libibverbs-devel librdmacm-devel numactl-devel -y
- Exit the container and create an image.
1 2
exit podman commit openeuler2203sp4_base openeuler2203sp4_base:v2203sp4
- Start the compilation container.
1podman run --name openeuler2203sp4_build --hostname openeuler2203sp4_base -p 10001:22 --privileged --ipc=host -dti localhost/openeuler2203sp4_base:v2203sp4 /usr/sbin/init
- Create a deployment container.
1podman run --name openeuler2203sp4_release --hostname openeuler2203sp4_base -p 10003:22 --privileged --ipc=host -dti localhost/openeuler2203sp4_base:v2203sp4 /usr/sbin/init
- Verify that the container environment variables do not contain proxy configurations. Otherwise, reset the proxy environment variables on the physical machine and perform steps from 3.
1podman inspect openeuler2203sp4_release | grep Env -A 10

- You can run the following commands to delete a container. [CONTAINER_ID] can be queried by running the podman ps command.
1 2
podman stop [CONTAINER_ID] podman rm [CONTAINER_ID]
- You can run the following command to delete an image. [IMAGE_ID] can be queried by running the podman images command. To delete an image, you need to delete all containers created based on the image as well.
1podman rmi [IMAGE_ID]
- You can run the following commands to delete a container. [CONTAINER_ID] can be queried by running the podman ps command.
Parent topic: Preparing the Compilation Environment