setup runpod images
Browse files- .github/workflows/main.yml +33 -1
- docker/Dockerfile +4 -1
- docker/Dockerfile-runpod +11 -0
- scripts/runpod-entrypoint.sh +10 -0
.github/workflows/main.yml
CHANGED
|
@@ -31,10 +31,42 @@ jobs:
|
|
| 31 |
with:
|
| 32 |
context: .
|
| 33 |
build-args: |
|
| 34 |
-
BASE_TAG
|
| 35 |
file: ./docker/Dockerfile
|
| 36 |
push: ${{ github.event_name != 'pull_request' }}
|
| 37 |
tags: ${{ steps.metadata.outputs.tags }}
|
| 38 |
labels: ${{ steps.metadata.outputs.labels }}
|
| 39 |
cache-from: type=gha
|
| 40 |
cache-to: type=gha,mode=max
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
with:
|
| 32 |
context: .
|
| 33 |
build-args: |
|
| 34 |
+
BASE_TAG=${{ github.ref_name }}-base
|
| 35 |
file: ./docker/Dockerfile
|
| 36 |
push: ${{ github.event_name != 'pull_request' }}
|
| 37 |
tags: ${{ steps.metadata.outputs.tags }}
|
| 38 |
labels: ${{ steps.metadata.outputs.labels }}
|
| 39 |
cache-from: type=gha
|
| 40 |
cache-to: type=gha,mode=max
|
| 41 |
+
build-axolotl-runpod:
|
| 42 |
+
needs: build-axolotl
|
| 43 |
+
if: github.repository_owner == 'OpenAccess-AI-Collective'
|
| 44 |
+
# this job needs to be run on self-hosted GPU runners...
|
| 45 |
+
runs-on: self-hosted
|
| 46 |
+
steps:
|
| 47 |
+
- name: Checkout
|
| 48 |
+
uses: actions/checkout@v3
|
| 49 |
+
- name: Docker metadata
|
| 50 |
+
id: metadata
|
| 51 |
+
uses: docker/metadata-action@v3
|
| 52 |
+
with:
|
| 53 |
+
images: winglian/axolotl-runpod
|
| 54 |
+
- name: Login to Docker Hub
|
| 55 |
+
uses: docker/login-action@v2
|
| 56 |
+
with:
|
| 57 |
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
| 58 |
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
| 59 |
+
- name: Set up Docker Buildx
|
| 60 |
+
uses: docker/setup-buildx-action@v2
|
| 61 |
+
- name: Build
|
| 62 |
+
uses: docker/build-push-action@v4
|
| 63 |
+
with:
|
| 64 |
+
context: .
|
| 65 |
+
build-args: |
|
| 66 |
+
BASE_TAG=${{ github.ref_name }}
|
| 67 |
+
file: ./docker/Dockerfile-runpod
|
| 68 |
+
push: ${{ github.event_name != 'pull_request' }}
|
| 69 |
+
tags: ${{ steps.metadata.outputs.tags }}
|
| 70 |
+
labels: ${{ steps.metadata.outputs.labels }}
|
| 71 |
+
cache-from: type=gha
|
| 72 |
+
cache-to: type=gha,mode=max
|
docker/Dockerfile
CHANGED
|
@@ -4,7 +4,7 @@ FROM winglian/axolotl-base:$BASE_TAG
|
|
| 4 |
ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
|
| 5 |
|
| 6 |
RUN apt-get update && \
|
| 7 |
-
apt-get install -y vim
|
| 8 |
|
| 9 |
WORKDIR /workspace
|
| 10 |
|
|
@@ -16,3 +16,6 @@ RUN mkdir axolotl
|
|
| 16 |
COPY . axolotl/
|
| 17 |
RUN cd axolotl && \
|
| 18 |
pip install -e .[int4]
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
|
| 5 |
|
| 6 |
RUN apt-get update && \
|
| 7 |
+
apt-get install -y vim curl
|
| 8 |
|
| 9 |
WORKDIR /workspace
|
| 10 |
|
|
|
|
| 16 |
COPY . axolotl/
|
| 17 |
RUN cd axolotl && \
|
| 18 |
pip install -e .[int4]
|
| 19 |
+
|
| 20 |
+
# helper for huggingface-login cli
|
| 21 |
+
RUN git config --global credential.helper store
|
docker/Dockerfile-runpod
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ARG BASE_TAG=main
|
| 2 |
+
FROM winglian/axolotl:$BASE_TAG
|
| 3 |
+
|
| 4 |
+
RUN apt install --yes --no-install-recommends openssh-server tmux && \
|
| 5 |
+
mkdir -p ~/.ssh && \
|
| 6 |
+
chmod 700 ~/.ssh && \
|
| 7 |
+
echo -e "\n[[ -z \"\$TMUX\" ]] && { tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux; exit; }" >> ~/.bashrc && \
|
| 8 |
+
chmod +x /workdir/axolotl/scripts/runpod-entrypoint.sh
|
| 9 |
+
|
| 10 |
+
ENTRYPOINT ["/workdir/axolotl/scripts/runpod-entrypoint.sh"]
|
| 11 |
+
CMD ["sleep", "infinity"]
|
scripts/runpod-entrypoint.sh
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
echo $PUBLIC_KEY >> ~/.ssh/authorized_keys
|
| 4 |
+
chmod 700 -R ~/.ssh
|
| 5 |
+
|
| 6 |
+
# Start the SSH service in the background
|
| 7 |
+
service ssh start
|
| 8 |
+
|
| 9 |
+
# Execute the passed arguments (CMD)
|
| 10 |
+
exec "$@"
|