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
Fix ssh
  • Loading branch information
leogao2 committed Jan 23, 2021
commit 8a26b7e8897c8aeba4a29a210818d0c49e074084
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM atlanticcrypto/cuda-ssh-server:10.2-cudnn
StellaAthena marked this conversation as resolved.
Show resolved Hide resolved

RUN echo 'AuthorizedKeysFile .ssh/authorized_keys' >> /etc/ssh/sshd_config && \
echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config && \
apt-get update && \
RUN apt-get update && \
apt-get install -y git python3.8 python3.8-dev python3-pip sudo pdsh && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1

RUN python3 -m pip install --upgrade pip && \
python3 -m pip install --upgrade pip && \
pip3 install torch pipx && \
python3 -m pipx ensurepath && \
mkdir /app && \
mkdir ~/.ssh
python3 -m pipx ensurepath

RUN mkdir -p ~/.ssh /app && \
echo 'Host *' > ~/.ssh/config && \
echo ' StrictHostKeyChecking no' >> ~/.ssh/config && \
echo 'AuthorizedKeysFile .ssh/authorized_keys' >> /etc/ssh/sshd_config && \
echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config

WORKDIR /app

Expand All @@ -23,4 +22,4 @@ RUN sh ./install_deepspeed.sh
COPY requirements.txt /app
RUN pip install -r requirements.txt

COPY . /app
COPY . /app
3 changes: 2 additions & 1 deletion deploy_k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ do
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
echo 'chmod 600 ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chown -R root /root/.ssh' | kubectl exec --stdin --tty $MASTER_ID -- /bin/bash

kubectl exec --stdin --tty $MASTER_ID -- /bin/bash