Skip to content

Commit

Permalink
unify on a common buildah image for all tasks
Browse files Browse the repository at this point in the history
Updating the image used for the remote tasks resulted in a bump in the
buildah version. This includes
containers/common@08fc0b450 which no longer
sets the repository or tag when pulling without the optional name. To
properly populate the image in the container's registry, we need to push
and pull it with the optional name.

Signed-off-by: arewm <arewm@users.noreply.github.com>
  • Loading branch information
arewm committed Aug 15, 2024
1 parent 155e447 commit 24b12ab
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 32 deletions.
5 changes: 2 additions & 3 deletions task-generator/remote/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ if ! [[ $IS_LOCALHOST ]]; then
ret += "cd " + step.WorkingDir + "\n"
}
ret += step.Script
ret += "\nbuildah push \"$IMAGE\" oci:rhtap-final-image"
ret += "\nbuildah push \"$IMAGE\" \"oci:konflux-final-image:$IMAGE\""
ret += "\nREMOTESSHEOF"
ret += "\nchmod +x " + script + "\n"

Expand Down Expand Up @@ -253,7 +253,7 @@ if ! [[ $IS_LOCALHOST ]]; then
//sync back results
ret += "\n rsync -ra \"$SSH_HOST:$BUILD_DIR/results/\" \"/tekton/results/\""

