build dockerfile in gha
Browse files- .github/workflows/main.yml +29 -0
- Dockerfile +19 -0
.github/workflows/main.yml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: ci
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches:
|
| 6 |
+
- "main"
|
| 7 |
+
- "dev"
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
build:
|
| 11 |
+
runs-on: ubuntu-latest
|
| 12 |
+
steps:
|
| 13 |
+
- name: Checkout
|
| 14 |
+
uses: actions/checkout@v3
|
| 15 |
+
# - name: Login to Docker Hub
|
| 16 |
+
# uses: docker/login-action@v2
|
| 17 |
+
# with:
|
| 18 |
+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
| 19 |
+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
| 20 |
+
- name: Set up Docker Buildx
|
| 21 |
+
uses: docker/setup-buildx-action@v2
|
| 22 |
+
- name: Build
|
| 23 |
+
uses: docker/build-push-action@v4
|
| 24 |
+
with:
|
| 25 |
+
context: .
|
| 26 |
+
file: ./Dockerfile
|
| 27 |
+
push: false
|
| 28 |
+
tags: winglian/axolotl:latest
|
| 29 |
+
|
Dockerfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM huggingface/transformers-pytorch-deepspeed-latest-gpu:latest
|
| 2 |
+
|
| 3 |
+
RUN export TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
|
| 4 |
+
RUN apt-get update && \
|
| 5 |
+
apt-get install -y build-essential ninja-build vim git-lfs && \
|
| 6 |
+
git lfs install && \
|
| 7 |
+
pip3 install --force-reinstall https://download.pytorch.org/whl/nightly/cu117/torch-2.0.0.dev20230301%2Bcu117-cp38-cp38-linux_x86_64.whl --index-url https://download.pytorch.org/whl/nightly/cu117 && \
|
| 8 |
+
mdir /tmp/wheels && \
|
| 9 |
+
cd /tmp/wheels && \
|
| 10 |
+
curl -L -O https://github.com/winglian/axolotl/raw/wheels/wheels/deepspeed-0.9.2%2B7ddc3b01-cp38-cp38-linux_x86_64.whl && \
|
| 11 |
+
curl -L -O https://github.com/winglian/axolotl/raw/wheels/wheels/flash_attn-1.0.4-cp38-cp38-linux_x86_64.whl && \
|
| 12 |
+
pip install deepspeed-0.9.2%2B7ddc3b01-cp38-cp38-linux_x86_64.whl && \
|
| 13 |
+
pip install flash_attn-1.0.4-cp38-cp38-linux_x86_64.whl && \
|
| 14 |
+
pip install "peft @ git+https://github.com/huggingface/peft.git@main" --force-reinstall --no-dependencies
|
| 15 |
+
|
| 16 |
+
WORKDIR /workspace
|
| 17 |
+
ARG REF=main
|
| 18 |
+
RUN git clone https://github.com/winglian/axolotl && cd axolotl && git checkout $REF
|
| 19 |
+
RUN pip install -e .[int4]
|