1

For deployment before V1.0.0, the Admin. can start and keep one dev-box container for each single OpenPAI cluster. Therefore the Admin. can have multiple dev-box containers on single host/VM for different OpenPAI cluster deployment and management(E.g. add worker)

Based on V1.0.0 deployment SOP on https://openpai.readthedocs.io/en/release-1.0.0/manual/cluster-admin/installation-guide.html#installation-guide, the devbox containers will be created and deleted in quick-start-kubespray.sh and quick-start-service.sh scripts. It seems that we can only have one devbox host/VM for one OpenPAI cluster deployment and managemnt when kubectl is chosen to be installed on devbox host in the last step of deployment. In that way dev-box host/VM needed to be created for each OpenPAI deployment.

Is it possible to have one devbox host/VM for multiple cluster deployment and management?

Joseph
  • 35
  • 3

1 Answers1

1

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.

  1. 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
  1. 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}
  • Kube config backup
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
  1. 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}
AlbaTesl
  • 11
  • 4
  • During V1.0.0 deployment, https://openpai.readthedocs.io/en/release-1.0.0/manual/cluster-admin/installation-guide.html#installation-guide, another 2 scripts are used to deploy k8s and openpai - ~/pai/contrib/kubespray/quick-start-kubespray.sh - ~/pai/contrib/kubespray/quick-start-service.sh Lots of "sudo ..." in those scripts and the sudo is not found by docker instance by default. Therefore I am not sure how to execute those 2 V1.0.0 scripts inside docker instance. – Joseph Jun 11 '20 at 03:36