ret += "\n buildah pull oci:rhtap-final-image"
ret += "\n buildah pull \"oci:konflux-final-image:$IMAGE\""
ret += "\nelse\n bash " + containerScript
ret += "\nfi"
ret += "\nbuildah images"
Expand All @@ -266,7 +266,6 @@ if ! [[ $IS_LOCALHOST ]]; then
}
step.Script = ret
builderImage = step.Image
step.Image = "quay.io/redhat-appstudio/multi-platform-runner:01c7670e81d5120347cf0ad13372742489985e5f@sha256:246adeaaba600e207131d63a7f706cffdcdc37d8f600c56187123ec62823ff44"
step.VolumeMounts = append(step.VolumeMounts, v1.VolumeMount{
Name: "ssh",
ReadOnly: true,
Expand Down
2 changes: 1 addition & 1 deletion task/build-image-manifest/0.1/build-image-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
- name: COMMIT_SHA
value: $(params.COMMIT_SHA)
steps:
- image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
- image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
# per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting
# the cluster will set imagePullPolicy to IfNotPresent
name: build
Expand Down
4 changes: 2 additions & 2 deletions task/buildah-oci-ta/0.1/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ spec:
- $(params.SOURCE_ARTIFACT)=/var/workdir/source
- $(params.CACHI2_ARTIFACT)=/var/workdir/cachi2
- name: build
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
args:
- $(params.BUILD_ARGS[*])
workingDir: /var/workdir
Expand Down Expand Up @@ -528,7 +528,7 @@ spec:
securityContext:
runAsUser: 0
- name: inject-sbom-and-push
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
workingDir: /var/workdir
volumeMounts:
- mountPath: /var/lib/containers
Expand Down
4 changes: 2 additions & 2 deletions task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ spec:
- $(params.SOURCE_ARTIFACT)=/var/workdir/source
- $(params.CACHI2_ARTIFACT)=/var/workdir/cachi2
- name: build
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
args:
- $(params.BUILD_ARGS[*])
workingDir: /var/workdir
Expand Down Expand Up @@ -506,7 +506,7 @@ spec:
securityContext:
runAsUser: 0
- name: inject-sbom-and-push
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
workingDir: /var/workdir
volumeMounts:
- mountPath: /var/lib/containers
Expand Down
10 changes: 5 additions & 5 deletions task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ spec:
- name: YUM_REPOS_D_TARGET
value: $(params.YUM_REPOS_D_TARGET)
- name: BUILDER_IMAGE
value: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
value: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
volumeMounts:
- mountPath: /shared
name: shared
Expand All @@ -209,7 +209,7 @@ spec:
env:
- name: COMMIT_SHA
value: $(params.COMMIT_SHA)
image: quay.io/redhat-appstudio/multi-platform-runner:01c7670e81d5120347cf0ad13372742489985e5f@sha256:246adeaaba600e207131d63a7f706cffdcdc37d8f600c56187123ec62823ff44
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: build
script: |-
#!/bin/bash
Expand Down Expand Up @@ -438,7 +438,7 @@ spec:
# Needed to generate base images SBOM
echo "$BASE_IMAGES" >/var/workdir/base_images_from_dockerfile
buildah push "$IMAGE" oci:rhtap-final-image
buildah push "$IMAGE" "oci:konflux-final-image:$IMAGE"
REMOTESSHEOF
chmod +x scripts/script-build.sh
Expand Down Expand Up @@ -478,7 +478,7 @@ spec:
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/workdir/" /var/workdir/
rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/"
buildah pull oci:rhtap-final-image
buildah pull "oci:konflux-final-image:$IMAGE"
else
bash scripts/script-build.sh
fi
Expand Down Expand Up @@ -617,7 +617,7 @@ spec:
runAsUser: 0
workingDir: /var/workdir
- computeResources: {}
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: inject-sbom-and-push
script: |
base_image_name=$(buildah inspect --format '{{ index .ImageAnnotations "org.opencontainers.image.base.name"}}' $IMAGE | cut -f1 -d'@')
Expand Down
10 changes: 5 additions & 5 deletions task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ spec:
- name: YUM_REPOS_D_TARGET
value: $(params.YUM_REPOS_D_TARGET)
- name: BUILDER_IMAGE
value: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
value: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
- name: PLATFORM
value: $(params.PLATFORM)
- name: IMAGE_APPEND_PLATFORM
Expand Down Expand Up @@ -221,7 +221,7 @@ spec:
env:
- name: COMMIT_SHA
value: $(params.COMMIT_SHA)
image: quay.io/redhat-appstudio/multi-platform-runner:01c7670e81d5120347cf0ad13372742489985e5f@sha256:246adeaaba600e207131d63a7f706cffdcdc37d8f600c56187123ec62823ff44
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: build
script: |-
#!/bin/bash
Expand Down Expand Up @@ -456,7 +456,7 @@ spec:
# Needed to generate base images SBOM
echo "$BASE_IMAGES" >/shared/base_images_from_dockerfile
buildah push "$IMAGE" oci:rhtap-final-image
buildah push "$IMAGE" "oci:konflux-final-image:$IMAGE"
REMOTESSHEOF
chmod +x scripts/script-build.sh
Expand Down Expand Up @@ -497,7 +497,7 @@ spec:
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/workdir/" /var/workdir/
rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/"
buildah pull oci:rhtap-final-image
buildah pull "oci:konflux-final-image:$IMAGE"
else
bash scripts/script-build.sh
fi
Expand Down Expand Up @@ -624,7 +624,7 @@ spec:
requests:
cpu: "1"
memory: 1Gi
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: inject-sbom-and-push
script: |
#!/bin/bash
Expand Down
10 changes: 5 additions & 5 deletions task/buildah-remote/0.1/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ spec:
- name: SKIP_UNUSED_STAGES
value: $(params.SKIP_UNUSED_STAGES)
- name: BUILDER_IMAGE
value: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
value: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
volumeMounts:
- mountPath: /shared
name: shared
Expand All @@ -197,7 +197,7 @@ spec:
env:
- name: COMMIT_SHA
value: $(params.COMMIT_SHA)
image: quay.io/redhat-appstudio/multi-platform-runner:01c7670e81d5120347cf0ad13372742489985e5f@sha256:246adeaaba600e207131d63a7f706cffdcdc37d8f600c56187123ec62823ff44
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: build
script: |-
#!/bin/bash
Expand Down Expand Up @@ -430,7 +430,7 @@ spec:
# Needed to generate base images SBOM
echo "$BASE_IMAGES" > $(workspaces.source.path)/base_images_from_dockerfile
buildah push "$IMAGE" oci:rhtap-final-image
buildah push "$IMAGE" "oci:konflux-final-image:$IMAGE"
REMOTESSHEOF
chmod +x scripts/script-build.sh
Expand Down Expand Up @@ -471,7 +471,7 @@ spec:
rsync -ra "$SSH_HOST:$BUILD_DIR/workspaces/source/" "$(workspaces.source.path)/"
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/
rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/"
buildah pull oci:rhtap-final-image
buildah pull "oci:konflux-final-image:$IMAGE"
else
bash scripts/script-build.sh
fi
Expand Down Expand Up @@ -610,7 +610,7 @@ spec:
runAsUser: 0
workingDir: $(workspaces.source.path)
- computeResources: {}
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: inject-sbom-and-push
script: |
if [ -n "${PARAM_BUILDER_IMAGE}" ]; then
Expand Down
10 changes: 5 additions & 5 deletions task/buildah-remote/0.2/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ spec:
- name: SKIP_UNUSED_STAGES
value: $(params.SKIP_UNUSED_STAGES)
- name: BUILDER_IMAGE
value: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
value: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
- name: PLATFORM
value: $(params.PLATFORM)
- name: IMAGE_APPEND_PLATFORM
Expand All @@ -203,7 +203,7 @@ spec:
env:
- name: COMMIT_SHA
value: $(params.COMMIT_SHA)
image: quay.io/redhat-appstudio/multi-platform-runner:01c7670e81d5120347cf0ad13372742489985e5f@sha256:246adeaaba600e207131d63a7f706cffdcdc37d8f600c56187123ec62823ff44
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: build
script: |-
#!/bin/bash
Expand Down Expand Up @@ -438,7 +438,7 @@ spec:
# Needed to generate base images SBOM
echo "$BASE_IMAGES" > /shared/base_images_from_dockerfile
buildah push "$IMAGE" oci:rhtap-final-image
buildah push "$IMAGE" "oci:konflux-final-image:$IMAGE"
REMOTESSHEOF
chmod +x scripts/script-build.sh
Expand Down Expand Up @@ -479,7 +479,7 @@ spec:
rsync -ra "$SSH_HOST:$BUILD_DIR/workspaces/source/" "$(workspaces.source.path)/"
rsync -ra "$SSH_HOST:$BUILD_DIR/volumes/shared/" /shared/
rsync -ra "$SSH_HOST:$BUILD_DIR/results/" "/tekton/results/"
buildah pull oci:rhtap-final-image
buildah pull "oci:konflux-final-image:$IMAGE"
else
bash scripts/script-build.sh
fi
Expand Down Expand Up @@ -606,7 +606,7 @@ spec:
requests:
cpu: "1"
memory: 1Gi
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: inject-sbom-and-push
script: |
#!/bin/bash
Expand Down
4 changes: 2 additions & 2 deletions task/buildah/0.1/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ spec:
value: $(params.SKIP_UNUSED_STAGES)

steps:
- image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
- image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: build
computeResources:
limits:
Expand Down Expand Up @@ -491,7 +491,7 @@ spec:
runAsUser: 0

- name: inject-sbom-and-push
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
computeResources: {}
script: |
if [ -n "${PARAM_BUILDER_IMAGE}" ]; then
Expand Down
4 changes: 2 additions & 2 deletions task/buildah/0.2/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ spec:
value: $(params.SKIP_UNUSED_STAGES)

steps:
- image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
- image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
name: build
computeResources:
limits:
Expand Down Expand Up @@ -455,7 +455,7 @@ spec:
runAsUser: 0

- name: inject-sbom-and-push
image: quay.io/konflux-ci/buildah:latest@sha256:7cb5a35b7fe44e397fbf3b834f3bd8dcd9403a7c0a0b51469e6ec75b107d0846
image: quay.io/konflux-ci/buildah-task:latest@sha256:5d933087a49a6e0b959b9a9fa5a91d545380217e565d7be7cc74a9588f64c314
computeResources:
limits:
memory: 4Gi
Expand Down

0 comments on commit 24b12ab

Please sign in to comment.