If you depend on quick-start.sh to deploy openpai, there could be only on dev-box container in a host. But each time, after your deployment, you could do the following steps manually to setup an specific controll environment for the cluster which is deployed by you just before.
- Create a folder and name the folder as the cluster name.
YOUR_VERSION_ID='v1.0.0'
CLUSTER_NAME='example'
mkdir -p ${HOME}/pai-management/${CLUSTER_NAME}
mkdir -p ${HOME}/pai-management/${CLUSTER_NAME}/ansible
mkdir -p ${HOME}/pai-management/${CLUSTER_NAME}/quick-start-config
mkdir -p ${HOME}/pai-management/${CLUSTER_NAME}/openpai
mkdir -p ${HOME}/pai-management/${CLUSTER_NAME}/.kube
Copy the following file into the folder. Note: the files come from the deployment just before
- Ansible Backup (For kubernetes maintainence)
cd ${HOME}/pai-management/${CLUSTER_NAME}/ansible/
git clone https://github.com/kubernetes-sigs/kubespray.git
cd kubespray
git checkout release-2.11
cp -rfp ${HOME}/pai-deploy/kubespray/inventory/pai ${HOME}/pai-management/${CLUSTER_NAME}/ansible/kubespray/inventory/${CLUSTER_NAME}
cp -rf ${HOME}/pai-deploy/kubespray/inventory/pai/artifacts/admin.conf ${HOME}/pai-management/${CLUSTER_NAME}/.kube
- OpenPAI quick-start backup
cp -rf ${HOME}/pai-deploy/quick-start-config/ ${HOME}/pai-management/${CLUSTER_NAME}/openpai
cp -rf ${HOME}/pai-deploy/cluster-cfg -p ${HOME}/pai-management/${CLUSTER_NAME}/openpai
- Start up a dev-box and name it as the cluster name.
sudo docker run -itd \
-e COLUMNS=$COLUMNS -e LINES=$LINES -e TERM=$TERM \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${HOME}/pai-management/${CLUSTER_NAME}/openpai/quick-start-config/:/quick-start-config \
-v ${HOME}/pai-management/${CLUSTER_NAME}/openpai/cluster-cfg:/cluster-configuration \
-v ${HOME}/pai-management/${CLUSTER_NAME}/.kube:/root/.kube \
--pid=host \
--privileged=true \
--net=host \
--name=${CLUSTER_NAME} \
openpai/dev-box:${YOUR_VERSION_ID}