-
Notifications
You must be signed in to change notification settings - Fork 28
CI: auto-trigger AITER prebuilt upload when 3rdparty/aiter updates on dev #543
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
base: dev
Are you sure you want to change the base?
Changes from all commits
2a63432
8cb05ea
52be5b1
7be4b09
c08e310
c63d1fa
015b705
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushing to dev is too late. Binaries are expected to be cached when PR is created, otherwise the PR CI will have to rebuild them
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I initially started with an idea to provide a PR comment trigger which does this. Do you think it is better? In this case I might need to provide a way to force-push if the user needs to trigger multiple times while working on the PR.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if it can be driven by CI labels + filter by specific path modification. I.e. on the first CI run after aiter commit update, it first builds and uploads AITER and then goes further with CI.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On that note, can we have an upload as a side effect during the build-and-test workflow? That would provide a relatively simple way to implement this. Specifically, we can do this more-or-less as-is by using the following filtering for a prebuilt cache upload: Not sure which one exactly is needed since aiter is a submodule but one should work. Still, I'd be more interested in conditionally checking whether the AITER submodule was built from source, and then uploading if it was in the build-and-test flow. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,8 +10,70 @@ on: | |||||||||||||||||
|
|
||||||||||||||||||
| permissions: | ||||||||||||||||||
| contents: read | ||||||||||||||||||
| pull-requests: read | ||||||||||||||||||
| actions: write | ||||||||||||||||||
|
|
||||||||||||||||||
| jobs: | ||||||||||||||||||
| # Resolve Docker image tag | ||||||||||||||||||
| select_ci_image: | ||||||||||||||||||
| uses: ./.github/workflows/select-docker-image.yml | ||||||||||||||||||
| with: | ||||||||||||||||||
| docker_image_override: '' | ||||||||||||||||||
| test_config_from_source: true | ||||||||||||||||||
|
|
||||||||||||||||||
| # Whether the PR touches 3rdparty/aiter | ||||||||||||||||||
| aiter_gate: | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
| outputs: | ||||||||||||||||||
| aiter_paths: ${{ steps.paths.outputs.aiter }} | ||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Detect PR changes under 3rdparty/aiter | ||||||||||||||||||
| uses: dorny/paths-filter@v4 | ||||||||||||||||||
| id: paths | ||||||||||||||||||
| if: github.event.action == 'synchronize' | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: this
Suggested change
…paired with |
||||||||||||||||||
| with: | ||||||||||||||||||
| filters: | | ||||||||||||||||||
| aiter: | ||||||||||||||||||
| - '3rdparty/aiter/**' | ||||||||||||||||||
|
|
||||||||||||||||||
| # Whether to upload AITER prebuilt to Artifactory | ||||||||||||||||||
| aiter_prebuilt_upload_trigger: | ||||||||||||||||||
| needs: [aiter_gate, select_ci_image] | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
| outputs: | ||||||||||||||||||
| # true only on synchronize + aiter paths + cache miss (default false via expression) | ||||||||||||||||||
| trigger_aiter_upload: ${{ github.event.action == 'synchronize' && needs.aiter_gate.outputs.aiter_paths == 'true' && steps.aiter_upload_cache.outputs.cache-hit != 'true' }} | ||||||||||||||||||
| aiter_upload_cache_key: ${{ steps.aiter_key.outputs.cache_key }} | ||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Checkout PR head | ||||||||||||||||||
| if: ${{ github.event.action == 'synchronize' && needs.aiter_gate.outputs.aiter_paths == 'true' }} | ||||||||||||||||||
| uses: actions/checkout@v6 | ||||||||||||||||||
| with: | ||||||||||||||||||
| ref: ${{ github.event.pull_request.head.sha }} | ||||||||||||||||||
| fetch-depth: 1 | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Compute AITER upload cache key | ||||||||||||||||||
| id: aiter_key | ||||||||||||||||||
| if: ${{ github.event.action == 'synchronize' && needs.aiter_gate.outputs.aiter_paths == 'true' }} | ||||||||||||||||||
| env: | ||||||||||||||||||
| IMAGE_TO_USE: ${{ needs.select_ci_image.outputs.image_tag }} | ||||||||||||||||||
| run: | | ||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||
| AITER_SHA=$(git rev-parse HEAD:3rdparty/aiter) | ||||||||||||||||||
| IMAGE_SLUG=$(printf '%s' "$IMAGE_TO_USE" | sha256sum | awk '{print $1}') | ||||||||||||||||||
| echo "aiter_sha=$AITER_SHA" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
| echo "image_slug=$IMAGE_SLUG" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
| echo "cache_key=aiter-prebuilt-upload-ok-${IMAGE_SLUG}-${AITER_SHA}" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
| echo "Resolved Docker image for cache key (select-docker-image.yml): $IMAGE_TO_USE" | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: AITER upload cache validation | ||||||||||||||||||
| id: aiter_upload_cache | ||||||||||||||||||
| if: ${{ github.event.action == 'synchronize' && needs.aiter_gate.outputs.aiter_paths == 'true' }} | ||||||||||||||||||
| uses: actions/cache/restore@v4 | ||||||||||||||||||
| with: | ||||||||||||||||||
| path: .aiter-upload-success | ||||||||||||||||||
| key: ${{ steps.aiter_key.outputs.cache_key }} | ||||||||||||||||||
|
|
||||||||||||||||||
| determine_level: | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
| outputs: | ||||||||||||||||||
|
|
@@ -52,10 +114,14 @@ jobs: | |||||||||||||||||
| # - A ci-level label higher than any existing ci-level label(s) was added | ||||||||||||||||||
| # - A commit was pushed with existing ci-level label(s) | ||||||||||||||||||
| # - The PR was reopened or opened with existing ci-level label(s) | ||||||||||||||||||
| if: ${{ needs.determine_level.outputs.test_level != '' }} | ||||||||||||||||||
| needs: determine_level | ||||||||||||||||||
| if: ${{ always() && needs.select_ci_image.result == 'success' && needs.determine_level.outputs.test_level != '' }} | ||||||||||||||||||
| needs: [determine_level, aiter_prebuilt_upload_trigger, select_ci_image] | ||||||||||||||||||
| name: CI Level ${{ needs.determine_level.outputs.test_level }} | ||||||||||||||||||
| uses: ./.github/workflows/rocm-ci.yml | ||||||||||||||||||
| secrets: inherit | ||||||||||||||||||
| with: | ||||||||||||||||||
| test_level: ${{ needs.determine_level.outputs.test_level }} | ||||||||||||||||||
| trigger_aiter_upload: ${{ needs.aiter_prebuilt_upload_trigger.outputs.trigger_aiter_upload == 'true' }} | ||||||||||||||||||
| aiter_upload_cache_key: ${{ needs.aiter_prebuilt_upload_trigger.outputs.aiter_upload_cache_key }} | ||||||||||||||||||
| docker_image_override: ${{ needs.select_ci_image.outputs.image_tag }} | ||||||||||||||||||
| test_config_from_source: true | ||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usage string omits the script's primary modes (no-arg package-only and
--build). When someone misuses--preflightand lands on this branch they'll be told only the preflight forms exist.