From 53c484654a2075a223d40075b1d1a45c4d6109cc Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Fri, 9 Apr 2021 15:40:10 +0800 Subject: [PATCH 01/12] test self hosted runner --- .github/workflows/persubmit.yml | 206 +++----------------------------- 1 file changed, 16 insertions(+), 190 deletions(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index 73ded1780..b991094aa 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -4,198 +4,24 @@ on: types: [opened, synchronize, reopened] jobs: - build_and_test_cpu_required: - # This job will be required to pass before merging to master branch. - name: Required Build and Test (CPU) - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip ci') }} - strategy: - matrix: - include: - - os: ubuntu-latest - python: 3.6 - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - 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 - run: | - export TAICHI_REPO_DIR=`pwd` - export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH - export CXX=clang++ - python misc/ci_setup.py ci - env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON - - - name: Test - run: | - export TAICHI_REPO_DIR=`pwd` - export PATH=$TAICHI_REPO_DIR/bin:$PATH - export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH - export PYTHONPATH=$TAICHI_REPO_DIR/python - python examples/laplace.py - ti diagnose - ./build/taichi_cpp_tests - ti test -vr2 -t2 - build_and_test_cpu: - name: Build and Test (CPU) - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip ci') && github.event.sender.login != 'taichi-gardener' }} - 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 }} + build_and_test_gpu_windows: + name: Build and Test (Windows GPU) + runs-on: [self-hosted, Windows] steps: - uses: actions/checkout@v2 - - 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 run: | - export TAICHI_REPO_DIR=`pwd` - export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH - export CXX=clang++ - python misc/ci_setup.py ci - env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=${{ matrix.with_cc }} -DTI_BUILD_TESTS:BOOL=${{ matrix.with_cpp_tests }} - - - name: Test - run: | - export TAICHI_REPO_DIR=`pwd` - export PATH=$TAICHI_REPO_DIR/bin:$PATH - export PATH=$TAICHI_REPO_DIR/taichi-llvm/bin/:$PATH - export PYTHONPATH=$TAICHI_REPO_DIR/python - python examples/laplace.py - ti diagnose - [ "$RUN_CPP_TESTS" = "ON" ] && ./build/taichi_cpp_tests - ti test -vr2 -t2 - env: - RUN_CPP_TESTS: ${{ matrix.with_cpp_tests }} - - build_and_test_gpu: - name: Build and Test (GPU) - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip ci') && github.event.sender.login != 'taichi-gardener' }} - runs-on: [zhen] - steps: - - uses: actions/checkout@v2 - - - name: Build - run: | - git --version - export TAICHI_REPO_DIR=`pwd` - export PATH=/home/github/taichi-llvm/bin/:$PATH - export CXX=clang++-8 - export PYTHON=/usr/bin/python3.7 - $PYTHON misc/ci_setup.py ci - env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_CC:BOOL=OFF - - - name: Test - run: | - export PYTHON=/usr/bin/python3.7 - export TAICHI_REPO_DIR=`pwd` - export PATH=$TAICHI_REPO_DIR/bin:$PATH - export PATH=/home/github/taichi-llvm/bin/:$PATH - export PYTHONPATH=$TAICHI_REPO_DIR/python - export DISPLAY=:1 - glewinfo - $PYTHON examples/laplace.py - ti diagnose - ti test -vr2 -t2 - - check_previous_run: - name: Checks the Workflow Run of the Previous Commit - runs-on: ubuntu-latest - if: ${{ contains(github.event.pull_request.labels.*.name, 'skip ci') || github.event.sender.login == 'taichi-gardener' }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Check the previous run - env: - PR: ${{ github.event.pull_request.number }} - SHA: ${{ github.event.pull_request.head.sha }} - # https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token - # https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets - # Do not leak the secret - OAUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - python misc/ci_check_previous_run.py --pr "${PR}" --sha "${SHA}" --token "${OAUTH_TOKEN}" - - code_format: - name: 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: Check code format - run: | - git fetch https://github.com/taichi-dev/taichi.git refs/heads/master - git reset FETCH_HEAD - git add . - git config user.email "taichigardener@gmail.com" - git config user.name "Taichi Gardener" - git commit -m "fake squash commit" || true - git checkout -b _last_squash - git checkout -b _enforced_format - git reset FETCH_HEAD - python3 -m pip install --user yapf gitpython colorama - python3 python/taichi/code_format.py - git add . - git commit -m "enforce code format" || true - # exit with 1 if there were differences: - git diff _last_squash _enforced_format --exit-code - - title_format: - name: Check PR Title - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - 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 }} + cd + echo %PATH% + where msbuild + shell: cmd + env: + CI_SETUP_CMAKE_ARGS: -DTI_WITH_CUDA:BOOL=ON -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=OFF + # - name: Test + # run: | + # set TAICHI_REPO_DIR=C:\taichi + + # ti diagnose + # ti test -vr2 -t2 + # shell: cmd From 50d597091613a68aa81b851de8c53e7d668502d1 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Fri, 9 Apr 2021 19:18:25 +0800 Subject: [PATCH 02/12] add build --- .github/workflows/persubmit.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index b991094aa..e30a01969 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -12,12 +12,15 @@ jobs: - uses: actions/checkout@v2 - name: Build run: | - cd + FOR /F "tokens=* USEBACKQ" %F IN (`cd`) DO (set TAICHI_REPO_DIR=%F) + echo %TAICHI_REPO_DIR% + set PATH=%TAICHI_REPO_DIR%\bin;%PATH% echo %PATH% - where msbuild + clang --version + mkdir build + cd build + cmake .. -G"Visual Studio 16 2019" -A x64 -DPYTHON_EXECUTABLE=python -DLLVM_DIR="C:\LLVM\taichi-llvm-10.0.0-msvc2019\lib\cmake\llvm" -DTI_WITH_CUDA=ON -DTI_WITH_OPENGL=OFF -DTI_WITH_CC=OFF shell: cmd - env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_CUDA:BOOL=ON -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=OFF # - name: Test # run: | # set TAICHI_REPO_DIR=C:\taichi From 0f4c9526a6dd95bccc802621367446f83dd6cca3 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Fri, 9 Apr 2021 19:27:20 +0800 Subject: [PATCH 03/12] double pct: --- .github/workflows/persubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index e30a01969..90a93a76f 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v2 - name: Build run: | - FOR /F "tokens=* USEBACKQ" %F IN (`cd`) DO (set TAICHI_REPO_DIR=%F) + FOR /F "tokens=* USEBACKQ" %%F IN (`cd`) DO (set TAICHI_REPO_DIR=%%F) echo %TAICHI_REPO_DIR% set PATH=%TAICHI_REPO_DIR%\bin;%PATH% echo %PATH% From ed2ed0716e7ac175897fe8fdd254213f40749b74 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Fri, 9 Apr 2021 19:29:42 +0800 Subject: [PATCH 04/12] msbuild --- .github/workflows/persubmit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index 90a93a76f..c56824e2a 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -10,7 +10,7 @@ jobs: runs-on: [self-hosted, Windows] steps: - uses: actions/checkout@v2 - - name: Build + - name: Build and Test run: | FOR /F "tokens=* USEBACKQ" %%F IN (`cd`) DO (set TAICHI_REPO_DIR=%%F) echo %TAICHI_REPO_DIR% @@ -20,6 +20,7 @@ jobs: mkdir build cd build cmake .. -G"Visual Studio 16 2019" -A x64 -DPYTHON_EXECUTABLE=python -DLLVM_DIR="C:\LLVM\taichi-llvm-10.0.0-msvc2019\lib\cmake\llvm" -DTI_WITH_CUDA=ON -DTI_WITH_OPENGL=OFF -DTI_WITH_CC=OFF + msbuild /p:Configuration=RelWithDebInfo /p:Platform=x64 /m taichi.sln shell: cmd # - name: Test # run: | From a34c2c72069389fddc1bcde692f50beff424bda7 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Fri, 9 Apr 2021 19:35:11 +0800 Subject: [PATCH 05/12] init submodule --- .github/workflows/persubmit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index c56824e2a..18db392af 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -14,8 +14,10 @@ jobs: run: | FOR /F "tokens=* USEBACKQ" %%F IN (`cd`) DO (set TAICHI_REPO_DIR=%%F) echo %TAICHI_REPO_DIR% + git submodule update --init --recursive set PATH=%TAICHI_REPO_DIR%\bin;%PATH% echo %PATH% + set PYTHONPATH=%TAICHI_REPO_DIR%/python clang --version mkdir build cd build From 8eb70ab391fd80120dda59bfb66972008ad3b5e6 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Fri, 9 Apr 2021 19:49:50 +0800 Subject: [PATCH 06/12] s --- .github/workflows/persubmit.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index 18db392af..4c93ba515 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -9,20 +9,28 @@ jobs: name: Build and Test (Windows GPU) runs-on: [self-hosted, Windows] steps: + - name: Show CD + run: | + cd + shell: cmd - uses: actions/checkout@v2 - name: Build and Test run: | FOR /F "tokens=* USEBACKQ" %%F IN (`cd`) DO (set TAICHI_REPO_DIR=%%F) echo %TAICHI_REPO_DIR% - git submodule update --init --recursive set PATH=%TAICHI_REPO_DIR%\bin;%PATH% echo %PATH% set PYTHONPATH=%TAICHI_REPO_DIR%/python clang --version + python misc/ci_setup.py ci" mkdir build cd build cmake .. -G"Visual Studio 16 2019" -A x64 -DPYTHON_EXECUTABLE=python -DLLVM_DIR="C:\LLVM\taichi-llvm-10.0.0-msvc2019\lib\cmake\llvm" -DTI_WITH_CUDA=ON -DTI_WITH_OPENGL=OFF -DTI_WITH_CC=OFF msbuild /p:Configuration=RelWithDebInfo /p:Platform=x64 /m taichi.sln + cd .. + python -c "import taichi" + python examples/laplace.py + python bin/taichi diagnose shell: cmd # - name: Test # run: | From daaaf1dd78c3f145bccff4ef5e7048fc5fce3877 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Fri, 9 Apr 2021 19:56:07 +0800 Subject: [PATCH 07/12] rm prev run --- .github/workflows/persubmit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index 4c93ba515..a7e9d3b4f 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -9,9 +9,9 @@ jobs: name: Build and Test (Windows GPU) runs-on: [self-hosted, Windows] steps: - - name: Show CD + - name: Clean Up the Previous Run run: | - cd + del /S . shell: cmd - uses: actions/checkout@v2 - name: Build and Test From 7eff9d7431a9451b2b9a84e54137c49940ea7500 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Fri, 9 Apr 2021 20:47:51 +0800 Subject: [PATCH 08/12] diagnose --- .github/workflows/persubmit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index a7e9d3b4f..48f83e5e2 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Clean Up the Previous Run run: | - del /S . + del /S /q . shell: cmd - uses: actions/checkout@v2 - name: Build and Test @@ -30,7 +30,7 @@ jobs: cd .. python -c "import taichi" python examples/laplace.py - python bin/taichi diagnose + python python/taichi/main.py diagnose shell: cmd # - name: Test # run: | From 946cf83d83410db316cda57bf129cf5a73702d5a Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Sat, 10 Apr 2021 12:14:02 +0800 Subject: [PATCH 09/12] %PYTHON% --- .github/workflows/persubmit.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index 48f83e5e2..0bdee156a 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -18,20 +18,22 @@ jobs: run: | FOR /F "tokens=* USEBACKQ" %%F IN (`cd`) DO (set TAICHI_REPO_DIR=%%F) echo %TAICHI_REPO_DIR% + set PYTHONPATH=%TAICHI_REPO_DIR%/python set PATH=%TAICHI_REPO_DIR%\bin;%PATH% echo %PATH% - set PYTHONPATH=%TAICHI_REPO_DIR%/python clang --version - python misc/ci_setup.py ci" + %PYTHON% misc/ci_setup.py ci mkdir build cd build - cmake .. -G"Visual Studio 16 2019" -A x64 -DPYTHON_EXECUTABLE=python -DLLVM_DIR="C:\LLVM\taichi-llvm-10.0.0-msvc2019\lib\cmake\llvm" -DTI_WITH_CUDA=ON -DTI_WITH_OPENGL=OFF -DTI_WITH_CC=OFF + cmake .. -G"Visual Studio 16 2019" -A x64 -DPYTHON_EXECUTABLE=%PYTHON% -DLLVM_DIR="C:\LLVM\taichi-llvm-10.0.0-msvc2019\lib\cmake\llvm" -DTI_WITH_CUDA=ON -DTI_WITH_OPENGL=OFF -DTI_WITH_CC=OFF msbuild /p:Configuration=RelWithDebInfo /p:Platform=x64 /m taichi.sln cd .. - python -c "import taichi" - python examples/laplace.py - python python/taichi/main.py diagnose + %PYTHON% -c "import taichi" + %PYTHON% examples/laplace.py + %PYTHON% bin/ti test -t2 shell: cmd + env: + PYTHON: C:\Python\Python38\python.exe # - name: Test # run: | # set TAICHI_REPO_DIR=C:\taichi From 47790188c054053986c43fa18ae16a74ad70cd9d Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Sat, 10 Apr 2021 12:37:37 +0800 Subject: [PATCH 10/12] t1 v --- .github/workflows/persubmit.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index 0bdee156a..e6ff9f48b 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -9,10 +9,10 @@ jobs: name: Build and Test (Windows GPU) runs-on: [self-hosted, Windows] steps: - - name: Clean Up the Previous Run - run: | - del /S /q . - shell: cmd + # - name: Clean Up the Previous Run + # run: | + # del /S /q . + # shell: cmd - uses: actions/checkout@v2 - name: Build and Test run: | @@ -30,7 +30,7 @@ jobs: cd .. %PYTHON% -c "import taichi" %PYTHON% examples/laplace.py - %PYTHON% bin/ti test -t2 + %PYTHON% bin/ti test -t1 -v shell: cmd env: PYTHON: C:\Python\Python38\python.exe From 4f94dcef56e6b8130acb649443386c5150205b69 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Sat, 10 Apr 2021 13:22:49 +0800 Subject: [PATCH 11/12] -t2 -vr2 --- .github/workflows/persubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index e6ff9f48b..04a8cfd6b 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -30,7 +30,7 @@ jobs: cd .. %PYTHON% -c "import taichi" %PYTHON% examples/laplace.py - %PYTHON% bin/ti test -t1 -v + %PYTHON% bin/ti test -t2 -vr2 shell: cmd env: PYTHON: C:\Python\Python38\python.exe From 78c27f3c83d1fd8aab8dc68dbc2a48f020104f54 Mon Sep 17 00:00:00 2001 From: Ye Kuang Date: Sat, 10 Apr 2021 15:25:48 +0800 Subject: [PATCH 12/12] t1 --- .github/workflows/persubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/persubmit.yml b/.github/workflows/persubmit.yml index 04a8cfd6b..e6ff9f48b 100644 --- a/.github/workflows/persubmit.yml +++ b/.github/workflows/persubmit.yml @@ -30,7 +30,7 @@ jobs: cd .. %PYTHON% -c "import taichi" %PYTHON% examples/laplace.py - %PYTHON% bin/ti test -t2 -vr2 + %PYTHON% bin/ti test -t1 -v shell: cmd env: PYTHON: C:\Python\Python38\python.exe