diff --git a/.github/actions/bazel-test-all/action.yaml b/.github/actions/bazel-test-all/action.yaml index 8fb407e3f6d..6949952b641 100644 --- a/.github/actions/bazel-test-all/action.yaml +++ b/.github/actions/bazel-test-all/action.yaml @@ -17,7 +17,7 @@ inputs: required: false default: '--output_base=/var/tmp/bazel-output/' BUILDEVENT_APIKEY: - required: true + required: false SSH_PRIVATE_KEY: required: false @@ -39,9 +39,16 @@ runs: echo -e "Host *\nUser github-runner\n" > ~/.ssh/config fi + # unset honeycomb api key but use it latter for exporter + # TODO: remove exporter when users can use superset + KEY=${BUILDEVENT_APIKEY:-""} + unset 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. @@ -51,6 +58,7 @@ runs: cat "$exportout" fi rm "$exportout" + echo "BEP events exported to honeycomb!" fi # output node name to gihub step summary diff --git a/.github/workflows-source/ci-main.yml b/.github/workflows-source/ci-main.yml index d789cf57061..b529c2faab1 100644 --- a/.github/workflows-source/ci-main.yml +++ b/.github/workflows-source/ci-main.yml @@ -200,7 +200,6 @@ jobs: BAZEL_EXTRA_ARGS: '--test_tag_filters=test_macos' BAZEL_STARTUP_ARGS: "--output_base /var/tmp/bazel-output/${CI_RUN_ID}" BAZEL_TARGETS: "//rs/... //publish/binaries/..." - BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} - name: Purge Bazel Output if: always() shell: bash @@ -219,7 +218,6 @@ jobs: BAZEL_COMMAND: "build" BAZEL_TARGETS: "//rs/..." BAZEL_EXTRA_ARGS: "--keep_going --config=fuzzing --build_tag_filters=libfuzzer" - BUILDEVENT_APIKEY: ${{ secrets. HONEYCOMB_API_TOKEN }} bazel-build-fuzzers-afl: name: Bazel Build Fuzzers AFL @@ -233,7 +231,6 @@ jobs: BAZEL_COMMAND: "build" BAZEL_TARGETS: "//rs/..." BAZEL_EXTRA_ARGS: "--keep_going --config=afl" - BUILDEVENT_APIKEY: ${{ secrets. HONEYCOMB_API_TOKEN }} python-ci-tests: name: Python CI Tests @@ -279,13 +276,11 @@ jobs: rm -rf "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}" mkdir -p "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}/artifacts" ln -s "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}/artifacts" /__w/$REPO_NAME/$REPO_NAME/artifacts - buildevents cmd "$CI_RUN_ID" "$CI_JOB_NAME" build-command -- \ - "$CI_PROJECT_DIR"/ci/scripts/run-build-ic.sh + "$CI_PROJECT_DIR"/ci/scripts/run-build-ic.sh rm -rf "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}" env: BAZEL_COMMAND: "build" MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }} - BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} 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') }} - name: Upload build-ic.tar @@ -374,13 +369,10 @@ jobs: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' shell: bash - env: - BUILDEVENT_APIKEY: ${{ secrets. HONEYCOMB_API_TOKEN }} run: | set -eExuo pipefail export CARGO_TERM_COLOR=always # ensure output has colors - buildevents cmd "$CI_RUN_ID" "$CI_JOB_NAME" build-command -- \ - "$CI_PROJECT_DIR"/ci/scripts/rust-lint.sh + "$CI_PROJECT_DIR"/ci/scripts/rust-lint.sh cargo-build-release-linux: name: Cargo Build Release Linux @@ -408,10 +400,7 @@ jobs: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' shell: bash - env: - BUILDEVENT_APIKEY: ${{ secrets. HONEYCOMB_API_TOKEN }} run: | set -eExuo pipefail export CARGO_TERM_COLOR=always # ensure output has colors - buildevents cmd "$CI_RUN_ID" "$CI_JOB_NAME" build-command -- \ - cargo build --release --locked + cargo build --release --locked diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index d6fa1173bc1..dab05918fb8 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -168,7 +168,6 @@ jobs: BAZEL_EXTRA_ARGS: '--test_tag_filters=test_macos' BAZEL_STARTUP_ARGS: "--output_base /var/tmp/bazel-output/${CI_RUN_ID}" BAZEL_TARGETS: "//rs/... //publish/binaries/..." - BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} - name: Purge Bazel Output if: always() shell: bash @@ -195,7 +194,6 @@ jobs: BAZEL_COMMAND: "build" BAZEL_TARGETS: "//rs/..." BAZEL_EXTRA_ARGS: "--keep_going --config=fuzzing --build_tag_filters=libfuzzer" - BUILDEVENT_APIKEY: ${{ secrets. HONEYCOMB_API_TOKEN }} bazel-build-fuzzers-afl: name: Bazel Build Fuzzers AFL runs-on: @@ -217,7 +215,6 @@ jobs: BAZEL_COMMAND: "build" BAZEL_TARGETS: "//rs/..." BAZEL_EXTRA_ARGS: "--keep_going --config=afl" - BUILDEVENT_APIKEY: ${{ secrets. HONEYCOMB_API_TOKEN }} python-ci-tests: name: Python CI Tests runs-on: @@ -282,13 +279,11 @@ jobs: rm -rf "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}" mkdir -p "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}/artifacts" ln -s "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}/artifacts" /__w/$REPO_NAME/$REPO_NAME/artifacts - buildevents cmd "$CI_RUN_ID" "$CI_JOB_NAME" build-command -- \ - "$CI_PROJECT_DIR"/ci/scripts/run-build-ic.sh + "$CI_PROJECT_DIR"/ci/scripts/run-build-ic.sh rm -rf "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}" env: BAZEL_COMMAND: "build" MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }} - BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} 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') }} - name: Upload build-ic.tar @@ -383,13 +378,10 @@ jobs: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' shell: bash - env: - BUILDEVENT_APIKEY: ${{ secrets. HONEYCOMB_API_TOKEN }} run: | set -eExuo pipefail export CARGO_TERM_COLOR=always # ensure output has colors - buildevents cmd "$CI_RUN_ID" "$CI_JOB_NAME" build-command -- \ - "$CI_PROJECT_DIR"/ci/scripts/rust-lint.sh + "$CI_PROJECT_DIR"/ci/scripts/rust-lint.sh cargo-build-release-linux: name: Cargo Build Release Linux container: @@ -421,10 +413,7 @@ jobs: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' shell: bash - env: - BUILDEVENT_APIKEY: ${{ secrets. HONEYCOMB_API_TOKEN }} run: | set -eExuo pipefail export CARGO_TERM_COLOR=always # ensure output has colors - buildevents cmd "$CI_RUN_ID" "$CI_JOB_NAME" build-command -- \ - cargo build --release --locked + cargo build --release --locked diff --git a/.github/workflows/system-tests-k8s.yml b/.github/workflows/system-tests-k8s.yml index c9135ff2ea3..b01fcb8cbd9 100644 --- a/.github/workflows/system-tests-k8s.yml +++ b/.github/workflows/system-tests-k8s.yml @@ -45,8 +45,6 @@ env: CI_PIPELINE_SOURCE: ${{ github.event_name }} CI_PROJECT_DIR: ${{ github.workspace }} CI_RUN_ID: ${{ github.run_id }} - BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} - BUILDEVENT_DATASET: "github-ci-dfinity" jobs: system-tests-k8s: @@ -89,7 +87,6 @@ jobs: 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" - BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} system-tests-k8s-hourly: name: System Tests K8s Hourly @@ -147,4 +144,3 @@ jobs: 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" - BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} diff --git a/ci/bazel-scripts/main.sh b/ci/bazel-scripts/main.sh index 3f8f38718e2..46e7b45cd2f 100755 --- a/ci/bazel-scripts/main.sh +++ b/ci/bazel-scripts/main.sh @@ -93,7 +93,7 @@ stream_awk_program=' # shellcheck disable=SC2086 # ${BAZEL_...} variables are expected to contain several arguments. We have `set -f` set above to disable globbing (and therefore only allow splitting)" -buildevents cmd "${CI_RUN_ID}" "${CI_JOB_NAME}" "${CI_JOB_NAME}-bazel-cmd" -- bazel \ +bazel \ ${BAZEL_STARTUP_ARGS} \ ${BAZEL_COMMAND} \ --color=yes \