Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nmattia committed Feb 21, 2025
1 parent 7fac242 commit 0d11924
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 12 deletions.
38 changes: 35 additions & 3 deletions .github/workflows-source/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,20 @@ jobs:
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: test --config=ci ${{ env.BAZEL_EXTRA_ARGS }}
BAZEL_TARGETS: //...
BAZEL_TARGETS: "//..."
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Foo bar
run: |
find -L bazel-out -name SHA256SUMS | xargs cat | sort | uniq > out_shafile_all
- name: Upload out_shafile
uses: actions/upload-artifact@v4
with:
name: out_shafile_all
retention-days: 1
path: |
out_shafile_all
- <<: *bazel-bep

bazel-test-macos-intel:
Expand Down Expand Up @@ -252,20 +263,29 @@ jobs:
id: build-ic
shell: bash
run: |
set -eExuo pipefail
[ -n "${NODE_NAME:-}" ] && echo "Run on node: $NODE_NAME" >>$GITHUB_STEP_SUMMARY
set -euo pipefail
REPO_NAME="${GITHUB_REPOSITORY##*/}"
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
"$CI_PROJECT_DIR"/ci/scripts/run-build-ic.sh
rm -rf "/cache/job/${CI_JOB_NAME}/${CI_RUN_ID}"
find -L bazel-out -name SHA256SUMS | xargs cat | sort | uniq > out_shafile_all
env:
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') }}
- name: Upload out_shafile
uses: actions/upload-artifact@v4
with:
name: out_shafile_build
retention-days: 1
path: |
out_shafile_build
- name: Upload build-ic.tar
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -311,6 +331,18 @@ jobs:
uses: actions/download-artifact@v4
with:
name: build-ic
- name: Download out_shafile_all
uses: actions/download-artifact@v4
with:
name: out_shafile_all
- name: Download out_shafile_build
uses: actions/download-artifact@v4
with:
name: out_shafile_build

- name: diff
run: |
diff <(sort < ./out_shafile_build) <(sort <./out_shafile_all)
- name: Build Determinism Test
id: build-determinism
run: |
Expand Down
4 changes: 4 additions & 0 deletions ci/bazel-scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
echo "BuildBuddy [$invocation]($(<"$url_out"))" >>$GITHUB_STEP_SUMMARY
fi
rm "$url_out"

echo "the shasums:"

find -L bazel-out -name SHA256SUMS
7 changes: 1 addition & 6 deletions ci/scripts/build-determinism.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@ sed -i -e '/.wasm.gz.did/d' "$PATH0/SHA256SUMS" "$PATH1/SHA256SUMS"
sed -i -e '/disk-img/d' "$PATH0/SHA256SUMS" "$PATH1/SHA256SUMS"

if ! diff -u "$PATH0/SHA256SUMS" "$PATH1/SHA256SUMS"; then
cat build-ic/info
echo "Build Determinism Check Failed!"
echo "Contact IDX or investigate by yourself using diffoscope:"
echo " * [bazel-test-all]: curl -sfS https://download.dfinity.systems/ic/$VERSION/$PATH0/<artifact> -O"
echo " * [build-ic]: curl $(cat build-ic/url) -O"
echo "See info for pull the artifacts from both CI jobs above. Specify <artifact> based on logs (e.g. 'ic-admin.gz', 'disk-img.tar.zst')."
echo "Note that [build-ic] artifacts.tar contains all the build artifacts (binaries, canisters and IC images)."
echo "Contact IDX or investigate by yourself using diffoscope."
exit 1
fi

Expand Down
3 changes: 0 additions & 3 deletions ci/scripts/run-build-ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,4 @@ 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_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
1 change: 1 addition & 0 deletions ci/src/artifacts/upload.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def _upload_artifact_impl(ctx):
outputs = [urls],
)
out.append(urls)
out.append(checksum)
out.extend(fileurl)

executable = ctx.actions.declare_file(ctx.label.name + ".bin")
Expand Down

0 comments on commit 0d11924

Please sign in to comment.