Skip to content

Commit 76b0187

Browse files
[Github] Move agent container to separate tar archive
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.
1 parent 4280316 commit 76b0187

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: .github/workflows/build-ci-container.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
2828
container-name-agent-tag: ${{ steps.vars.outputs.container-name-agent-tag }}
2929
container-filename: ${{ steps.vars.outputs.container-filename }}
30+
container-agent-filename: ${{ steps.vars.outputs.container-agent-filename }}
3031
steps:
3132
- name: Checkout LLVM
3233
uses: actions/checkout@v4
@@ -42,6 +43,7 @@ jobs:
4243
echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT
4344
echo "container-name-agent-tag=$container_name-agent:$tag" >> $GITHUB_OUTPUT
4445
echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
46+
echo "container-agent-filename=$(echo $container_name-agent:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
4547
- name: Build container
4648
working-directory: ./.github/workflows/containers/github-action-ci/
4749
run: |
@@ -53,13 +55,14 @@ jobs:
5355
# maintain minimal permissions while building the container.
5456
- name: Save container image
5557
run: |
56-
podman save ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name-agent-tag }} > ${{ steps.vars.outputs.container-filename }}
58+
podman save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }}
59+
podman save ${{ steps.vars.outputs.container-name-agent-tag }} > ${{ steps.vars.outputs.container-agent-filename }}
5760
5861
- name: Upload container image
5962
uses: actions/upload-artifact@v4
6063
with:
6164
name: container
62-
path: ${{ steps.vars.outputs.container-filename }}
65+
path: "*.tar"
6366
retention-days: 14
6467

6568
- name: Test Container
@@ -92,6 +95,7 @@ jobs:
9295
podman push ${{ needs.build-ci-container.outputs.container-name-tag }}
9396
podman push ${{ needs.build-ci-container.outputs.container-name }}:latest
9497
98+
podman load -i ${{ needs.build-ci-container.outputs.container-agent-filename }}
9599
podman tag ${{ needs.build-ci-container.outputs.container-name-agent-tag }} ${{ needs.build-ci-container.outputs.container-name-agent }}:latest
96100
podman push ${{ needs.build-ci-container.outputs.container-name-agent-tag }}
97101
podman push ${{ needs.build-ci-container.outputs.container-name-agent }}:latest

0 commit comments

Comments
 (0)