diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 000000000..f294b7a9b --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,18 @@ +self-hosted-runner: + labels: + - cn + - cuda + - OpenGL + - vulkan + - m1 + - driver470 + - driver510 + - benchmark + - release + - build + - sm70 + - sm86 + - amdgpu + +# config-variables: +# - ENVIRONMENT_STAGE diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 359e06718..9d67a431c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,21 +5,32 @@ on: build_id: required: true type: string - project_name: - required: false - default: 'taichi' + nightly: + required: true + type: boolean + python: + required: true type: string secrets: + BOT_MINIO_ACCESS_KEY: + required: true + BOT_MINIO_SECRET_KEY: + required: true workflow_dispatch: inputs: build_id: + description: 'The build id. e.g.: 20230427-102544-abcdefab' required: true type: string - project_name: - required: false - default: 'taichi' + nightly: + description: 'Are we building nightly wheels?' + required: true + default: false + type: boolean + python: + description: 'JSON encoded python versions need building wheel. e.g.: ["3.7"]' + required: true type: string - secrets: concurrency: group: build-${{ github.event.number || github.run_id }} @@ -30,6 +41,7 @@ env: TI_SKIP_VERSION_CHECK: 'ON' CI_IMAGE_VERSION: '202304251731' TI_USE_GIT_CACHE: ${{ vars.TI_USE_GIT_CACHE }} + NIGHTLY: ${{ inputs.nightly && 'nightly' || '' }} jobs: show_environ: @@ -47,26 +59,20 @@ jobs: EOF build_cpu_mac: - name: Build macos (CPU) - needs: check_files - timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 120 || 180 }} + name: Build macOS (x86) + timeout-minutes: 30 strategy: matrix: - include: - - os: macos-10.15 - python: 3.7 - with_cpp_tests: ON - wanted_archs: 'cpu,vulkan' + python: ${{ fromJSON(inputs.python) }} runs-on: - self-hosted - - ${{ matrix.os }} + - macos-10.15 env: - PY: ${{ matrix.python }} TAICHI_CMAKE_ARGS: >- -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_C_API=ON - -DTI_BUILD_TESTS:BOOL=${{ matrix.with_cpp_tests }} + -DTI_WITH_C_API:BOOL=ON + -DTI_BUILD_TESTS:BOOL=ON steps: - name: Workaround checkout Needed single revision issue run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true @@ -76,54 +82,43 @@ jobs: fetch-depth: '0' submodules: 'recursive' - - name: Prepare Environment - run: | - . .github/workflows/scripts/common-utils.sh - prepare-build-cache - env: - PLATFORM: 'macos' + - name: Build + run: ./build.py ${NIGHTLY:+--nightly} --python=${{ matrix.python }} ${SHOULD_TAG_CONFIG:+--tag-config} - - name: Build & Install - if: needs.check_files.outputs.run_job == 'true' - run: | - # Use the molten-vk v1.1.10 downloaded from taichi assets - brew uninstall molten-vk -f - .github/workflows/scripts/build.py - env: - CXX: clang++ + - name: Upload Built Wheel + uses: shallwefootball/s3-upload-action@1.3.3 + with: + aws_key_id: ${{ secrets.BOT_MINIO_ACCESS_KEY }} + aws_secret_access_key: ${{ secrets.BOT_MINIO_SECRET_KEY }} + aws_bucket: built-wheels + source_dir: dist + destination_dir: /${{ inputs.build_id }} + endpoint: http://botmaster.tgr:9000 - build_gpu_linux: - name: Build (GPU) - needs: check_files - timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 120 }} + build_linux: + name: Build Linux + timeout-minutes: 30 strategy: matrix: - extra_markers: - - sm70 - - not sm70 - driver: - - driver470 - - driver510 + python: ${{ fromJSON(inputs.python) }} + cuda: [OFF, ON] + llvm: [OFF, ON] + gl: [OFF, ON] + vk: [OFF, ON] + tag: ['TAG'] + include: + - {cuda: ON, llvm: ON, gl: ON, vk: ON, tag: ''} - runs-on: - - self-hosted - - cn - - cuda - - vulkan - - ${{ matrix.driver }} - - ${{ matrix.extra_markers == 'sm70' && 'sm70' || 'Linux' }} + runs-on: [self-hosted, cn, Linux, build] env: - PY: '3.11' - PROJECT_NAME: taichi TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON + -DTI_WITH_CUDA:BOOL={{ matrix.cuda }} + -DTI_WITH_LLVM:BOOL={{ matrix.llvm }} + -DTI_WITH_OPENGL:BOOL={{ matrix.gl }} + -DTI_WITH_VULKAN:BOOL={{ matrix.vk }} -DTI_WITH_BACKTRACE:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON - TI_WANTED_ARCHS: 'cpu,cuda,vulkan,opengl,gles' - TI_DEVICE_MEMORY_GB: '1' - TI_RUN_RELEASE_TESTS: '1' steps: - name: Workaround checkout Needed single revision issue @@ -134,57 +129,34 @@ jobs: submodules: 'recursive' fetch-depth: '0' - - name: Prepare Environment - run: | - . .github/workflows/scripts/common-utils.sh - prepare-build-cache - echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV - - - name: Build & Install + - name: Build run: | - [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 . .github/workflows/scripts/common-utils.sh - ci-docker-run-gpu --name taichi-build \ + -v $(pwd):/home/dev/taichi \ registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py - - - name: Test - id: test - run: | - [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 - . .github/workflows/scripts/common-utils.sh - - ci-docker-run-gpu --name taichi-test \ - registry.botmaster.tgr/taichi-test-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/unix_test.sh + /home/dev/taichi/build.py ${NIGHTLY:+--nightly} --python=${{ matrix.python }} ${SHOULD_TAG_CONFIG:+--tag-config} env: - EXTRA_TEST_MARKERS: ${{ matrix.extra_markers }} - - - name: Save wheel if test failed - if: failure() && steps.test.conclusion == 'failure' - uses: actions/upload-artifact@v3 - with: - name: broken-wheel - path: dist/* - retention-days: 7 + SHOULD_TAG_CONFIG: ${{ matrix.tag }} - - name: Save Bad Captures - if: failure() && steps.test.conclusion == 'failure' - uses: actions/upload-artifact@v3 + - name: Upload Built Wheel + uses: shallwefootball/s3-upload-action@1.3.3 with: - name: bad-captures - path: taichi-release-tests/bad-compare/* - retention-days: 7 + aws_key_id: ${{ secrets.BOT_MINIO_ACCESS_KEY }} + aws_secret_access_key: ${{ secrets.BOT_MINIO_SECRET_KEY }} + aws_bucket: built-wheels + source_dir: dist + destination_dir: /${{ inputs.build_id }} + endpoint: http://botmaster.tgr:9000 build_manylinux2014: - name: Build (manylinux2014) - needs: check_files - runs-on: [self-hosted, cuda, cn, release] + name: Build manylinux2014 + timeout-minutes: 30 + runs-on: [self-hosted, cn, Linux, build] + strategy: + matrix: + python: ${{ fromJSON(inputs.python) }} env: - PY: "3.8" - PROJECT_NAME: taichi - TI_WANTED_ARCHS: "cuda,cpu" TAICHI_CMAKE_ARGS: >- -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_VULKAN:BOOL=OFF @@ -196,39 +168,33 @@ jobs: submodules: 'recursive' fetch-depth: '0' - - name: Prepare Environment - run: | - . .github/workflows/scripts/common-utils.sh - prepare-build-cache - echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV - - name: Build run: | . .github/workflows/scripts/common-utils.sh - ci-docker-run-gpu --name taichi-test \ - registry.botmaster.tgr/taichi-build-manylinux2014-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py - - - name: Test - run: | - . .github/workflows/scripts/common-utils.sh + ci-docker-run-gpu --name taichi-build \ + -v $(pwd):/home/dev/taichi \ + registry.botmaster.tgr/taichi-build-manylinux2014-cuda:${{ env.CI_IMAGE_VERSION }} \ + /home/dev/taichi/build.py ${NIGHTLY:+--nightly} --python=${{ matrix.python }} ${SHOULD_TAG_CONFIG:+--tag-config} - ci-docker-run-gpu --name taichi-test \ - registry.botmaster.tgr/taichi-test-manylinux2014-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/unix_test.sh + - name: Upload Built Wheel + uses: shallwefootball/s3-upload-action@1.3.3 + with: + aws_key_id: ${{ secrets.BOT_MINIO_ACCESS_KEY }} + aws_secret_access_key: ${{ secrets.BOT_MINIO_SECRET_KEY }} + aws_bucket: built-wheels + source_dir: dist + destination_dir: /${{ inputs.build_id }} + endpoint: http://botmaster.tgr:9000 build_amdgpu_linux: name: Build (AMDGPU) - needs: check_files - timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 120 }} - runs-on: [self-hosted, amdgpu] + timeout-minutes: 30 + strategy: + matrix: + python: ${{ fromJSON(inputs.python) }} + runs-on: [self-hosted, cn, Linux, build] env: - PY: '3.8' - PROJECT_NAME: taichi - TI_WANTED_ARCHS: 'cpu,amdgpu' - TI_DEVICE_MEMORY_GB: '1' - TI_RUN_RELEASE_TESTS: '0' TAICHI_CMAKE_ARGS: >- -DTI_WITH_CUDA:BOOL=OFF -DTI_WITH_VULKAN:BOOL=OFF @@ -245,79 +211,50 @@ jobs: submodules: 'recursive' fetch-depth: '0' - - name: Prepare Environment - run: | - . .github/workflows/scripts/common-utils.sh - prepare-build-cache - echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV - - name: Build & Install run: | - [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 . .github/workflows/scripts/common-utils.sh ci-docker-run-amdgpu --name taichi-build \ + -v $(pwd):/home/dev/taichi registry.botmaster.tgr/taichi-build-amdgpu:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py - - - name: Test - id: test - run: | - [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 - . .github/workflows/scripts/common-utils.sh + /home/dev/taichi/build.py ${NIGHTLY:+--nightly} --python=${{ matrix.python }} --tag-local=amd - ci-docker-run-amdgpu --name taichi-test \ - registry.botmaster.tgr/taichi-test-amdgpu:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/unix_test.sh - - - name: Save wheel if test failed - if: failure() && steps.test.conclusion == 'failure' - uses: actions/upload-artifact@v3 + - name: Upload Built Wheel + uses: shallwefootball/s3-upload-action@1.3.3 with: - name: broken-wheel - path: dist/* - retention-days: 7 - - - name: Save Bad Captures - if: failure() && steps.test.conclusion == 'failure' - uses: actions/upload-artifact@v3 - with: - name: bad-captures - path: taichi-release-tests/bad-compare/* - retention-days: 7 - + aws_key_id: ${{ secrets.BOT_MINIO_ACCESS_KEY }} + aws_secret_access_key: ${{ secrets.BOT_MINIO_SECRET_KEY }} + aws_bucket: built-wheels + source_dir: dist + destination_dir: /${{ inputs.build_id }} + endpoint: http://botmaster.tgr:9000 build_windows: name: Build Windows - needs: check_files strategy: matrix: - extra_markers: - - sm70 - - not sm70 - runs-on: - - self-hosted - - cn - - windows - - cuda - - OpenGL - - ${{ matrix.extra_markers == 'sm70' && 'sm70' || 'windows' }} - timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 180 }} + python: ${{ fromJSON(inputs.python) }} + cuda: [OFF, ON] + llvm: [OFF, ON] + gl: [OFF, ON] + vk: [OFF, ON] + tag: ['TAG'] + include: + - {cuda: ON, llvm: ON, gl: ON, vk: ON, tag: ''} + runs-on: [self-hosted, cn, Windows, build] + timeout-minutes: 30 env: - PY: "3.7" TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON + -DTI_WITH_CUDA:BOOL={{ matrix.cuda }} + -DTI_WITH_LLVM:BOOL={{ matrix.llvm }} + -DTI_WITH_OPENGL:BOOL={{ matrix.gl }} + -DTI_WITH_VULKAN:BOOL={{ matrix.vk }} + -DTI_WITH_BACKTRACE:BOOL=ON -DTI_WITH_DX11:BOOL=ON -DTI_WITH_DX12:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON - -DTI_WITH_BACKTRACE=ON -DTI_WITH_C_API=ON - TI_WANTED_ARCHS: cpu,cuda,vulkan,opengl,gles - TI_SKIP_VERSION_CHECK: ON - TI_DEVICE_MEMORY_GB: '1' - TI_RUN_RELEASE_TESTS: '1' - steps: - name: Workaround checkout Needed single revision issue run: | @@ -331,30 +268,29 @@ jobs: - uses: actions/setup-python@v4 with: + # force a 3.7 is ok, build.py will handle actual python env python-version: 3.7 - name: Build - if: ${{ needs.check_files.outputs.run_job != 'false' }} - shell: cmd - run: | - python .\.github\workflows\scripts\build.py - - - name: Test - id: test shell: pwsh - if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | - .\.github\workflows\scripts\win_test.ps1 -libsDir "$env:LocalAppData/buildbot" + $nightlyFlag = "" + if ($env:NIGHTLY) { $nightlyFlag = "--nightly" } + $tagFlag = "" + if ($env:SHOULD_TAG_CONFIG) { $tagFlag = "--tag-config" } + python build.py $nightlyFlag --python=${{ matrix.python }} $tagFlag env: - EXTRA_TEST_MARKERS: ${{ matrix.extra_markers }} + SHOULD_TAG_CONFIG: ${{ matrix.tag }} - - name: Save wheel if test failed - if: failure() && steps.test.conclusion == 'failure' - uses: actions/upload-artifact@v3 + - name: Upload Built Wheel + uses: shallwefootball/s3-upload-action@1.3.3 with: - name: broken-wheel - path: dist/* - retention-days: 7 + aws_key_id: ${{ secrets.BOT_MINIO_ACCESS_KEY }} + aws_secret_access_key: ${{ secrets.BOT_MINIO_SECRET_KEY }} + aws_bucket: built-wheels + source_dir: dist + destination_dir: /${{ inputs.build_id }} + endpoint: http://botmaster.tgr:9000 - name: Cleanup Git Cache Configs shell: pwsh @@ -365,22 +301,16 @@ jobs: exit 0 build_m1: - name: Build (Apple M1) - needs: check_files - timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 60 || 120 }} + name: Build (M1) + timeout-minutes: 30 strategy: matrix: - include: - - os: macos-latest - python: 3.8 + python: ${{ fromJSON(inputs.python) }} 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] env: - CXX: clang++ - PY: ${{ matrix.python }} TAICHI_CMAKE_ARGS: >- -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CUDA:BOOL=OFF @@ -388,9 +318,7 @@ jobs: -DTI_BUILD_TESTS:BOOL=ON -DTI_WITH_C_API=ON -DTI_WITH_STATIC_C_API=ON - TI_WANTED_ARCHS: 'cpu,metal,vulkan' PLATFORM: 'm1' - TI_RUN_RELEASE_TESTS: '1' steps: - name: Workaround checkout Needed single revision issue run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true @@ -401,53 +329,24 @@ jobs: submodules: 'recursive' - name: Build - if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | - . .github/workflows/scripts/common-utils.sh - prepare-build-cache brew install molten-vk - brew install llvm@15 - .github/workflows/scripts/build.py - env: - CXX: clang++ - - - name: Check C-API Export Symbols - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - - .github/workflows/scripts/aot-demo.sh check-c-api-export-symbols - - - name: Test - id: test - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - .github/workflows/scripts/unix_test.sh - - - name: Save wheel if test failed - if: failure() && steps.test.conclusion == 'failure' - uses: actions/upload-artifact@v3 - with: - name: broken-wheel - path: dist/* - retention-days: 7 + ./build.py ${NIGHTLY:+--nightly} --python=${{ matrix.python }} - - name: Save Bad Captures - if: failure() && steps.test.conclusion == 'failure' - uses: actions/upload-artifact@v3 + - name: Upload Built Wheel + uses: shallwefootball/s3-upload-action@1.3.3 with: - name: bad-captures - path: taichi-release-tests/bad-compare/* - retention-days: 7 - + aws_key_id: ${{ secrets.BOT_MINIO_ACCESS_KEY }} + aws_secret_access_key: ${{ secrets.BOT_MINIO_SECRET_KEY }} + aws_bucket: built-wheels + source_dir: dist + destination_dir: /${{ inputs.build_id }} + endpoint: http://botmaster.tgr:9000 build_ios_capi: name: Build iOS C-API Static Library - needs: check_files - timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 60 || 120 }} + timeout-minutes: 30 runs-on: [self-hosted, m1] - env: - PY: "3.10" steps: - name: Workaround checkout Needed single revision issue run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true @@ -458,337 +357,335 @@ jobs: submodules: 'recursive' - name: Build - if: ${{ needs.check_files.outputs.run_job != 'false' }} run: .github/workflows/scripts/build.py ios - name: Save Compiled Static Library - if: ${{ needs.check_files.outputs.run_job != 'false' }} uses: actions/upload-artifact@v3 with: name: libtaichi_c_api.iOS.a path: 'dist/C-API-iOS/*.a' retention-days: 7 - aot_build_android_apps: - name: AOT Build Android Apps - # Skip this job when testing the offline cache - if: ${{ github.event.schedule != '0 18 * * *' }} - needs: check_files - runs-on: [self-hosted, Linux, cn] - timeout-minutes: 60 - permissions: - packages: read - contents: read - env: - REDIS_HOST: 172.16.5.1 - PY: '3.9' - steps: - - name: Workaround checkout Needed single revision issue - run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true - - - uses: actions/checkout@v3 - name: Checkout taichi - with: - fetch-depth: '0' - submodules: "recursive" - - - name: Prepare Environment - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: >- - . .github/workflows/scripts/common-utils.sh; - prepare-build-cache; - - TAICHI_WHEEL_DIR=$(mktemp -d); - echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV; - chmod 0777 $TAICHI_WHEEL_DIR; - - echo CI_DOCKER_RUN_EXTRA_ARGS=" - -e REDIS_HOST - -v $(pwd):/home/dev/taichi - -v $TAICHI_WHEEL_DIR:/taichi-wheel - " >> $GITHUB_ENV; - - - name: Build Host Taichi - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - ci-docker-run --name taichi-build-host \ - -v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \ - registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py - env: - TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_C_API=OFF - - - name: Build For Android - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - git clean -fxd - ci-docker-run --name taichi-build-android \ - registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py android - env: - TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_LLVM:BOOL=OFF - -DTI_WITH_C_API:BOOL=ON - - - name: Test For Android AOT - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - ci-docker-run-gpu --name taichi-test-android \ - registry.botmaster.tgr/taichi-test-android:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-smoke-test-android-aot-demo - - env: - TI_DEVICE_MEMORY_GB: '0.1' - - aot_build_android_headless_demos: - name: AOT Build Android Headless Demos - # Skip this job when testing the offline cache - if: ${{ github.event.schedule != '0 18 * * *' }} - needs: check_files - runs-on: [self-hosted, Linux, cn] - timeout-minutes: 60 - permissions: - packages: read - contents: read - env: - REDIS_HOST: 172.16.5.1 - PY: '3.9' - steps: - - name: Workaround checkout Needed single revision issue - run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true - - - uses: actions/checkout@v3 - name: Checkout taichi - with: - fetch-depth: '0' - submodules: "recursive" - - - name: Prepare Environment - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: >- - . .github/workflows/scripts/common-utils.sh; - prepare-build-cache; - - TAICHI_WHEEL_DIR=$(mktemp -d); - echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV; - chmod 0777 $TAICHI_WHEEL_DIR; - - echo CI_DOCKER_RUN_EXTRA_ARGS=" - -e REDIS_HOST - -v $(pwd):/home/dev/taichi - -v $TAICHI_WHEEL_DIR:/taichi-wheel - " >> $GITHUB_ENV; - - - name: Build Host Taichi - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - ci-docker-run --name taichi-build-host \ - -v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \ - registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py - env: - TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_C_API=OFF - - - name: Build For Android - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - git clean -fxd - ci-docker-run --name taichi-build-android \ - registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py android - env: - TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_LLVM:BOOL=OFF - -DTI_WITH_C_API=ON - - - name: Build & Run C-API Headless Demos (Android) - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - ci-docker-run-gpu --name taichi-test-capi-headless-demo \ - registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-test-headless-demo - env: - TI_DEVICE_MEMORY_GB: '0.1' - - aot_build_android_unity_examples: - name: AOT Build Android Unity Examples - # Skip this job when testing the offline cache - if: ${{ github.event.schedule != '0 18 * * *' }} - needs: check_files - runs-on: [self-hosted, Linux, cn] - timeout-minutes: 60 - permissions: - packages: read - contents: read - env: - REDIS_HOST: 172.16.5.1 - PY: '3.9' - steps: - - name: Workaround checkout Needed single revision issue - run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true - - - uses: actions/checkout@v3 - name: Checkout taichi - with: - fetch-depth: '0' - submodules: "recursive" - - - name: Prepare Environment - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: >- - . .github/workflows/scripts/common-utils.sh; - prepare-build-cache; - - TAICHI_WHEEL_DIR=$(mktemp -d); - echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV; - chmod 0777 $TAICHI_WHEEL_DIR; - - echo CI_DOCKER_RUN_EXTRA_ARGS=" - -e REDIS_HOST - -v $(pwd):/home/dev/taichi - -v $TAICHI_WHEEL_DIR:/taichi-wheel - " >> $GITHUB_ENV; - - - name: Build Host Taichi - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - ci-docker-run --name taichi-build-host \ - -v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \ - registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py - env: - TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_C_API=OFF - - - name: Build For Android - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - git clean -fxd - ci-docker-run --name taichi-build-android \ - registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py android - env: - TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_LLVM:BOOL=OFF - -DTI_WITH_C_API=ON - - - name: Prepare Unity Build Environment - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - ci-docker-run --name taichi-prepare-unity-build-env \ - registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/aot-demo.sh prepare-unity-build-env - - - name: Build Taichi-UnityExample - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - ci-docker-run --name taichi-build-unity-demo \ - registry.taichigraphics.com/unityci-editor:ubuntu-2020.3.14f1-android-1-with-secret-sauce \ - /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-unity-demo - - - name: Run Taichi-UnityExample (C-API) - if: ${{ needs.check_files.outputs.run_job != 'false' }} - run: | - . .github/workflows/scripts/common-utils.sh - ci-docker-run --name taichi-run-unity-demo \ - registry.botmaster.tgr/taichi-test-android:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/aot-demo.sh smoke-test-unity-demo - - aot_build_gpu_linux: - name: AOT Build (GPU) - needs: check_files - timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 120 }} - # TODO(proton): do we need to test both drivers? - strategy: - matrix: - tags: - - [self-hosted, cuda, vulkan, cn, driver470] - - [self-hosted, cuda, vulkan, cn, driver510] - env: - PY: '3.8' - PROJECT_NAME: taichi - TAICHI_CMAKE_ARGS: >- - -DTI_WITH_OPENGL:BOOL=ON - -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_BACKTRACE:BOOL=ON - -DTI_BUILD_TESTS:BOOL=ON - -DTI_WITH_C_API=ON - - runs-on: ${{ matrix.tags }} - steps: - - name: Workaround checkout Needed single revision issue - run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true - - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - fetch-depth: '0' - - - name: Prepare Environment - run: | - . .github/workflows/scripts/common-utils.sh - prepare-build-cache - echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV - - - name: Build & Install - run: | - [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 - . .github/workflows/scripts/common-utils.sh - - ci-docker-run-gpu --name taichi-build \ - registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/build.py - - - name: Check C-API Export Symbols - run: | - [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 - . .github/workflows/scripts/common-utils.sh - - ci-docker-run-gpu --name taichi-test-check-c-api-export-symbols \ - registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/aot-demo.sh check-c-api-export-symbols - - - name: Build & Run C-API Headless Demos (Desktop) - run: | - [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 - . .github/workflows/scripts/common-utils.sh - chown -R 1000:1000 . - ci-docker-run-gpu --name taichi-test-capi-headless-demo-desktop \ - registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-test-headless-demo-desktop - env: - TI_DEVICE_MEMORY_GB: '0.1' - - - name: Compatibility Test - id: test - run: | - [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 - . .github/workflows/scripts/common-utils.sh - - ci-docker-run-gpu --name taichi-test \ - registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ - /home/dev/taichi/.github/workflows/scripts/unix_aot_compat_test.sh + # aot_build_android_apps: + # name: AOT Build Android Apps + # # Skip this job when testing the offline cache + # if: ${{ github.event.schedule != '0 18 * * *' }} + # needs: check_files + # runs-on: [self-hosted, Linux, cn] + # timeout-minutes: 60 + # permissions: + # packages: read + # contents: read + # env: + # REDIS_HOST: 172.16.5.1 + # PY: '3.9' + # steps: + # - name: Workaround checkout Needed single revision issue + # run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true + + # - uses: actions/checkout@v3 + # name: Checkout taichi + # with: + # fetch-depth: '0' + # submodules: "recursive" + + # - name: Prepare Environment + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: >- + # . .github/workflows/scripts/common-utils.sh; + # prepare-build-cache; + + # TAICHI_WHEEL_DIR=$(mktemp -d); + # echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV; + # chmod 0777 $TAICHI_WHEEL_DIR; + + # echo CI_DOCKER_RUN_EXTRA_ARGS=" + # -e REDIS_HOST + # -v $(pwd):/home/dev/taichi + # -v $TAICHI_WHEEL_DIR:/taichi-wheel + # " >> $GITHUB_ENV; + + # - name: Build Host Taichi + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # ci-docker-run --name taichi-build-host \ + # -v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \ + # registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/build.py + # env: + # TAICHI_CMAKE_ARGS: >- + # -DTI_WITH_OPENGL:BOOL=ON + # -DTI_WITH_VULKAN:BOOL=ON + # -DTI_WITH_C_API=OFF + + # - name: Build For Android + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # git clean -fxd + # ci-docker-run --name taichi-build-android \ + # registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/build.py android + # env: + # TAICHI_CMAKE_ARGS: >- + # -DTI_WITH_OPENGL:BOOL=ON + # -DTI_WITH_VULKAN:BOOL=ON + # -DTI_WITH_LLVM:BOOL=OFF + # -DTI_WITH_C_API:BOOL=ON + + # - name: Test For Android AOT + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # ci-docker-run-gpu --name taichi-test-android \ + # registry.botmaster.tgr/taichi-test-android:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-smoke-test-android-aot-demo + + # env: + # TI_DEVICE_MEMORY_GB: '0.1' + + # aot_build_android_headless_demos: + # name: AOT Build Android Headless Demos + # # Skip this job when testing the offline cache + # if: ${{ github.event.schedule != '0 18 * * *' }} + # needs: check_files + # runs-on: [self-hosted, Linux, cn] + # timeout-minutes: 60 + # permissions: + # packages: read + # contents: read + # env: + # REDIS_HOST: 172.16.5.1 + # PY: '3.9' + # steps: + # - name: Workaround checkout Needed single revision issue + # run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true + + # - uses: actions/checkout@v3 + # name: Checkout taichi + # with: + # fetch-depth: '0' + # submodules: "recursive" + + # - name: Prepare Environment + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: >- + # . .github/workflows/scripts/common-utils.sh; + # prepare-build-cache; + + # TAICHI_WHEEL_DIR=$(mktemp -d); + # echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV; + # chmod 0777 $TAICHI_WHEEL_DIR; + + # echo CI_DOCKER_RUN_EXTRA_ARGS=" + # -e REDIS_HOST + # -v $(pwd):/home/dev/taichi + # -v $TAICHI_WHEEL_DIR:/taichi-wheel + # " >> $GITHUB_ENV; + + # - name: Build Host Taichi + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # ci-docker-run --name taichi-build-host \ + # -v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \ + # registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/build.py + # env: + # TAICHI_CMAKE_ARGS: >- + # -DTI_WITH_OPENGL:BOOL=ON + # -DTI_WITH_VULKAN:BOOL=ON + # -DTI_WITH_C_API=OFF + + # - name: Build For Android + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # git clean -fxd + # ci-docker-run --name taichi-build-android \ + # registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/build.py android + # env: + # TAICHI_CMAKE_ARGS: >- + # -DTI_WITH_OPENGL:BOOL=ON + # -DTI_WITH_VULKAN:BOOL=ON + # -DTI_WITH_LLVM:BOOL=OFF + # -DTI_WITH_C_API=ON + + # - name: Build & Run C-API Headless Demos (Android) + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # ci-docker-run-gpu --name taichi-test-capi-headless-demo \ + # registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-test-headless-demo + # env: + # TI_DEVICE_MEMORY_GB: '0.1' + + # aot_build_android_unity_examples: + # name: AOT Build Android Unity Examples + # # Skip this job when testing the offline cache + # if: ${{ github.event.schedule != '0 18 * * *' }} + # needs: check_files + # runs-on: [self-hosted, Linux, cn] + # timeout-minutes: 60 + # permissions: + # packages: read + # contents: read + # env: + # REDIS_HOST: 172.16.5.1 + # PY: '3.9' + # steps: + # - name: Workaround checkout Needed single revision issue + # run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true + + # - uses: actions/checkout@v3 + # name: Checkout taichi + # with: + # fetch-depth: '0' + # submodules: "recursive" + + # - name: Prepare Environment + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: >- + # . .github/workflows/scripts/common-utils.sh; + # prepare-build-cache; + + # TAICHI_WHEEL_DIR=$(mktemp -d); + # echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV; + # chmod 0777 $TAICHI_WHEEL_DIR; + + # echo CI_DOCKER_RUN_EXTRA_ARGS=" + # -e REDIS_HOST + # -v $(pwd):/home/dev/taichi + # -v $TAICHI_WHEEL_DIR:/taichi-wheel + # " >> $GITHUB_ENV; + + # - name: Build Host Taichi + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # ci-docker-run --name taichi-build-host \ + # -v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \ + # registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/build.py + # env: + # TAICHI_CMAKE_ARGS: >- + # -DTI_WITH_OPENGL:BOOL=ON + # -DTI_WITH_VULKAN:BOOL=ON + # -DTI_WITH_C_API=OFF + + # - name: Build For Android + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # git clean -fxd + # ci-docker-run --name taichi-build-android \ + # registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/build.py android + # env: + # TAICHI_CMAKE_ARGS: >- + # -DTI_WITH_OPENGL:BOOL=ON + # -DTI_WITH_VULKAN:BOOL=ON + # -DTI_WITH_LLVM:BOOL=OFF + # -DTI_WITH_C_API=ON + + # - name: Prepare Unity Build Environment + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # ci-docker-run --name taichi-prepare-unity-build-env \ + # registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/aot-demo.sh prepare-unity-build-env + + # - name: Build Taichi-UnityExample + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # ci-docker-run --name taichi-build-unity-demo \ + # registry.taichigraphics.com/unityci-editor:ubuntu-2020.3.14f1-android-1-with-secret-sauce \ + # /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-unity-demo + + # - name: Run Taichi-UnityExample (C-API) + # if: ${{ needs.check_files.outputs.run_job != 'false' }} + # run: | + # . .github/workflows/scripts/common-utils.sh + # ci-docker-run --name taichi-run-unity-demo \ + # registry.botmaster.tgr/taichi-test-android:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/aot-demo.sh smoke-test-unity-demo + + # aot_build_gpu_linux: + # name: AOT Build (GPU) + # needs: check_files + # timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 120 }} + # # TODO(proton): do we need to test both drivers? + # strategy: + # matrix: + # tags: + # - [self-hosted, cuda, vulkan, cn, driver470] + # - [self-hosted, cuda, vulkan, cn, driver510] + # env: + # PY: '3.8' + # PROJECT_NAME: taichi + # TAICHI_CMAKE_ARGS: >- + # -DTI_WITH_OPENGL:BOOL=ON + # -DTI_WITH_VULKAN:BOOL=ON + # -DTI_WITH_BACKTRACE:BOOL=ON + # -DTI_BUILD_TESTS:BOOL=ON + # -DTI_WITH_C_API=ON + + # runs-on: ${{ matrix.tags }} + # steps: + # - name: Workaround checkout Needed single revision issue + # run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true + + # - uses: actions/checkout@v3 + # with: + # submodules: 'recursive' + # fetch-depth: '0' + + # - name: Prepare Environment + # run: | + # . .github/workflows/scripts/common-utils.sh + # prepare-build-cache + # echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV + + # - name: Build & Install + # run: | + # [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 + # . .github/workflows/scripts/common-utils.sh + + # ci-docker-run-gpu --name taichi-build \ + # registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/build.py + + # - name: Check C-API Export Symbols + # run: | + # [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 + # . .github/workflows/scripts/common-utils.sh + + # ci-docker-run-gpu --name taichi-test-check-c-api-export-symbols \ + # registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/aot-demo.sh check-c-api-export-symbols + + # - name: Build & Run C-API Headless Demos (Desktop) + # run: | + # [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 + # . .github/workflows/scripts/common-utils.sh + # chown -R 1000:1000 . + # ci-docker-run-gpu --name taichi-test-capi-headless-demo-desktop \ + # registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-test-headless-demo-desktop + # env: + # TI_DEVICE_MEMORY_GB: '0.1' + + # - name: Compatibility Test + # id: test + # run: | + # [[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0 + # . .github/workflows/scripts/common-utils.sh + + # ci-docker-run-gpu --name taichi-test \ + # registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \ + # /home/dev/taichi/.github/workflows/scripts/unix_aot_compat_test.sh diff --git a/.github/workflows/initiator.yaml b/.github/workflows/initiator.yaml index d76e1de2a..2b2c558ba 100644 --- a/.github/workflows/initiator.yaml +++ b/.github/workflows/initiator.yaml @@ -1,10 +1,10 @@ name: Taichi Workflow Initiator on: - pull_request: - types: [opened, synchronize, reopened] + # pull_request: + # types: [opened, synchronize, reopened] push: branches: - - master + # - master - rc-* schedule: - cron: '0 18 * * *' # For testing the offline cache, GMT 18 == GMT+8 02 diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index 05d3be935..af16fb802 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -1,8 +1,8 @@ name: Performance Monitoring on: - push: - branches: - - master + # push: + # branches: + # - master workflow_dispatch: {} repository_dispatch: types: [benchmark-command] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e65e0609b..4e3452689 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -303,7 +303,6 @@ jobs: python-version: ${{ matrix.python }} - name: Build - if: ${{ needs.check_files.outputs.run_job != 'false' }} shell: cmd run: | python .\.github\workflows\scripts\build.py diff --git a/.github/workflows/scripts/ti_build/entry.py b/.github/workflows/scripts/ti_build/entry.py index 1060b6ef3..d8fa1dd85 100644 --- a/.github/workflows/scripts/ti_build/entry.py +++ b/.github/workflows/scripts/ti_build/entry.py @@ -31,18 +31,21 @@ def build_wheel(python: Command, pip: Command) -> None: """ Build the Taichi wheel """ + git.fetch("origin", "master", "--tags") proj_tags = [] extra = [] cmake_args.writeback() wheel_tag = cmake_args.render_wheel_tag() + if misc.options.tag_local: + wheel_tag = misc.options.tag_local if misc.options.nightly: os.environ["PROJECT_NAME"] = "taichi-nightly" now = datetime.datetime.now().strftime("%Y%m%d") proj_tags.extend(["egg_info", f"--tag-build=.post{now}+{wheel_tag}"]) - elif misc.options.tag_config: + elif misc.options.tag_config or misc.options.tag_local: proj_tags.extend(["egg_info", f"--tag-build=+{wheel_tag}"]) if platform.system() == "Linux": @@ -63,7 +66,7 @@ def install_build_wheel_deps(python: Command, pip: Command) -> None: pip.install("-r", "requirements_dev.txt") -def setup_basic_build_env(force_vulkan=False): +def setup_basic_build_env(): u = platform.uname() if (u.system, u.machine) == ("Windows", "AMD64"): # Use MSVC on Windows @@ -74,8 +77,7 @@ def setup_basic_build_env(force_vulkan=False): setup_clang() setup_llvm() - if force_vulkan or cmake_args.get_effective("TI_WITH_VULKAN"): - setup_vulkan() + setup_vulkan() sccache = setup_sccache() @@ -99,7 +101,7 @@ def action_wheel(): def action_android(): - sccache, python, pip = setup_basic_build_env(force_vulkan=True) + sccache, python, pip = setup_basic_build_env() setup_android_ndk() handle_alternate_actions() build_android(python, pip) @@ -157,6 +159,9 @@ def parse_args(): help = "Tag built wheel with TI_WITH_xxx config." parser.add_argument("--tag-config", action="store_true", default=False, help=help) + help = "Set a local version. Overrides --tag-config." + parser.add_argument("--tag-local", type=str, default=None, help=help) + help = "Build nightly wheel." parser.add_argument("--nightly", action="store_true", default=False, help=help) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ab494b0f5..8fa1ebf22 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,11 +1,11 @@ name: Build and Test on: - pull_request: - types: [opened, synchronize, reopened] - push: - branches: - - master - - rc-* + # pull_request: + # types: [opened, synchronize, reopened] + # push: + # branches: + # - master + # - rc-* schedule: - cron: '0 18 * * *' # For testing the offline cache, GMT 18 == GMT+8 02