Skip to content

Commit

Permalink
[Refactor] Decouple docker build and wheel build (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzh119 authored Jul 19, 2023
1 parent 694d4db commit 786dba2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 17 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build_docker_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# GH actions.
name: Build Docker Images


on:
workflow_dispatch:

jobs:
Build:
strategy:
matrix:
platform:
- cpu
- cu116
- cu117
- cu118
- cu121

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.MLCAI_DOCKERHUB_USERNAME }}
password: ${{ secrets.MLCAI_DOCKERHUB_TOKEN }}
- name: Build Docker image
run: |
set -eux
cd docker
docker built -t package-${{ matrix.platform }} -f Dockerfile.package-${{ matrix.platform }} .
- name: Upload to Docker Hub
if: ${{ github.ref == 'refs/heads/main' }}
run: |
set -eux
NEW_TAG=$(git log -1 --format='%h')
docker tag docker-${{ matrix.platform }} mlcaidev/package-${{ matrix.platform }}:$NEW_TAG
docker push mlcaidev/package-${{ matrix.platform }}:$NEW_TAG
18 changes: 7 additions & 11 deletions .github/workflows/wheel_manylinux_nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
# matrix of build configs
config:
- cuda: 'none'
dockerfile: 'Dockerfile.package-cpu'
image: 'mlcaidev/package-cpu:694d4db'
- cuda: '11.6'
dockerfile: 'Dockerfile.package-cu116'
image: 'mlcaidev/package-cu116:694d4db'
- cuda: '11.7'
dockerfile: 'Dockerfile.package-cu117'
image: 'mlcaidev/package-cu117:694d4db'
- cuda: '11.8'
dockerfile: 'Dockerfile.package-cu118'
image: 'mlcaidev/package-cu118:694d4db'
- cuda: '12.1'
dockerfile: 'Dockerfile.package-cu121'
image: 'mlcaidev/package-cu121:694d4db'

runs-on: ubuntu-latest

Expand All @@ -49,19 +49,15 @@ jobs:
run: |
python scripts/sync_package.py --cuda ${{ matrix.config.cuda }} --package tvm --package-name ${{ matrix.pkg }} --revision origin/mlc --skip-checkout --skip-conda
python scripts/sync_package.py --cuda ${{ matrix.config.cuda }} --package mlc-llm --package-name ${{ matrix.mlc-chat-pkg }} --revision origin/main --skip-checkout --skip-conda
- name: Docker build
run: |
cd docker
docker build -t mlc-ai-${{ matrix.config.cuda }} . -f ${{ matrix.config.dockerfile }}
- name: Build TVM Unity
env:
IMAGE: mlc-ai-${{ matrix.config.cuda }}
IMAGE: ${{ matrix.config.image }}
CUDA: ${{ matrix.config.cuda }}
run: |
docker/bash.sh --no-gpu $IMAGE ./scripts/build_mlc_ai_wheel_manylinux.sh --cuda $CUDA
- name: Build MLC-Chat
env:
IMAGE: mlc-ai-${{ matrix.config.cuda }}
IMAGE: ${{ matrix.config.image }}
CUDA: ${{ matrix.config.cuda }}
run: |
docker/bash.sh --no-gpu $IMAGE ./scripts/build_mlc_chat_wheel_manylinux.sh --cuda $CUDA
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/wheel_winmac_nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ jobs:
run: |
python3 scripts/sync_package.py --package tvm --package-name ${{ matrix.pkg }} --revision origin/mlc --skip-checkout --skip-conda
python3 scripts/sync_package.py --package mlc-llm --package-name ${{ matrix.mlc-chat-pkg }} --revision origin/main --skip-checkout --skip-conda
- uses: actions/cache@v1
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda/build-environment.yaml') }}
# Use conda for LLVM dep
- uses: conda-incubator/setup-miniconda@v2
with:
Expand Down

0 comments on commit 786dba2

Please sign in to comment.