Skip to content

Commit

Permalink
[Github] Move agent container to separate tar archive
Browse files Browse the repository at this point in the history
This patch makes the build container job save the agent container image to a
separate tar file rather than bundling it in with the existing tar file. For
some reason, running podman save with two container images and then loading
that single tar file gets rid of the agent image and we end up with two
copies of the original image. This means that premerge jobs will fail with
the agent image because they cannot find the run.sh script.
  • Loading branch information
boomanaiden154 committed Jan 22, 2025
1 parent 4280316 commit 76b0187
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-ci-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
container-name-agent-tag: ${{ steps.vars.outputs.container-name-agent-tag }}
container-filename: ${{ steps.vars.outputs.container-filename }}
container-agent-filename: ${{ steps.vars.outputs.container-agent-filename }}
steps:
- name: Checkout LLVM
uses: actions/checkout@v4
Expand All @@ -42,6 +43,7 @@ jobs:
echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT
echo "container-name-agent-tag=$container_name-agent:$tag" >> $GITHUB_OUTPUT
echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
echo "container-agent-filename=$(echo $container_name-agent:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
- name: Build container
working-directory: ./.github/workflows/containers/github-action-ci/
run: |
Expand All @@ -53,13 +55,14 @@ jobs:
# maintain minimal permissions while building the container.
- name: Save container image
run: |
podman save ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name-agent-tag }} > ${{ steps.vars.outputs.container-filename }}
podman save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }}
podman save ${{ steps.vars.outputs.container-name-agent-tag }} > ${{ steps.vars.outputs.container-agent-filename }}
- name: Upload container image
uses: actions/upload-artifact@v4
with:
name: container
path: ${{ steps.vars.outputs.container-filename }}
path: "*.tar"
retention-days: 14

- name: Test Container
Expand Down Expand Up @@ -92,6 +95,7 @@ jobs:
podman push ${{ needs.build-ci-container.outputs.container-name-tag }}
podman push ${{ needs.build-ci-container.outputs.container-name }}:latest
podman load -i ${{ needs.build-ci-container.outputs.container-agent-filename }}
podman tag ${{ needs.build-ci-container.outputs.container-name-agent-tag }} ${{ needs.build-ci-container.outputs.container-name-agent }}:latest
podman push ${{ needs.build-ci-container.outputs.container-name-agent-tag }}
podman push ${{ needs.build-ci-container.outputs.container-name-agent }}:latest

0 comments on commit 76b0187

Please sign in to comment.