From d0c451f617fefb477cee35ccbd3d155a2ea1c2b9 Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Wed, 27 Oct 2021 19:46:00 +0100 Subject: [PATCH 1/9] test --- .github/workflows/release.yml | 18 +++++++++--------- .github/workflows/scripts/macos_vk.sh | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/scripts/macos_vk.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33a82fea0..76f747d1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,8 @@ name: Publishing Release on: - release: - # https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#release - types: [published] - # When triggered by schedule and workflow_dispatch, github.event.action is an empty string. - # We use this to distinguish which taichi to release. - schedule: - - cron: "0 0 * * *" - workflow_dispatch: + push: + branches: + - master jobs: # This job set environment matrix with respect to production release and nightly release. @@ -126,6 +121,11 @@ jobs: env: CI_PLATFORM: macos-latest + - name: Download And Install Python + run: .github/workflows/scripts/macos_vk.sh + env: + CI_PLATFORM: macos-latest + - name: Create Python Wheel run: | TAICHI_REPO_DIR=`pwd` @@ -141,7 +141,7 @@ jobs: if [ $NUM_WHL -ne 1 ]; then echo 'ERROR: created more than 1 whl.' && exit 1; fi pip install dist/*.whl env: - CI_SETUP_CMAKE_ARGS: -DTI_WITH_VULKAN:BOOL=OFF -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=OFF -DTI_BUILD_TESTS:BOOL=${{ matrix.with_cpp_tests }} + CI_SETUP_CMAKE_ARGS: -DTI_WITH_VULKAN:BOOL=ON -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CC:BOOL=OFF -DTI_BUILD_TESTS:BOOL=${{ matrix.with_cpp_tests }} PROJECT_NAME: ${{ matrix.name }} - name: Archive Wheel Artifacts diff --git a/.github/workflows/scripts/macos_vk.sh b/.github/workflows/scripts/macos_vk.sh new file mode 100644 index 000000000..bd0c86799 --- /dev/null +++ b/.github/workflows/scripts/macos_vk.sh @@ -0,0 +1,17 @@ +curl https://sdk.lunarg.com/sdk/download/1.2.189.0/mac/vulkansdk-macos-1.2.189.0.dmg -o vk.dmg +sudo hdiutil attach vk.dmg +cp -r /Volumes/vulkansdk-macos-1.2.189.0/InstallVulkan.app . +sudo ./InstallVulkan.app/Contents/MacOS/InstallVulkan --root ~/VulkanSDK/1.2.189.0 --accept-licenses --default-answer --confirm-command install + +printf '%s' ' +VULKAN_SDK=~/VulkanSDK/1.2.189.0/macOS +export VULKAN_SDK +PATH="$PATH:$VULKAN_SDK/bin" +export PATH +DYLD_LIBRARY_PATH="$VULKAN_SDK/lib:${DYLD_LIBRARY_PATH:-}" +export DYLD_LIBRARY_PATH +VK_LAYER_PATH="$VULKAN_SDK/share/vulkan/explicit_layer.d" +export VK_LAYER_PATH +VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json" +export VK_ICD_FILENAMES +' >> ~/.zshrc From fdb8b08a7019a8373d3f24524632c3cb87266972 Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Wed, 27 Oct 2021 19:48:43 +0100 Subject: [PATCH 2/9] test --- .github/workflows/release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76f747d1e..986b53767 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,7 @@ name: Publishing Release on: - push: - branches: - - master + pull_request: + types: [opened, synchronize, reopened] jobs: # This job set environment matrix with respect to production release and nightly release. From 4905d2ca685bb17e799d62092ce2c9a9bf094d70 Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Wed, 27 Oct 2021 19:56:10 +0100 Subject: [PATCH 3/9] test --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 986b53767..76f747d1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,8 @@ name: Publishing Release on: - pull_request: - types: [opened, synchronize, reopened] + push: + branches: + - master jobs: # This job set environment matrix with respect to production release and nightly release. From 58f6c7dfa1dc4cc1b30f56366ac6159723ce84cf Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Wed, 27 Oct 2021 20:00:49 +0100 Subject: [PATCH 4/9] test --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76f747d1e..c4e6a178f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,8 @@ on: push: branches: - master + pull_request: + types: [opened, synchronize, reopened] jobs: # This job set environment matrix with respect to production release and nightly release. From 60c4da7c12503a0c942164e78ddc9402a2688c57 Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Wed, 27 Oct 2021 20:02:59 +0100 Subject: [PATCH 5/9] fix action name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4e6a178f..438cb3202 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -123,7 +123,7 @@ jobs: env: CI_PLATFORM: macos-latest - - name: Download And Install Python + - name: Download And Install Vulkan run: .github/workflows/scripts/macos_vk.sh env: CI_PLATFORM: macos-latest From b159310702b6cd89e4466fa31e091f6242b6e02a Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Wed, 27 Oct 2021 20:55:13 +0100 Subject: [PATCH 6/9] fix --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 438cb3202..d636469b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,7 +124,7 @@ jobs: CI_PLATFORM: macos-latest - name: Download And Install Vulkan - run: .github/workflows/scripts/macos_vk.sh + run: sudo bash .github/workflows/scripts/macos_vk.sh env: CI_PLATFORM: macos-latest From b29090f20f81e44568ac30389c10895770089635 Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Wed, 27 Oct 2021 23:25:51 +0100 Subject: [PATCH 7/9] diable vulkan tests --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d636469b6..3620ab4ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -157,7 +157,7 @@ jobs: run: | python examples/algorithm/laplace.py ti diagnose - ti test -vr2 -t2 + ti test -vr2 -t2 -a cpu,metal - name: Upload PyPI env: From 4ac00bbbbb2f1fdfbe3398d4432e89bac2058a2a Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Thu, 28 Oct 2021 00:13:15 +0100 Subject: [PATCH 8/9] fix --- .github/workflows/release.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3620ab4ab..7e71fbef0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,13 @@ name: Publishing Release on: - push: - branches: - - master - pull_request: - types: [opened, synchronize, reopened] + release: + # https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#release + types: [published] + # When triggered by schedule and workflow_dispatch, github.event.action is an empty string. + # We use this to distinguish which taichi to release. + schedule: + - cron: "0 0 * * *" + workflow_dispatch: jobs: # This job set environment matrix with respect to production release and nightly release. From 013df715d54f104a3fadf673b5e1ca6b74809d09 Mon Sep 17 00:00:00 2001 From: Dunfan Lu Date: Thu, 28 Oct 2021 16:55:32 +0100 Subject: [PATCH 9/9] fix --- .github/workflows/release.yml | 13 +++++-------- .github/workflows/scripts/macos_vk.sh | 17 ----------------- 2 files changed, 5 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/scripts/macos_vk.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e71fbef0..88a9b6f85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,8 @@ on: schedule: - cron: "0 0 * * *" workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened] jobs: # This job set environment matrix with respect to production release and nightly release. @@ -126,11 +128,6 @@ jobs: env: CI_PLATFORM: macos-latest - - name: Download And Install Vulkan - run: sudo bash .github/workflows/scripts/macos_vk.sh - env: - CI_PLATFORM: macos-latest - - name: Create Python Wheel run: | TAICHI_REPO_DIR=`pwd` @@ -160,7 +157,7 @@ jobs: run: | python examples/algorithm/laplace.py ti diagnose - ti test -vr2 -t2 -a cpu,metal + ti test -vr2 -t2 -a cpu,meta - name: Upload PyPI env: @@ -207,7 +204,7 @@ jobs: if [ $NUM_WHL -ne 1 ]; then echo 'ERROR: created more than 1 whl.' && exit 1; fi python3 -m pip install dist/*.whl 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_WITH_TESTS:BOOL=ON + CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CUDA:BOOL=OFF -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=ON -DTI_WITH_TESTS:BOOL=ON PROJECT_NAME: ${{ matrix.name }} PYTHON: ${{ matrix.python }} @@ -264,7 +261,7 @@ jobs: if [ $NUM_WHL -ne 1 ]; then echo 'ERROR: created more than 1 whl.' && exit 1; fi python3 -m pip install dist/*.whl 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_WITH_TESTS:BOOL=ON + CI_SETUP_CMAKE_ARGS: -DTI_WITH_OPENGL:BOOL=OFF -DTI_WITH_CUDA:BOOL=OFF -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=ON -DTI_WITH_TESTS:BOOL=ON PROJECT_NAME: ${{ matrix.name }} PYTHON: ${{ matrix.python }} diff --git a/.github/workflows/scripts/macos_vk.sh b/.github/workflows/scripts/macos_vk.sh deleted file mode 100644 index bd0c86799..000000000 --- a/.github/workflows/scripts/macos_vk.sh +++ /dev/null @@ -1,17 +0,0 @@ -curl https://sdk.lunarg.com/sdk/download/1.2.189.0/mac/vulkansdk-macos-1.2.189.0.dmg -o vk.dmg -sudo hdiutil attach vk.dmg -cp -r /Volumes/vulkansdk-macos-1.2.189.0/InstallVulkan.app . -sudo ./InstallVulkan.app/Contents/MacOS/InstallVulkan --root ~/VulkanSDK/1.2.189.0 --accept-licenses --default-answer --confirm-command install - -printf '%s' ' -VULKAN_SDK=~/VulkanSDK/1.2.189.0/macOS -export VULKAN_SDK -PATH="$PATH:$VULKAN_SDK/bin" -export PATH -DYLD_LIBRARY_PATH="$VULKAN_SDK/lib:${DYLD_LIBRARY_PATH:-}" -export DYLD_LIBRARY_PATH -VK_LAYER_PATH="$VULKAN_SDK/share/vulkan/explicit_layer.d" -export VK_LAYER_PATH -VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json" -export VK_ICD_FILENAMES -' >> ~/.zshrc