Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement distributed training using Kubernetes #77

Merged
merged 17 commits into from
Jan 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docker for custom keygen
  • Loading branch information
leogao2 committed Jan 23, 2021
commit e682f7f289b75c7087e7d3afc04999156eaf287f
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ RUN echo 'AuthorizedKeysFile .ssh/authorized_keys' >> /etc/ssh/sshd_config &
RUN python3 -m pip install --upgrade pip && \
pip3 install torch pipx && \
python3 -m pipx ensurepath && \
mkdir /app

RUN mkdir -p ~/.ssh && \
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQChClBdh2UXpMhBV725nH1bMsGVaLmYAp8uMZFHtBqHN56sj/35jeenQTqr/Tov3u6xwqJK+rxegjgcPDZfuOSdsNnTMCLIacA/WqBMwW1mjdMc+zFOub7vQJHj4nmeF3pd4tSjt720ZLiX1ZsF5QrTIcnURAXT0/82SKIy2nqj18v9HCcIvBplexJU3SlVg+oWk/e5CsfnXvJMQH3VqJaeyrXIlaFgVOvVWSBY66Kc2H+g1RxLwe+BONyNanxSXxKHQwUXawBvXIyjekapB3HiNWLZZfZjNmqe2Ci+Y9PKn0CrkgXopIP7tVKn+UQ2fD3nSjaZyfRrmcFgXdotFKJh root@sshd-sid-79b6f9d7c6-mmw8x' > ~/.ssh/authorized_keys && \
echo 'Host *' > ~/.ssh/config && \
echo ' StrictHostKeyChecking no' >> ~/.ssh/config && \
chmod 600 ~/.ssh/config
mkdir /app && \
mkdir ~/.ssh


WORKDIR /app
Expand Down
6 changes: 3 additions & 3 deletions deploy_k8s.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
kubectl delete deploy/eleuther-neox
kubectl apply -f kubernetes/deploy_k8s.yml
echo Waiting for deploy to complete...
rm id_rsa*
ssh-keygen -t rsa -f id_rsa -N ""
echo Waiting for deploy to complete...
kubectl wait --for=condition=available --timeout=600s deployment/eleuther-neox || exit

kubectl get pods -o wide | grep eleuther-neox | awk '{print $6 " slots=8"}' > hosts
export MASTER_ID=$(kubectl get pods | grep eleuther-neox | awk '{print $1}' | head -n 1)
echo $MASTER_ID
kubectl cp $PWD/hosts $MASTER_ID:/app
kubectl cp $PWD/id_ed25519 $MASTER_ID:/root/.ssh
kubectl cp $PWD/id_rsa $MASTER_ID:/root/.ssh

mv id_rsa.pub authorized_keys

Expand All @@ -19,5 +18,6 @@ do
kubectl cp $PWD/authorized_keys $MASTER_ID:/root/.ssh/
done
rm authorized_keys hosts
rm id_rsa*
#echo 'git remote set-url origin https://github.com/EleutherAI/gpt-neox/ && git pull' | kubectl exec --stdin --tty $MASTER_ID -- /bin/bash
kubectl exec --stdin --tty $MASTER_ID -- /bin/bash