Skip to content

Commit

Permalink
Merge branch 'master' into jack/crp-2682
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit authored Feb 13, 2025
2 parents 4cc9cbb + 483f053 commit 34da0c0
Show file tree
Hide file tree
Showing 757 changed files with 15,625 additions and 11,176 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ go_deps.bzl @dfinity/idx
/packages/icrc-ledger-types/ @dfinity/finint
/packages/ic-ledger-hash-of/ @dfinity/finint
/packages/pocket-ic/ @dfinity/pocket-ic
/packages/ic-ed25519/ @dfinity/crypto-team
/packages/ic-ethereum-types/ @dfinity/cross-chain-team
/packages/ic-metrics-assert/ @dfinity/cross-chain-team
/packages/ic-secp256k1/ @dfinity/crypto-team
/packages/ic-sha3/ @dfinity/crypto-team
/packages/ic-signature-verification/ @dfinity/crypto-team
/packages/ic-vetkd-utils/ @dfinity/crypto-team
Expand Down
29 changes: 8 additions & 21 deletions .github/actions/bazel-test-all/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ inputs:
required: true
default: 'test'
BAZEL_TARGETS:
required: false
default: '//...'
BAZEL_CI_CONFIG:
required: false
default: '--config=ci'
BAZEL_EXTRA_ARGS:
required: false
default: ''
BAZEL_STARTUP_ARGS:
required: false
default: '--output_base=/var/tmp/bazel-output/'
required: true
BUILDEVENT_APIKEY:
required: false
SSH_PRIVATE_KEY_BACKUP_POD:
Expand All @@ -32,6 +22,11 @@ runs:
run: |
set +e # manual error handling to ensure we can run some post-build commands
# freshly deployed k8s machines require ownership correctly set
if [ -e /cache ]; then
sudo chown -RL 1001:1001 /cache
fi
if [ -n "$SSH_PRIVATE_KEY_BACKUP_POD" ]; then
# The following adds the SSH private key to the ssh-agent such that CI can SSH into the backup pod.
test -z "${SSH_AUTH_SOCK:-}" && { eval "$(ssh-agent -s)"; ssh-add - <<< "${SSH_PRIVATE_KEY_BACKUP_POD}"; }
Expand All @@ -41,16 +36,11 @@ runs:
echo -e "Host *\nUser github-runner\n" > ~/.ssh/config
fi
# unset honeycomb api key but use it latter for exporter
# unset honeycomb api key but use it later for exporter
# TODO: remove exporter when users can use superset
KEY=${BUILDEVENT_APIKEY:-""}
unset BUILDEVENT_APIKEY
${GITHUB_WORKSPACE}/ci/bazel-scripts/main.sh
env -u BUILDEVENT_APIKEY ${GITHUB_WORKSPACE}/ci/bazel-scripts/main.sh
BAZEL_EXIT_CODE="$?"
export BUILDEVENT_APIKEY="$KEY"
if [ -n "$BUILDEVENT_APIKEY" ] && [ -f ./bazel-bep.pb ]; then
# avoid output unless an error occurs during bes export. This ensures
# only the (more relevant) output from the main bazel command is shown.
Expand All @@ -75,9 +65,6 @@ runs:
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 }}
BAZEL_STARTUP_ARGS: ${{ inputs.BAZEL_STARTUP_ARGS }}
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BUILDEVENT_APIKEY: ${{ inputs.BUILDEVENT_APIKEY }}
CI_EVENT_NAME: ${{ github.event_name }}
Expand Down
70 changes: 17 additions & 53 deletions .github/workflows-source/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ env:
CI_EVENT_NAME: ${{ github.event_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_RUN_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${{ github.workspace }}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"

anchors:
Expand Down Expand Up @@ -65,15 +64,6 @@ anchors:
uses: actions/setup-python@v5
with:
python-version: '3.12'
bazel-upload: &bazel-upload
name: Upload bazel-targets
uses: actions/upload-artifact@v4
with:
name: bazel-targets
retention-days: 14
if-no-files-found: error
path: |
bazel-targets
bazel-bep: &bazel-bep
name: Upload bazel-bep
# runs only if previous step succeeded or failed;
Expand All @@ -94,7 +84,7 @@ jobs:
name: Bazel Test All
<<: *dind-large-setup
runs-on:
group: ln1
group: zh1
labels: dind-large
env:
CLOUD_CREDENTIALS_CONTENT: ${{ secrets.CLOUD_CREDENTIALS_CONTENT }}
Expand Down Expand Up @@ -147,32 +137,11 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//..."
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel"
# 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 }}
BAZEL_TARGETS: //...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
- <<: *bazel-upload

bazel-build-all-config-check:
<<: *dind-large-setup
name: Bazel Build All Config Check
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI_BUILD_CHECK') }}
steps:
- <<: *checkout
- <<: *before-script
- name: Run bazel build --config=check //rs/...
id: bazel-build-config-check
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "build"
BAZEL_TARGETS: "//rs/..."
BAZEL_CI_CONFIG: "--config=check --config=ci --keep_going"
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep

bazel-test-macos-intel:
name: Bazel Test macOS Intel
Expand All @@ -199,11 +168,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_STARTUP_ARGS: "--output_base /var/tmp/bazel-output/"
BAZEL_TARGETS: "//rs/... //publish/binaries/..."
BAZEL_COMMAND: >-
test --config=ci --config=macos_ci
--test_tag_filters=test_macos
BAZEL_TARGETS: //rs/... //publish/binaries/...
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
- name: Purge Bazel Output
Expand All @@ -222,9 +190,9 @@ 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
BAZEL_TARGETS: //rs/...
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep

Expand All @@ -237,9 +205,8 @@ 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
BAZEL_TARGETS: //rs/...
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep

Expand Down Expand Up @@ -290,7 +257,8 @@ 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
BAZEL_TARGETS: //...
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 All @@ -307,6 +275,8 @@ jobs:
name: Build Determinism
runs-on: ubuntu-latest
timeout-minutes: 30
# NOTE: this expects "build-ic" to have built the same set of targets
# as "bazel-test-all"
needs: [build-ic, bazel-test-all]
strategy:
matrix:
Expand All @@ -333,20 +303,14 @@ jobs:
SETUPOS_FLAG: "true"
steps:
- <<: *checkout
- name: Download bazel-targets [bazel-test-all]
uses: actions/download-artifact@v4
with:
name: bazel-targets
- name: Download build-ic.tar [build-ic]
uses: actions/download-artifact@v4
with:
name: build-ic
- name: Build Determinism Test
id: build-determinism
shell: bash
run: |
set -eExuo pipefail
sudo apt update && sudo apt install -y curl
tar -xf build-ic.tar # build-determinism.sh expects ./build-ic/
"$CI_PROJECT_DIR"/ci/scripts/build-determinism.sh
env:
TARGET: ${{ matrix.TARGET }}
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 @@ -18,7 +18,6 @@ env:
CI_PROJECT_DIR: ${{ github.workspace }}
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.ref_name }}
CI_RUN_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"

