From 54a55423993a6066577446cf9b8e0d325a6a414c Mon Sep 17 00:00:00 2001 From: w-gc <25614556+w-gc@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:35:44 +0800 Subject: [PATCH 1/5] (chore) refine circle ci script --- .circleci/asan-config.yml | 4 +++- .circleci/continue-config.yml | 13 +++++++++++-- .circleci/release-config.yml | 3 ++- MODULE.bazel | 2 +- src/MODULE.bazel | 2 +- src/libspu/version.h | 2 +- version.bzl | 2 +- 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.circleci/asan-config.yml b/.circleci/asan-config.yml index fb1237402..6a413b5d4 100644 --- a/.circleci/asan-config.yml +++ b/.circleci/asan-config.yml @@ -51,7 +51,9 @@ jobs: command: | set +e declare -i test_status - bazel test //libspu/... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} + + cd src && bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} + cd - && bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee -a test_result.log; test_status=${PIPESTATUS[0]} sh ../devtools/rename-junit-xml.sh find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz diff --git a/.circleci/continue-config.yml b/.circleci/continue-config.yml index 1f378c420..41cb770b1 100644 --- a/.circleci/continue-config.yml +++ b/.circleci/continue-config.yml @@ -59,13 +59,22 @@ commands: ../devtools/bazel_cache_setup.py --in_file=../gcs.data --out_file=../gcs.json --min_download - run: name: "build" - command: bazel --version && python3 --version && bazel run //:requirements-dev.update && bazel build <> -c opt --ui_event_filters=-info,-debug,-warning + command: | + bazel --version && python3 --version && bazel run //:requirements-dev.update + + # build module spulib + cd src && bazel build <> -c opt --ui_event_filters=-info,-debug,-warning + + # build module spu + cd - && bazel build //:spu_wheel <> -c opt --ui_event_filters=-info,-debug,-warning - run: name: "test" command: | set +e declare -i test_status - bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors| tee test_result.log; test_status=${PIPESTATUS[0]} + + cd src && bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} + cd - && bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee -a test_result.log; test_status=${PIPESTATUS[0]} sh ../devtools/rename-junit-xml.sh find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz diff --git a/.circleci/release-config.yml b/.circleci/release-config.yml index 43094034c..67f3bee3b 100644 --- a/.circleci/release-config.yml +++ b/.circleci/release-config.yml @@ -53,7 +53,8 @@ commands: conda activate build if [ ! -e "/usr/bin/python3" ]; then ln -s `which python3` /usr/bin/python3; fi - bazel build //:spu_wheel -c opt --@rules_python//python/config_settings:python_version=<< parameters.python_ver >> + cd src && bazel build //... -c opt --ui_event_filters=-info,-debug,-warning + cd - && bazel build //:spu_wheel -c opt --@rules_python//python/config_settings:python_version=<< parameters.python_ver >> python3 -m pip install twine ls bazel-bin/spu*.whl diff --git a/MODULE.bazel b/MODULE.bazel index d359df660..2a8406fdb 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -21,7 +21,7 @@ module( name = "spu", - version = "0.9.4.dev20250108", + version = "0.9.4.dev20250109", compatibility_level = 1, ) diff --git a/src/MODULE.bazel b/src/MODULE.bazel index c42080223..5b4919c67 100644 --- a/src/MODULE.bazel +++ b/src/MODULE.bazel @@ -21,7 +21,7 @@ module( name = "spulib", - version = "0.9.4.dev20250108", + version = "0.9.4.dev20250109", compatibility_level = 1, ) diff --git a/src/libspu/version.h b/src/libspu/version.h index f34187982..3b51ecac3 100644 --- a/src/libspu/version.h +++ b/src/libspu/version.h @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#define SPU_VERSION "0.9.4.dev20250108" +#define SPU_VERSION "0.9.4.dev20250109" #include diff --git a/version.bzl b/version.bzl index 083b947c5..74d916a60 100644 --- a/version.bzl +++ b/version.bzl @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -SPU_VERSION = "0.9.4.dev20250108" +SPU_VERSION = "0.9.4.dev20250109" From 786a605a35492cf5af35866dfffc56f74962554a Mon Sep 17 00:00:00 2001 From: w-gc <25614556+w-gc@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:33:16 +0800 Subject: [PATCH 2/5] fix --- .circleci/asan-config.yml | 15 +++++++++++++-- .circleci/continue-config.yml | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.circleci/asan-config.yml b/.circleci/asan-config.yml index 6a413b5d4..b67c889d7 100644 --- a/.circleci/asan-config.yml +++ b/.circleci/asan-config.yml @@ -47,13 +47,24 @@ jobs: name: Checkout devtools command: git clone https://github.com/secretflow/devtools.git ../devtools - run: - name: "test" + name: "test-libspu" command: | set +e declare -i test_status cd src && bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} - cd - && bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee -a test_result.log; test_status=${PIPESTATUS[0]} + + sh ../devtools/rename-junit-xml.sh + find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz + + exit ${test_status} + - run: + name: "test-spu" + command: | + set +e + declare -i test_status + + bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} sh ../devtools/rename-junit-xml.sh find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz diff --git a/.circleci/continue-config.yml b/.circleci/continue-config.yml index 41cb770b1..489b71f88 100644 --- a/.circleci/continue-config.yml +++ b/.circleci/continue-config.yml @@ -66,15 +66,26 @@ commands: cd src && bazel build <> -c opt --ui_event_filters=-info,-debug,-warning # build module spu - cd - && bazel build //:spu_wheel <> -c opt --ui_event_filters=-info,-debug,-warning + cd - && bazel build <> -c opt --ui_event_filters=-info,-debug,-warning - run: - name: "test" + name: "test-libspu" command: | set +e declare -i test_status cd src && bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} - cd - && bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee -a test_result.log; test_status=${PIPESTATUS[0]} + + sh ../devtools/rename-junit-xml.sh + find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz + + exit ${test_status} + - run: + name: "test-spu" + command: | + set +e + declare -i test_status + + bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} sh ../devtools/rename-junit-xml.sh find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz From c556f5ebbf72389b932ceac6a18db8989adb0109 Mon Sep 17 00:00:00 2001 From: w-gc <25614556+w-gc@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:49:51 +0800 Subject: [PATCH 3/5] fix --- .circleci/asan-config.yml | 3 ++- .circleci/continue-config.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/asan-config.yml b/.circleci/asan-config.yml index b67c889d7..6a9414aa8 100644 --- a/.circleci/asan-config.yml +++ b/.circleci/asan-config.yml @@ -54,7 +54,7 @@ jobs: cd src && bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} - sh ../devtools/rename-junit-xml.sh + sh ../../devtools/rename-junit-xml.sh find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz exit ${test_status} @@ -74,6 +74,7 @@ jobs: path: test-results - store_artifacts: path: test_logs.tar.gz + path: src/test_logs.tar.gz # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: diff --git a/.circleci/continue-config.yml b/.circleci/continue-config.yml index 489b71f88..885503777 100644 --- a/.circleci/continue-config.yml +++ b/.circleci/continue-config.yml @@ -75,7 +75,7 @@ commands: cd src && bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} - sh ../devtools/rename-junit-xml.sh + sh ../../devtools/rename-junit-xml.sh find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz exit ${test_status} @@ -95,6 +95,7 @@ commands: path: test-results - store_artifacts: path: test_logs.tar.gz + path: src/test_logs.tar.gz # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs From 72d3dc99080d18db17e68f2416d744e3ff28d156 Mon Sep 17 00:00:00 2001 From: w-gc <25614556+w-gc@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:15:18 +0800 Subject: [PATCH 4/5] refine --- .circleci/asan-config.yml | 22 +++++++--------------- .circleci/continue-config.yml | 22 +++++++--------------- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/.circleci/asan-config.yml b/.circleci/asan-config.yml index 6a9414aa8..8a024392a 100644 --- a/.circleci/asan-config.yml +++ b/.circleci/asan-config.yml @@ -47,34 +47,26 @@ jobs: name: Checkout devtools command: git clone https://github.com/secretflow/devtools.git ../devtools - run: - name: "test-libspu" - command: | - set +e - declare -i test_status - - cd src && bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} - - sh ../../devtools/rename-junit-xml.sh - find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz - - exit ${test_status} - - run: - name: "test-spu" + name: "test" command: | set +e declare -i test_status + pushd src bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} + sh ../../devtools/rename-junit-xml.sh + popd + bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee -a test_result.log; test_status=${PIPESTATUS[0]} sh ../devtools/rename-junit-xml.sh - find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz + + find bazel-testlogs/ src/bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz exit ${test_status} - store_test_results: path: test-results - store_artifacts: path: test_logs.tar.gz - path: src/test_logs.tar.gz # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: diff --git a/.circleci/continue-config.yml b/.circleci/continue-config.yml index 885503777..07dc42d79 100644 --- a/.circleci/continue-config.yml +++ b/.circleci/continue-config.yml @@ -68,34 +68,26 @@ commands: # build module spu cd - && bazel build <> -c opt --ui_event_filters=-info,-debug,-warning - run: - name: "test-libspu" - command: | - set +e - declare -i test_status - - cd src && bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} - - sh ../../devtools/rename-junit-xml.sh - find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz - - exit ${test_status} - - run: - name: "test-spu" + name: "test" command: | set +e declare -i test_status + pushd src bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]} + sh ../../devtools/rename-junit-xml.sh + popd + bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee -a test_result.log; test_status=${PIPESTATUS[0]} sh ../devtools/rename-junit-xml.sh - find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz + + find bazel-testlogs/ src/bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz exit ${test_status} - store_test_results: path: test-results - store_artifacts: path: test_logs.tar.gz - path: src/test_logs.tar.gz # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs From be04ec17b4a047ae0927b1044993a5878f60445f Mon Sep 17 00:00:00 2001 From: w-gc <25614556+w-gc@users.noreply.github.com> Date: Thu, 9 Jan 2025 21:07:37 +0800 Subject: [PATCH 5/5] refine --- .circleci/asan-config.yml | 4 +++- .circleci/continue-config.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/asan-config.yml b/.circleci/asan-config.yml index 8a024392a..d9bcde066 100644 --- a/.circleci/asan-config.yml +++ b/.circleci/asan-config.yml @@ -60,7 +60,9 @@ jobs: bazel test //... --features=asan --test_timeout=500 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee -a test_result.log; test_status=${PIPESTATUS[0]} sh ../devtools/rename-junit-xml.sh - find bazel-testlogs/ src/bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz + cp -r src/test-results/ test-results/ + cp -r src/test-testlogs/ test-testlogs/ + find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz exit ${test_status} - store_test_results: diff --git a/.circleci/continue-config.yml b/.circleci/continue-config.yml index 07dc42d79..c468537f1 100644 --- a/.circleci/continue-config.yml +++ b/.circleci/continue-config.yml @@ -81,7 +81,9 @@ commands: bazel test <> <> -c opt --ui_event_filters=-info,-debug,-warning --test_output=errors | tee -a test_result.log; test_status=${PIPESTATUS[0]} sh ../devtools/rename-junit-xml.sh - find bazel-testlogs/ src/bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz + cp -r src/test-results/ test-results/ + cp -r src/test-testlogs/ test-testlogs/ + find bazel-testlogs/ -type f -name "test.log" -print0 | xargs -0 tar -cvzf test_logs.tar.gz exit ${test_status} - store_test_results: