From 02700850f733f126e794a614e5d68cb1335e879d Mon Sep 17 00:00:00 2001 From: Jiasheng Zhang Date: Tue, 19 Oct 2021 14:35:39 +0800 Subject: [PATCH 01/14] use docker CI (#99) --- .github/workflows/presubmit.yml | 294 +------------------------------- 1 file changed, 9 insertions(+), 285 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 419820005..1c3b74f69 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -4,292 +4,16 @@ on: types: [opened, synchronize, reopened] jobs: - title_format: - name: Check PR Title - if: ${{ github.event.pull_request }} + docker_cpu_build: runs-on: ubuntu-latest + container: registry.taichigraphics.com/taichidev-ubuntu20.04-test:v0.1 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 + - run: | + ti test - - name: Run PR Title Checker - run: | - pip install semver GitPython - python misc/ci_check_pr_title.py "$PR_TITLE" - env: - PR_TITLE: ${{ github.event.pull_request.title }} - - check_code_format: - name: Check Code Format - runs-on: ubuntu-latest - # This job will be required to pass before merging to master branch. - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Setup git & clang-format - run: | - git config user.email "taichigardener@gmail.com" - git config user.name "Taichi Gardener" - git checkout -b _fake_squash - git remote add upstream https://github.com/taichi-dev/taichi.git - git fetch upstream master - sudo apt install clang-format-10 - - - name: Cache PIP - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ hashFiles('setup.py') }}-${{ hashFiles('requirements_dev.txt') }} - - - name: Install requirements - run: | - python3 -m pip install --user -r requirements_dev.txt - - - name: Check code format - run: | - python3 misc/code_format.py - git checkout -b _enforced_format - git commit -am "enforce code format" || true - # exit with 1 if there were differences: - git diff _fake_squash _enforced_format --exit-code - - - name: Pylint - run: | - # Make sure pylint doesn't regress - pylint python/taichi/ --disable=all --enable=C0415 - if [ $? -eq 0 ] - then - echo "PASSED: pylint is happy" - exit 0 - else - echo "FAILED: please run the pylint command above and make sure it passes" - exit 1 - fi - - build_and_test_cpu_required: - # This job will be required to pass before merging to master branch. - name: Required Build and Test (CPU) - needs: check_code_format - timeout-minutes: 60 - strategy: - matrix: - include: - - os: ubuntu-latest - python: 3.6 - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - - name: Download Pre-Built LLVM 10.0.0 - run: | - python misc/ci_download.py - mkdir taichi-llvm - cd taichi-llvm - unzip ../taichi-llvm.zip - env: - CI_PLATFORM: ${{ matrix.os }} - - - name: Build & Install - run: .github/workflows/scripts/unix_build.sh - env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=ON -DTI_WITH_VULKAN:BOOL=OFF -DTI_BUILD_TESTS:BOOL=ON - CXX: clang++ - - - name: Test - run: .github/workflows/scripts/unix_test.sh - - build_and_test_cpu: - name: Build and Test (CPU) - needs: build_and_test_cpu_required - timeout-minutes: 60 - strategy: - matrix: - include: - - os: macos-latest - python: 3.7 - with_cc: OFF - with_cpp_tests: ON - - os: ubuntu-latest - python: 3.9 - with_cc: OFF - with_cpp_tests: OFF - - os: ubuntu-latest - python: 3.8 - with_cc: ON - with_cpp_tests: OFF - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - - name: Download Pre-Built LLVM 10.0.0 - run: | - python misc/ci_download.py - mkdir taichi-llvm - cd taichi-llvm - unzip ../taichi-llvm.zip - env: - CI_PLATFORM: ${{ matrix.os }} - - - name: Build & Install - run: .github/workflows/scripts/unix_build.sh - env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=${{ matrix.with_cc }} -DTI_WITH_VULKAN:BOOL=OFF -DTI_BUILD_TESTS:BOOL=${{ matrix.with_cpp_tests }} - CXX: clang++ - # [DEBUG] Copy this step around to enable debugging inside Github Action instances. - #- name: Setup tmate session - # uses: mxschmitt/action-tmate@v3 - # with: - # limit-access-to-actor: true - - - name: Test - run: .github/workflows/scripts/unix_test.sh - env: - RUN_CPP_TESTS: ${{ matrix.with_cpp_tests }} - - build_and_test_gpu_linux: - name: Build and Test (GPU) - needs: check_code_format - runs-on: [self-hosted, cuda, vulkan, cn] - timeout-minutes: 60 - steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - - name: Build - run: | - export PATH=$PATH:/usr/local/cuda/bin - .github/workflows/scripts/unix_build.sh - env: - LLVM_LIB_ROOT_DIR: /opt/taichi-llvm-10.0.0 - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=ON - BUILD_NUM_THREADS: 8 - LLVM_PATH: /opt/taichi-llvm-10.0.0/bin - LLVM_DIR: /opt/taichi-llvm-10.0.0/lib/cmake/llvm - CXX: clang++-8 - - - name: Test - run: .github/workflows/scripts/unix_test.sh - env: - DISPLAY: :1 - GPU_TEST: ON - - build_and_test_windows: - name: Build and Test (Windows) - needs: check_code_format - runs-on: windows-latest - timeout-minutes: 90 - steps: - - - name: Install 7Zip PowerShell - shell: powershell - run: Install-Module 7Zip4PowerShell -Force -Verbose - - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 - - - name: Download And Install Vulkan - shell: powershell - run: | - Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.2.189.0/windows/VulkanSDK-1.2.189.0-Installer.exe" -OutFile VulkanSDK.exe - $installer = Start-Process -FilePath VulkanSDK.exe -Wait -PassThru -ArgumentList @("/S"); - $installer.WaitForExit(); - - - name: Build - shell: powershell - run: | - $env:Path += ";C:/VulkanSDK/1.2.189.0/Bin" - cd C:\ - Remove-item alias:curl - curl --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/taichi-llvm-10.0.0-msvc2019.zip -LO - 7z x taichi-llvm-10.0.0-msvc2019.zip -otaichi_llvm - curl --retry 10 --retry-delay 5 https://github.com/taichi-dev/taichi_assets/releases/download/llvm10/clang-10.0.0-win.zip -LO - 7z x clang-10.0.0-win.zip -otaichi_clang - $env:PATH = ";C:\taichi_llvm\bin;C:\taichi_clang\bin;" + $env:PATH - clang --version - cd D:\a\taichi\taichi - python -m pip install -r requirements_dev.txt - cd python - git fetch origin master - $env:TAICHI_CMAKE_ARGS = $env:CI_SETUP_CMAKE_ARGS - python build.py build - cd ..\dist - $env:WHL = $(dir *.whl) - python -m pip install $env:WHL - env: - PYTHON: C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe - CI_SETUP_CMAKE_ARGS: -G "Visual Studio 16 2019" -A x64 -DLLVM_DIR=C:\taichi_llvm\lib\cmake\llvm -DTI_WITH_VULKAN:BOOL=ON - VULKAN_SDK: C:/VulkanSDK/1.2.189.0 - - - name: Test - shell: powershell - run: | - $env:PATH = ";C:\taichi_llvm\bin;C:\taichi_clang\bin;" + $env:PATH - python -c "import taichi" - python examples/algorithm/laplace.py - python bin/taichi diagnose - python bin/taichi changelog - python bin/taichi test -vr2 -t2 - env: - PYTHON: C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe - - build_and_test_m1: - name: Build and Test (Apple M1) - needs: check_code_format - timeout-minutes: 60 - strategy: - matrix: - include: - - os: macos-latest - python: 3.8 - defaults: - run: - # https://github.com/actions/runner/issues/805#issuecomment-844426478 - shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}" - runs-on: [self-hosted, m1] + docker_gpu_build: + runs-on: [self-hosted, cuda, vulkan] + container: registry.taichigraphics.com/taichidev-ubuntu20.04-test:v0.1 steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - - name: Build - run: | - rm -rf $HOME/Library/Python/3.8/lib/python/site-packages/taichi - .github/workflows/scripts/unix_build.sh - env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CUDA:BOOL=OFF -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=OFF -DTI_BUILD_TESTS:BOOL=ON - CXX: clang++ - - - name: Test - run: | - export PATH=$PATH:$HOME/Library/Python/3.8/bin - python3 examples/algorithm/laplace.py - TI_LIB_DIR=`python3 -c "import taichi;print(taichi.__path__[0])" | tail -1` - TI_LIB_DIR="$TI_LIB_DIR/lib" ./build/taichi_cpp_tests - ti test -vr2 -t4 -x + - run: | + ti test From a53792a710aafb8461df74a7b2dcb809a80ba224 Mon Sep 17 00:00:00 2001 From: Jiasheng Zhang Date: Thu, 21 Oct 2021 17:43:01 +0800 Subject: [PATCH 02/14] use docker CI (#100) --- .github/workflows/presubmit.yml | 34 +++++++++++++------ .../workflows/scripts/unix_docker_build.sh | 29 ++++++++++++++++ 2 files changed, 53 insertions(+), 10 deletions(-) create mode 100755 .github/workflows/scripts/unix_docker_build.sh diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 1c3b74f69..60c95486a 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -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 + diff --git a/.github/workflows/scripts/unix_docker_build.sh b/.github/workflows/scripts/unix_docker_build.sh new file mode 100755 index 000000000..d4b284bba --- /dev/null +++ b/.github/workflows/scripts/unix_docker_build.sh @@ -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" From bb794963ee0bc47059056f0be493d5600d2a94e6 Mon Sep 17 00:00:00 2001 From: jiasheng Date: Thu, 21 Oct 2021 17:44:39 +0800 Subject: [PATCH 03/14] test docker ci --- .github/workflows/presubmit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 60c95486a..eb1d11db0 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -12,6 +12,7 @@ jobs: with: submodules: 'recursive' + # TESTING - run: | 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 From aaee88d92345a0ec6aa0666fa93afab30be8d63e Mon Sep 17 00:00:00 2001 From: jiasheng Date: Thu, 21 Oct 2021 19:09:18 +0800 Subject: [PATCH 04/14] test docker ci --- .github/workflows/presubmit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index eb1d11db0..1d215d757 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -14,6 +14,7 @@ jobs: # TESTING - run: | + mv test_actions taichi 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 From 53a1a0eb6bdab2672a89cc0c177c265bf44f1083 Mon Sep 17 00:00:00 2001 From: jiasheng Date: Thu, 21 Oct 2021 19:11:31 +0800 Subject: [PATCH 05/14] fix --- .github/workflows/presubmit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 1d215d757..202fa8819 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -14,6 +14,8 @@ jobs: # TESTING - run: | + pwd + ls mv test_actions taichi 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 From 107bc45e1c5422a905f89e91adc493b7123d1dff Mon Sep 17 00:00:00 2001 From: jiasheng Date: Thu, 21 Oct 2021 19:14:37 +0800 Subject: [PATCH 06/14] fix --- .github/workflows/presubmit.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 202fa8819..833ceb3a0 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -14,11 +14,9 @@ jobs: # TESTING - run: | - pwd - ls - mv test_actions taichi + mv ../test_actions ../taichi 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 cp ../taichi taichi:/home/dev/taichi docker start -a taichi env: DISPLAY: :1 From 174396e24b8a3ae18176de1790aef138436a76a2 Mon Sep 17 00:00:00 2001 From: jiasheng Date: Thu, 21 Oct 2021 20:02:15 +0800 Subject: [PATCH 07/14] fix --- .github/workflows/presubmit.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 833ceb3a0..a12de08e9 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -14,9 +14,8 @@ jobs: # TESTING - run: | - mv ../test_actions ../taichi 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 cp ../test_actions taichi:/home/dev/taichi docker start -a taichi env: DISPLAY: :1 From 1ac11ae20d8bff38d6d1e7d2aa01ff504e72cb01 Mon Sep 17 00:00:00 2001 From: Qiao Bo Date: Thu, 21 Oct 2021 22:10:52 +0800 Subject: [PATCH 08/14] Remove user flag --- .github/workflows/scripts/unix_docker_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/unix_docker_build.sh b/.github/workflows/scripts/unix_docker_build.sh index d4b284bba..b84c87797 100755 --- a/.github/workflows/scripts/unix_docker_build.sh +++ b/.github/workflows/scripts/unix_docker_build.sh @@ -18,9 +18,9 @@ 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 -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 +TAICHI_CMAKE_ARGS=$CI_SETUP_CMAKE_ARGS python3 setup.py install export TI_IN_DOCKER=true From a42288a70d7031383d8c7980b3e48ee22bb81c9d Mon Sep 17 00:00:00 2001 From: jiasheng Date: Fri, 22 Oct 2021 11:28:46 +0800 Subject: [PATCH 09/14] fix --- .github/workflows/scripts/unix_docker_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/unix_docker_build.sh b/.github/workflows/scripts/unix_docker_build.sh index b84c87797..bff36a656 100755 --- a/.github/workflows/scripts/unix_docker_build.sh +++ b/.github/workflows/scripts/unix_docker_build.sh @@ -8,7 +8,7 @@ do KEY=$(echo $ARGUMENT | cut -f1 -d=) VALUE=$(echo $ARGUMENT | cut -f2 -d=) case "$KEY" in - CI_SETUP_CMAKE_ARGS) SHA=${VALUE} ;; + CI_SETUP_CMAKE_ARGS) CI_SETUP_CMAKE_ARGS=${VALUE} ;; PY) PY=${VALUE} ;; *) esac From 25fba5a24785d57215bb1aeba89c3f158aed911b Mon Sep 17 00:00:00 2001 From: jiasheng Date: Fri, 22 Oct 2021 11:45:57 +0800 Subject: [PATCH 10/14] fix --- .github/workflows/presubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index a12de08e9..418c806a0 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -19,7 +19,7 @@ jobs: 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 + 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 From 0dd4b257269b49f0195b468f4c884f1c7e511919 Mon Sep 17 00:00:00 2001 From: jiasheng Date: Fri, 22 Oct 2021 14:56:24 +0800 Subject: [PATCH 11/14] fix --- .github/workflows/presubmit.yml | 2 +- .github/workflows/scripts/unix_docker_build.sh | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 418c806a0..4c1749c7d 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -14,7 +14,7 @@ jobs: # TESTING - run: | - 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 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 $PY docker cp ../test_actions taichi:/home/dev/taichi docker start -a taichi env: diff --git a/.github/workflows/scripts/unix_docker_build.sh b/.github/workflows/scripts/unix_docker_build.sh index bff36a656..5f4f3afc9 100755 --- a/.github/workflows/scripts/unix_docker_build.sh +++ b/.github/workflows/scripts/unix_docker_build.sh @@ -3,16 +3,9 @@ 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) CI_SETUP_CMAKE_ARGS=${VALUE} ;; - PY) PY=${VALUE} ;; - *) - esac -done +CI_SETUP_CMAKE_ARGS=$1 +PY=$2 +echo $CI_SETUP_CMAKE_ARGS source /home/dev/miniconda/etc/profile.d/conda.sh conda activate $PY From 9bb0c06695b19ba5a866493f6e4c41a9319cf38b Mon Sep 17 00:00:00 2001 From: jiasheng Date: Fri, 22 Oct 2021 16:11:00 +0800 Subject: [PATCH 12/14] fix --- .github/workflows/presubmit.yml | 2 +- .github/workflows/scripts/unix_docker_build.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 4c1749c7d..c3c50f1a1 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -14,7 +14,7 @@ jobs: # TESTING - run: | - 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 $PY + 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 $PY $CI_SETUP_CMAKE_ARGS docker cp ../test_actions taichi:/home/dev/taichi docker start -a taichi env: diff --git a/.github/workflows/scripts/unix_docker_build.sh b/.github/workflows/scripts/unix_docker_build.sh index 5f4f3afc9..cb0585469 100755 --- a/.github/workflows/scripts/unix_docker_build.sh +++ b/.github/workflows/scripts/unix_docker_build.sh @@ -3,8 +3,8 @@ set -ex # Parse ARGs -CI_SETUP_CMAKE_ARGS=$1 -PY=$2 +PY=$1 +CI_SETUP_CMAKE_ARGS=$2 echo $CI_SETUP_CMAKE_ARGS source /home/dev/miniconda/etc/profile.d/conda.sh From efa63b237be3265c8def209f61866ba3ef83f894 Mon Sep 17 00:00:00 2001 From: jiasheng Date: Fri, 22 Oct 2021 16:15:01 +0800 Subject: [PATCH 13/14] fix --- .github/workflows/presubmit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index c3c50f1a1..d995b51e3 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -14,12 +14,12 @@ jobs: # TESTING - run: | - 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 $PY $CI_SETUP_CMAKE_ARGS + 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 $PY "$CI_SETUP_CMAKE_ARGS" docker cp ../test_actions 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" + 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 From 114b289c6bfa72df14edddf8b532061dfa0eadab Mon Sep 17 00:00:00 2001 From: "Chengchen(Rex) Wang" <14366016+rexwangcc@users.noreply.github.com> Date: Sun, 24 Oct 2021 20:45:24 +0800 Subject: [PATCH 14/14] Update .github/workflows/presubmit.yml --- .github/workflows/presubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index d995b51e3..ff655dabf 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -15,7 +15,7 @@ jobs: # TESTING - run: | 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 $PY "$CI_SETUP_CMAKE_ARGS" - docker cp ../test_actions taichi:/home/dev/taichi + docker cp ../${{ github.event.repository.name }} taichi:/home/dev/taichi docker start -a taichi env: DISPLAY: :1