Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nmattia committed Feb 11, 2025
1 parent 3969c3f commit cbfbbb4
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 94 deletions.
12 changes: 0 additions & 12 deletions .github/actions/bazel-test-all/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ inputs:
BAZEL_COMMAND:
required: true
default: 'test'
BAZEL_TARGETS:
required: false
default: '//...'
BAZEL_CI_CONFIG:
required: false
default: '--config=ci'
BAZEL_EXTRA_ARGS:
required: false
default: ''
BUILDEVENT_APIKEY:
required: false
SSH_PRIVATE_KEY_BACKUP_POD:
Expand Down Expand Up @@ -66,9 +57,6 @@ runs:
exit "$BAZEL_EXIT_CODE"
env:
BAZEL_COMMAND: ${{ inputs.BAZEL_COMMAND }}
BAZEL_TARGETS: ${{ inputs.BAZEL_TARGETS }}
BAZEL_CI_CONFIG: ${{ inputs.BAZEL_CI_CONFIG }}
BAZEL_EXTRA_ARGS: ${{ inputs.BAZEL_EXTRA_ARGS }}
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BUILDEVENT_APIKEY: ${{ inputs.BUILDEVENT_APIKEY }}
CI_EVENT_NAME: ${{ github.event_name }}
Expand Down
25 changes: 9 additions & 16 deletions .github/workflows-source/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//..."
BAZEL_CI_CONFIG: "--config=ci"
# check if PR title contains release and set timeout filters accordingly
BAZEL_EXTRA_ARGS: ${{ env.BAZEL_EXTRA_ARGS }}
BAZEL_COMMAND: test --config=ci ${{ env.BAZEL_EXTRA_ARGS }} //...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand Down Expand Up @@ -171,10 +167,10 @@ jobs:
env:
CLOUD_CREDENTIALS_CONTENT: ${{ secrets.CLOUD_CREDENTIALS_CONTENT }}
with:
BAZEL_CI_CONFIG: "--config=ci --config macos_ci"
BAZEL_COMMAND: test
BAZEL_EXTRA_ARGS: '--test_tag_filters=test_macos'
BAZEL_TARGETS: "//rs/... //publish/binaries/..."
BAZEL_COMMAND: >-
test --config=ci --config=macos_ci
--test_tag_filters=test_macos
//rs/... //publish/binaries/...
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
- name: Purge Bazel Output
Expand All @@ -193,9 +189,8 @@ jobs:
id: bazel-build-fuzzers
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "build"
BAZEL_TARGETS: "//rs/..."
BAZEL_EXTRA_ARGS: "--keep_going --config=fuzzing --build_tag_filters=libfuzzer"
BAZEL_COMMAND: >-
build --config=ci --keep_going --config=fuzzing --build_tag_filters=libfuzzer //rs/...
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep

Expand All @@ -208,9 +203,7 @@ jobs:
id: bazel-build-fuzzers-afl
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "build"
BAZEL_TARGETS: "//rs/..."
BAZEL_EXTRA_ARGS: "--keep_going --config=afl"
BAZEL_COMMAND: build --config=ci --keep_going --config=afl //rs/...
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep

