Skip to content

Change CI to use Artifacts to pass CI image around workflow#24

Closed
riley-dixon wants to merge 5 commits into
ROCm:developfrom
riley-dixon:rildixon/ci-use-artifacts
Closed

Change CI to use Artifacts to pass CI image around workflow#24
riley-dixon wants to merge 5 commits into
ROCm:developfrom
riley-dixon:rildixon/ci-use-artifacts

Conversation

@riley-dixon
Copy link
Copy Markdown
Collaborator

Motivation

External PR's are not permitted to push to the GHCR registry under pull_request triggers as this presents a security issue. To get around this, we will upload the AIS CI image as a build artifact to the various workflows. This is fine as these build artifacts really should not be used outside of the CI context. They are also short lived and will be deleted automatically after a day.

This also introduces a privileged job that runs after a PR has been accepted and merged. This updates the CI image hosted in GHCR that can be used for caching/debugging purposes. Since by this point the code has been accepted, we are taking responsibility for it. This job can also be manually triggered, and requires at a minimum "Write" permissions to kick off.

Technical Details

https://docs.github.com/en/webhooks/webhook-events-and-payloads#about-webhook-events-and-payloads - ${{github.event...}} attributes depending on the trigger.

https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context - Contexts for when using ${{}}

https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request - How to use pull requests, create a job that runs when a PR has been merged, etc.

Sharing build artifacts:

We luckily do not need to worry about passing the build artifact across workflows as our main CI that relies on this image all runs from a common parent workflow.

https://docs.docker.com/build/ci/github-actions/share-image-jobs/
https://github.com/actions/upload-artifact
https://github.com/actions/download-artifact

https://docs.github.com/en/actions/reference/limits - TL;DR: The images are small enough that this works for us.

Test Plan

Tested in a fork of the repo. New CI job properly triggers after PR has been merged, and when manually triggered as well.

Test Result

Submission Checklist

@derobins
Copy link
Copy Markdown
Collaborator

derobins commented Nov 5, 2025

Can we use this PR to rename the action files to use hyphens instead of underscores?

@riley-dixon
Copy link
Copy Markdown
Collaborator Author

Can we use this PR to rename the action files to use hyphens instead of underscores?

Can we do that in a separate PR please? Happy to make that change either by itself or with other cleanup work.

@derobins
Copy link
Copy Markdown
Collaborator

derobins commented Nov 5, 2025

Can we use this PR to rename the action files to use hyphens instead of underscores?

Can we do that in a separate PR please? Happy to make that change either by itself or with other cleanup work.

I'll do a PR after this merges so we don't create conflicts

riley-dixon and others added 3 commits November 5, 2025 21:05
We would like to eventually move to a fork-based development model. However, PR's from fork's are unable to push images to the GHCR registry (they could push something bad). So instead, this changes CI to use artifacts instead to pass around the container image.

Surprisingly, this actually slightly reduces the time it takes to load & start the Docker container.
This also provides a trigger to manually initiate an image update.
A user must have at least write access to manually start the workflow.
@riley-dixon riley-dixon force-pushed the rildixon/ci-use-artifacts branch from 84be9fb to 335fe0d Compare November 6, 2025 04:05
@riley-dixon
Copy link
Copy Markdown
Collaborator Author

This will likely be closed in favour of #44

@riley-dixon riley-dixon marked this pull request as draft November 13, 2025 19:19
@derobins
Copy link
Copy Markdown
Collaborator

Closed in favor of #44

@derobins derobins closed this Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants