Skip to content

Commit

Permalink
use docker CI (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonz5288 authored Oct 21, 2021
1 parent 0270085 commit a53792a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 10 deletions.
34 changes: 24 additions & 10 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,30 @@ on:
types: [opened, synchronize, reopened]

jobs:
docker_cpu_build:
runs-on: ubuntu-latest
container: registry.taichigraphics.com/taichidev-ubuntu20.04-test:v0.1
steps:
- run: |
ti test

docker_gpu_build:
runs-on: [self-hosted, cuda, vulkan]
container: registry.taichigraphics.com/taichidev-ubuntu20.04-test:v0.1
docker_cpu_test:
runs-on: [self-hosted, cn, cuda, vulkan]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'

- run: |
ti test
docker create --user dev --name taichi --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.taichigraphics.com/taichidev-ubuntu20.04:v0.1.0 /home/dev/taichi/.github/workflows/scripts/unix_docker_build.sh CI_SETUP_CMAKE_ARGS=$CI_SETUP_CMAKE_ARGS PY=$PY
docker cp ./taichi taichi:/home/dev/taichi
docker start -a taichi
env:
DISPLAY: :1
CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON
PY: py38
- name: clean docker container
if: always()
run: docker rm taichi -f

##- uses: addnab/docker-run-action@v3
## with:
## username: admin

#- uses: docker://registry.taichigraphics.com/taichidev-ubuntu20.04-test:v0.1

29 changes: 29 additions & 0 deletions .github/workflows/scripts/unix_docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -ex

# Parse ARGs
for ARGUMENT in "$@"
do
KEY=$(echo $ARGUMENT | cut -f1 -d=)
VALUE=$(echo $ARGUMENT | cut -f2 -d=)
case "$KEY" in
CI_SETUP_CMAKE_ARGS) SHA=${VALUE} ;;
PY) PY=${VALUE} ;;
*)
esac
done

source /home/dev/miniconda/etc/profile.d/conda.sh
conda activate $PY

cd taichi
python3 -m pip install --user -r requirements_dev.txt
python3 -m pip install torch==1.9.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
TAICHI_CMAKE_ARGS=$CI_SETUP_CMAKE_ARGS python3 setup.py install --user

export TI_IN_DOCKER=true

ti diagnose
ti test -vr2 -t2 -k "not ndarray and not torch"
ti test -vr2 -t1 -k "ndarray or torch"

0 comments on commit a53792a

Please sign in to comment.