Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(IDX): update CI env vars #1703

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows-source/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ permissions: read-all
env:
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"

Expand Down Expand Up @@ -174,7 +173,7 @@ jobs:
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/${ROOT_PIPELINE_ID}"
BAZEL_STARTUP_ARGS: "--output_base /var/tmp/bazel-output/${CI_JOB_ID}"
BAZEL_TARGETS: "//rs/... //publish/binaries/..."
HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }}
- <<: *bazel-bep
Expand Down Expand Up @@ -249,12 +248,12 @@ jobs:
run: |
set -eExuo pipefail
REPO_NAME="${GITHUB_REPOSITORY##*/}"
rm -rf "/cache/job/${CI_JOB_ID}/${ROOT_PIPELINE_ID}"
mkdir -p "/cache/job/${CI_JOB_ID}/${ROOT_PIPELINE_ID}/artifacts"
ln -s "/cache/job/${CI_JOB_ID}/${ROOT_PIPELINE_ID}/artifacts" /__w/$REPO_NAME/$REPO_NAME/artifacts
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
rm -rf "/cache/job/${CI_JOB_NAME}/${CI_JOB_ID}"
mkdir -p "/cache/job/${CI_JOB_NAME}/${CI_JOB_ID}/artifacts"
ln -s "/cache/job/${CI_JOB_NAME}/${CI_JOB_ID}/artifacts" /__w/$REPO_NAME/$REPO_NAME/artifacts
buildevents cmd "$CI_JOB_ID" "$CI_JOB_NAME" build-command -- \
"$CI_PROJECT_DIR"/ci/scripts/run-build-ic.sh
rm -rf "/cache/job/${CI_JOB_ID}/${ROOT_PIPELINE_ID}"
rm -rf "/cache/job/${CI_JOB_NAME}/${CI_JOB_ID}"
env:
BAZEL_COMMAND: "build"
RUN_ON_DIFF_ONLY: ${{ !contains(github.event.pull_request.labels.*.name, 'CI_ALL_BAZEL_TARGETS') }}
Expand Down Expand Up @@ -345,7 +344,7 @@ jobs:
shell: bash
run: |
set -eExuo pipefail
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
buildevents cmd "$CI_JOB_ID" "$CI_JOB_NAME" build-command -- \
"$CI_PROJECT_DIR"/ci/scripts/rust-lint.sh

cargo-build-release-linux:
Expand Down Expand Up @@ -374,5 +373,5 @@ jobs:
shell: bash
run: |
set -eExuo pipefail
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
buildevents cmd "$CI_JOB_ID" "$CI_JOB_NAME" build-command -- \
cargo build --release
3 changes: 1 addition & 2 deletions .github/workflows-source/release-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ concurrency:
env:
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.ref_name }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows-source/schedule-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
BUILDEVENT_DATASET: "github-ci-dfinity"