Expand Down Expand Up @@ -261,7 +254,7 @@ jobs:
"$CI_PROJECT_DIR"/ci/scripts/run-build-ic.sh
rm -rf "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}"
env:
BAZEL_COMMAND: "build"
BAZEL_COMMAND: build --config=ci //...
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
RUN_ON_DIFF_ONLY: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'CI_ALL_BAZEL_TARGETS') }}
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows-source/release-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_nightly"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_nightly //rs/tests/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand All @@ -94,10 +92,8 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_staging"
BAZEL_COMMAND: >-
test --config=ci //rs/tests/... --keep_going --test_tag_filters=system_test_staging
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand All @@ -113,10 +109,8 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_hotfix"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_hotfix //rs/tests/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand Down Expand Up @@ -187,10 +181,11 @@ jobs:
- name: Run qualification for version ${{ matrix.version }} from the tip of the branch
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/dre:guest_os_qualification"
BAZEL_CI_CONFIG: "--config=systest"
BAZEL_EXTRA_ARGS: "--keep_going --test_timeout=7200 --test_env=OLD_VERSION=${{ matrix.version }}"
BAZEL_COMMAND: >-
test
--config=ci --config=systest --keep_going
--test_timeout=7200 --test_env=OLD_VERSION=${{ matrix.version }}
//rs/tests/dre:guest_os_qualification
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows-source/schedule-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/ledger_suite/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=fi_tests_nightly --test_env=SSH_AUTH_SOCK --test_timeout=43200"
BAZEL_COMMAND: >-
test
--config=ci --keep_going
--test_tag_filters=fi_tests_nightly --test_env=SSH_AUTH_SOCK --test_timeout=43200
//rs/ledger_suite/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
SSH_PRIVATE_KEY_BACKUP_POD: ${{ secrets.SSH_PRIVATE_KEY_BACKUP_POD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Expand All @@ -130,10 +131,11 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/nns/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=nns_tests_nightly --test_env=SSH_AUTH_SOCK --test_env=NNS_CANISTER_UPGRADE_SEQUENCE=all"
BAZEL_COMMAND: >-
test
--config=ci --keep_going
--test_tag_filters=nns_tests_nightly --test_env=SSH_AUTH_SOCK --test_env=NNS_CANISTER_UPGRADE_SEQUENCE=all
//rs/nns/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
SSH_PRIVATE_KEY_BACKUP_POD: ${{ secrets.SSH_PRIVATE_KEY_BACKUP_POD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
Expand All @@ -155,11 +157,12 @@ jobs:
id: bazel-system-test-benchmarks
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: ${{ env.BENCHMARK_TARGETS }}
BAZEL_CI_CONFIG: "--config=ci"
# note: there's just one performance cluster, so the job can't be parallelized
BAZEL_EXTRA_ARGS: "--test_tag_filters=system_test_benchmark --//bazel:enable_upload_perf_systest_results=True --keep_going --jobs 1"
BAZEL_COMMAND: >-
test
--config=ci
--test_tag_filters=system_test_benchmark --//bazel:enable_upload_perf_systest_results=True --keep_going --jobs 1
${{ env.BENCHMARK_TARGETS }}
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows-source/schedule-hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ jobs:
env:
CLOUD_CREDENTIALS_CONTENT: ${{ secrets.CLOUD_CREDENTIALS_CONTENT }}
with:
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_COMMAND: "build"
BAZEL_EXTRA_ARGS: "--repository_cache= --disk_cache= --noremote_accept_cached --remote_instance_name=${CI_COMMIT_SHA} --@rules_rust//rust/settings:pipelined_compilation=True"
BAZEL_CI_CONFIG: ""
BAZEL_COMMAND: >-
build
--config=ci
--repository_cache= --disk_cache= --noremote_accept_cached --remote_instance_name=${CI_COMMIT_SHA} --@rules_rust//rust/settings:pipelined_compilation=True
//...
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep

Expand All @@ -81,10 +84,8 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_hourly"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_hourly //rs/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,8 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//..."
BAZEL_CI_CONFIG: "--config=ci"
# check if PR title contains release and set timeout filters accordingly
BAZEL_EXTRA_ARGS: ${{ env.BAZEL_EXTRA_ARGS }}
BAZEL_COMMAND: >-
test --config=ci ${{ env.BAZEL_EXTRA_ARGS }} //...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Upload bazel-bep
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/release-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_nightly"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_nightly //rs/tests/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Upload bazel-bep
Expand Down Expand Up @@ -88,10 +86,8 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_staging"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_staging //rs/tests/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Upload bazel-bep
Expand Down Expand Up @@ -131,10 +127,8 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_hotfix"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_hotfix //rs/tests/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Upload bazel-bep
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/system-tests-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ jobs:
env:
CLOUD_CREDENTIALS_CONTENT: ${{ secrets.CLOUD_CREDENTIALS_CONTENT }}
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "${{ env.TARGETS }}"
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel"
BAZEL_EXTRA_ARGS: "--local_test_jobs=${{ env.JOBS }} --test_tag_filters=k8s,-manual,-colocated,-long_test,-system_test_hourly,-system_test_nightly --k8s"
BAZEL_COMMAND: >-
test
--config=ci
--local_test_jobs=${{ env.JOBS }} --test_tag_filters=k8s,-manual,-colocated,-long_test,-system_test_hourly,-system_test_nightly --k8s
${{ env.TARGETS }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Upload bazel-bep
Expand Down Expand Up @@ -153,10 +154,11 @@ jobs:
env:
CLOUD_CREDENTIALS_CONTENT: ${{ secrets.CLOUD_CREDENTIALS_CONTENT }}
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "${{ env.TARGETS }}"
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel"
BAZEL_EXTRA_ARGS: "--local_test_jobs=${{ env.JOBS }} --test_tag_filters=k8s --k8s --flaky_test_attempts=3"
BAZEL_COMMAND: >-
test
--config=ci
--local_test_jobs=${{ env.JOBS }} --test_tag_filters=k8s --k8s --flaky_test_attempts=3
${{ env.TARGETS }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Upload bazel-bep
Expand Down
6 changes: 3 additions & 3 deletions ci/bazel-scripts/diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ if [ ${#files[@]} -eq 0 ]; then
exit 0
fi

if [ "${BAZEL_COMMAND:-}" == "build" ]; then
if [[ $BAZEL_COMMAND =~ ^build[[:space:]] ]]; then
TARGETS=$(bazel query "rdeps(//..., set(${files[*]}))")
elif [ "${BAZEL_COMMAND:-}" == "test" ]; then
elif [[ $BAZEL_COMMAND =~ ^test[[:space:]] ]]; then
EXCLUDED_TAGS=(manual $EXCLUDED_TEST_TAGS)
EXCLUDED_TAGS=$(
IFS='|'
echo "${EXCLUDED_TAGS[*]}"
)
TARGETS=$(bazel query "kind(test, rdeps(//..., set(${files[*]}))) except attr('tags', '$EXCLUDED_TAGS', //...)")
else
echo "Unknown BAZEL_COMMAND: ${BAZEL_COMMAND:-}" >&2
echo "Cannot infer command from BAZEL_COMMAND: ${BAZEL_COMMAND:-}" >&2
exit 1
fi

Expand Down
3 changes: 0 additions & 3 deletions ci/bazel-scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,11 @@ bazel_args=(
--output_base=/var/tmp/bazel-output # Output base wiped after run
${BAZEL_COMMAND}
--color=yes
${BAZEL_CI_CONFIG}
--build_metadata=BUILDBUDDY_LINKS="[CI Job](${CI_JOB_URL})"
--ic_version="${CI_COMMIT_SHA}"
--ic_version_rc_only="${ic_version_rc_only}"
--release_build="${release_build}"
--s3_upload="${s3_upload:-"False"}"
${BAZEL_EXTRA_ARGS:-}
${BAZEL_TARGETS}
)

# Unless explicitly provided, we set a default --repository_cache to a volume mounted
Expand Down

0 comments on commit cbfbbb4

Please sign in to comment.