跳到主要内容

算力接入

本文档意在将闲置的算力接入OpenCSG,实现算力转租功能

1.0 联系我们洽谈合作

contact@opencsg.com

2.0 达成意向后配置机器

2.1 安装docker

curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
apt-get install docker-ce docker-ce-cli containerd.io

2.2 安装nvidia-container-toolkit

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-container-toolkit

2.3 安装nvidia-container-toolkit

2.4 enable TLS for docker client, 联系contact@opencsg.com 获取证书

cert localtion: packages/server/docker_client/cert
enable TLS for docker : /lib/systemd/system/docker.service, add following parameters:
-H tcp://0.0.0.0:31375 --tlsverify --tlscacert /root/cert/ca.pem --tlscert /root/cert/cert.pem --tlskey /root/cert/key.pem

systemctl daemon-reload
systemctl restart docker

2.5 设置文件系统quota

mkfs.xfs /dev/xxx
mount -o pquota /dev/xxx /data

2.6 配置docker使用quota系统

vim /etc/docker/daemon.json and add following:

{
"runtimes": {
"nvidia": {
"args": [],
"path": "nvidia-container-runtime"
}
},
"storage-opts": [
"overlay2.size=40G"
],
"data-root": "/data/docker"
}

2.7 重启docker

systemctl restart docker