anchors:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows-source/schedule-hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"

Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ permissions: read-all
env:
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"
jobs:
Expand Down Expand Up @@ -174,7 +173,7 @@ jobs:
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/${ROOT_PIPELINE_ID}"
BAZEL_STARTUP_ARGS: "--output_base /var/tmp/bazel-output/${CI_JOB_ID}"
BAZEL_TARGETS: "//rs/... //publish/binaries/..."
HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }}
- name: Upload bazel-bep
Expand Down Expand Up @@ -335,12 +334,12 @@ jobs:
run: |
set -eExuo pipefail
REPO_NAME="${GITHUB_REPOSITORY##*/}"
rm -rf "/cache/job/${CI_JOB_ID}/${ROOT_PIPELINE_ID}"
mkdir -p "/cache/job/${CI_JOB_ID}/${ROOT_PIPELINE_ID}/artifacts"
ln -s "/cache/job/${CI_JOB_ID}/${ROOT_PIPELINE_ID}/artifacts" /__w/$REPO_NAME/$REPO_NAME/artifacts
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
rm -rf "/cache/job/${CI_JOB_NAME}/${CI_JOB_ID}"
mkdir -p "/cache/job/${CI_JOB_NAME}/${CI_JOB_ID}/artifacts"
ln -s "/cache/job/${CI_JOB_NAME}/${CI_JOB_ID}/artifacts" /__w/$REPO_NAME/$REPO_NAME/artifacts
buildevents cmd "$CI_JOB_ID" "$CI_JOB_NAME" build-command -- \
"$CI_PROJECT_DIR"/ci/scripts/run-build-ic.sh
rm -rf "/cache/job/${CI_JOB_ID}/${ROOT_PIPELINE_ID}"
rm -rf "/cache/job/${CI_JOB_NAME}/${CI_JOB_ID}"
env:
BAZEL_COMMAND: "build"
RUN_ON_DIFF_ONLY: ${{ !contains(github.event.pull_request.labels.*.name, 'CI_ALL_BAZEL_TARGETS') }}
Expand Down Expand Up @@ -441,7 +440,7 @@ jobs:
shell: bash
run: |
set -eExuo pipefail
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
buildevents cmd "$CI_JOB_ID" "$CI_JOB_NAME" build-command -- \
"$CI_PROJECT_DIR"/ci/scripts/rust-lint.sh
cargo-build-release-linux:
name: Cargo Build Release Linux
Expand Down Expand Up @@ -478,5 +477,5 @@ jobs:
shell: bash
run: |
set -eExuo pipefail
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
buildevents cmd "$CI_JOB_ID" "$CI_JOB_NAME" build-command -- \
cargo build --release
3 changes: 1 addition & 2 deletions .github/workflows/release-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ concurrency:
env:
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.ref_name }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"
jobs:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/schedule-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
BUILDEVENT_DATASET: "github-ci-dfinity"
jobs:
bazel-test-bare-metal:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/schedule-hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"
jobs:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/schedule-rust-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
BUILDEVENT_DATASET: "github-ci-dfinity"

jobs:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/system-tests-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }}
CI_JOB_ID: ${{ github.run_id }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }}
BUILDEVENT_DATASET: "github-ci-dfinity"

Expand Down
2 changes: 1 addition & 1 deletion ci/bazel-scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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 "${ROOT_PIPELINE_ID}" "${CI_JOB_ID}" "${CI_JOB_NAME}-bazel-cmd" -- bazel \
buildevents cmd "${CI_JOB_ID}" "${CI_JOB_NAME}" "${CI_JOB_NAME}-bazel-cmd" -- bazel \
${BAZEL_STARTUP_ARGS} \
${BAZEL_COMMAND} \
--color=yes \
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/run-build-ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi

tar -chf artifacts.tar artifacts
ls -l /ceph-s3-info/** || true
URL="http://$(cat /ceph-s3-info/BUCKET_HOST)/$(cat /ceph-s3-info/BUCKET_NAME)/${VERSION}/${CI_JOB_ID}"
URL="http://$(cat /ceph-s3-info/BUCKET_HOST)/$(cat /ceph-s3-info/BUCKET_NAME)/${VERSION}/${CI_JOB_NAME}"
curl --request PUT --upload-file artifacts.tar "${URL}/artifacts.tar"

mkdir build-ic
Expand All @@ -69,7 +69,7 @@ for DIR in release canisters icos/guestos icos/hostos icos/setupos; do
fi
done

EXTERNAL_URL="https://objects.$(echo "${NODE_NAME:-}" | cut -d'-' -f1)-idx1.dfinity.network/$(cat /ceph-s3-info/BUCKET_NAME)/${VERSION}/${CI_JOB_ID}/artifacts.tar"
EXTERNAL_URL="https://objects.$(echo "${NODE_NAME:-}" | cut -d'-' -f1)-idx1.dfinity.network/$(cat /ceph-s3-info/BUCKET_NAME)/${VERSION}/${CI_JOB_NAME}/artifacts.tar"
echo -e "Node: ${NODE_NAME:-}\nURL: ${URL}\nExternal URL: ${EXTERNAL_URL}" >./build-ic/info
echo "${EXTERNAL_URL}" >./build-ic/url
tar -cf build-ic.tar build-ic
Loading