anchors:
Expand Down Expand Up @@ -77,10 +76,9 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_nightly"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_nightly
BAZEL_TARGETS: //rs/tests/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand All @@ -95,10 +93,9 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_staging"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_staging
BAZEL_TARGETS: //rs/tests/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand All @@ -114,10 +111,9 @@ jobs:
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//rs/tests/..."
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel"
BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_hotfix"
BAZEL_COMMAND: >-
test --config=ci --keep_going --test_tag_filters=system_test_hotfix
BAZEL_TARGETS: //rs/tests/...
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand Down Expand Up @@ -188,10 +184,9 @@ 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_COMMAND: |
test --config=ci --config=systest --keep_going --test_timeout=7200 --test_env=OLD_VERSION=${{ matrix.version }}
BAZEL_TARGETS: "//rs/tests/dre:guest_os_qualification"
BAZEL_CI_CONFIG: "--config=systest --repository_cache=/cache/bazel"
BAZEL_EXTRA_ARGS: "--keep_going --test_timeout=7200 --test_env=OLD_VERSION=${{ matrix.version }}"
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand Down
35 changes: 18 additions & 17 deletions .github/workflows-source/schedule-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
workflow_dispatch:

env:
BAZEL_STARTUP_ARGS: "--output_base=/var/tmp/bazel-output/"
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
Expand Down Expand Up @@ -73,7 +72,7 @@ jobs:
# Run bare metal installation test
# shellcheck disable=SC2046,SC2086
bazel ${BAZEL_STARTUP_ARGS} run ${BAZEL_CI_CONFIG} \
bazel --output_base=/var/tmp/bazel-output run ${BAZEL_CI_CONFIG} \
//ic-os/setupos/envs/dev:launch_bare_metal -- \
--config_path "$(realpath ./ic-os/dev-tools/bare_metal_deployment/zh2-dll01.yaml)" \
--csv_filename "$(realpath file1)" \
Expand All @@ -85,7 +84,7 @@ jobs:
# Run bare metal node performance benchmarks
# shellcheck disable=SC2046,SC2086
bazel ${BAZEL_STARTUP_ARGS} run ${BAZEL_CI_CONFIG} \
bazel --output_base=/var/tmp/bazel-output run ${BAZEL_CI_CONFIG} \
//ic-os/setupos/envs/dev:launch_bare_metal -- \
--config_path "$(realpath ./ic-os/dev-tools/bare_metal_deployment/zh2-dll01.yaml)" \
--csv_filename "$(realpath file1)" \
Expand All @@ -96,8 +95,7 @@ jobs:
--benchmark
bazel clean
env:
BAZEL_STARTUP_ARGS: "--output_base=/var/tmp/bazel-output/"
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel"
BAZEL_CI_CONFIG: "--config=ci"
ZH2_DLL01_CSV_SECRETS: "${{ secrets.ZH2_DLL01_CSV_SECRETS }}"
ZH2_FILE_SHARE_KEY: "${{ secrets.ZH2_FILE_SHARE_KEY }}"

Expand All @@ -112,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 --repository_cache=/cache/bazel"
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
BAZEL_TARGETS: //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 @@ -132,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 --repository_cache=/cache/bazel"
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
BAZEL_TARGETS: //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 @@ -157,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 --repository_cache=/cache/bazel"
# 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
BAZEL_TARGETS: ${{ env.BENCHMARK_TARGETS }}
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- <<: *bazel-bep
Expand Down
Loading

0 comments on commit 34da0c0

Please sign in to comment.