Skip to content

Commit

Permalink
Fix image namespacing for cp41
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-dolby-at-ibm-com committed Nov 20, 2024
1 parent 1b65909 commit 3762779
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 23 deletions.
14 changes: 5 additions & 9 deletions tekton/os/cp4i/12-ibmint-cp4i-build-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ spec:
value: "accept"
- name: APP_NAME
value: $(params.appName)
- name: APP_NAMESPACE
value: $(params.appNamespace)
params:
- name: outputRegistry
type: string
- name: appName
type: string
- name: appNamespace
type: string
- name: url
type: string
- name: revision
Expand Down Expand Up @@ -151,9 +147,9 @@ spec:
set -e # Fail on error
set -x
crane append -b $(params.runtimeBaseImage) -f /work/ibmint-output/crane-append-file.tar.gz \
-t $(params.outputRegistry)/$APP_NAMESPACE/$APP_NAME:$TAG
-t $(params.outputRegistry)/$APP_NAME:$TAG
crane digest $(params.outputRegistry)/$APP_NAMESPACE/$APP_NAME:$TAG | tr -d '\n' >> $(results.sha.path)
crane digest $(params.outputRegistry)/$APP_NAME:$TAG | tr -d '\n' >> $(results.sha.path)
volumeMounts:
- mountPath: /work
name: work
Expand Down Expand Up @@ -252,10 +248,10 @@ spec:
echo ========================================================================
set -e # Fail on error
set -x
crane append -b $(params.outputRegistry)/$APP_NAMESPACE/$APP_NAME:$TAG -f /work/ibmint-output/crane-append-file-ct.tar.gz \
-t $(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}-ct:$TAG
crane append -b $(params.outputRegistry)/$APP_NAME:$TAG -f /work/ibmint-output/crane-append-file-ct.tar.gz \
-t $(params.outputRegistry)/${APP_NAME}-ct:$TAG
crane digest $(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}-ct:$TAG | tr -d '\n' >> $(results.ctsha.path)
crane digest $(params.outputRegistry)/${APP_NAME}-ct:$TAG | tr -d '\n' >> $(results.ctsha.path)
volumeMounts:
- mountPath: /work
name: work
Expand Down
17 changes: 8 additions & 9 deletions tekton/os/cp4i/12-maven-cp4i-build-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ spec:
value: "/tekton/home"
- name: APP_NAME
value: $(params.appName)
- name: APP_NAMESPACE
value: $(params.appNamespace)
params:
- name: outputRegistry
type: string
- name: appName
type: string
- name: appNamespace
type: string
- name: url
type: string
- name: revision
Expand Down Expand Up @@ -123,10 +119,10 @@ spec:
echo Using $TAG as image tag
buildah --storage-driver=overlay bud --format=oci --tls-verify=false --no-cache \
--build-arg BASE_IMAGE=$(params.runtimeBaseImage) \
-f /work/maven-output/Dockerfile -t $(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}:$TAG /work/maven-output
-f /work/maven-output/Dockerfile -t $(params.outputRegistry)/${APP_NAME}:$TAG /work/maven-output
date
buildah --storage-driver=overlay push --tls-verify=false --digestfile /tmp/image-digest \
$(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}:$TAG "docker://$(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}:$TAG"
$(params.outputRegistry)/${APP_NAME}:$TAG "docker://$(params.outputRegistry)/${APP_NAME}:$TAG"
echo image digest:
cat /tmp/image-digest && echo
cat /tmp/image-digest >> $(results.sha.path)
Expand Down Expand Up @@ -206,11 +202,11 @@ spec:
export TAG=`cat $(results.tag.path)`
echo Using $TAG as image tag
buildah --storage-driver=overlay bud --format=oci --tls-verify=false --no-cache \
--build-arg BASE_IMAGE=$(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}:$TAG \
-f /work/maven-output/Dockerfile -t $(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}-ct:$TAG /work/maven-output
--build-arg BASE_IMAGE=$(params.outputRegistry)/${APP_NAME}:$TAG \
-f /work/maven-output/Dockerfile -t $(params.outputRegistry)/${APP_NAME}-ct:$TAG /work/maven-output
date
buildah --storage-driver=overlay push --tls-verify=false --digestfile /tmp/image-digest \
$(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}-ct:$TAG "docker://$(params.outputRegistry)/$APP_NAMESPACE/${APP_NAME}-ct:$TAG"
$(params.outputRegistry)/${APP_NAME}-ct:$TAG "docker://$(params.outputRegistry)/${APP_NAME}-ct:$TAG"
echo image digest:
cat /tmp/image-digest && echo
cat /tmp/image-digest >> $(results.ctsha.path)
Expand All @@ -229,6 +225,9 @@ spec:
#
# Default buildah approach using emptyDir; takes about 2 minutes on a test SNO cluster
#
# Note that "medium: Memory" does not appear to work with buildah:
# Unmounting /var/lib/containers/storage/overlay/36ecafc52379cb274be07f42e9da48895781369bb00b1bf35e8e37399557938b/merged: invalid argument
#
- name: varlibcontainers
emptyDir: {}
#
Expand Down
2 changes: 1 addition & 1 deletion tekton/os/cp4i/13-component-test-in-cp4i-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
export SHA=$(params.ctsha)
export TAG=$(params.tag)
export TARGET_IMAGE=$DOCKER_REGISTRY/$APP_NAMESPACE/${APP_NAME}-ct:$TAG@$SHA
export TARGET_IMAGE=$DOCKER_REGISTRY/${APP_NAME}-ct:$TAG@$SHA
echo "Using $TARGET_IMAGE as image placeholder"
sed -i "s|IR_IMAGE_PLACEHOLDER|$TARGET_IMAGE|g" /work/ace-demo-pipeline/tekton/os/cp4i/*.yaml
Expand Down
2 changes: 1 addition & 1 deletion tekton/os/cp4i/22-deploy-to-cp4i-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
export SHA=$(params.sha)
export TAG=$(params.tag)
export TARGET_IMAGE=$DOCKER_REGISTRY/$APP_NAMESPACE/$APP_NAME:$TAG@$SHA
export TARGET_IMAGE=$DOCKER_REGISTRY/$APP_NAME:$TAG@$SHA
echo "Using $TARGET_IMAGE as image placeholder"
sed -i "s|IR_IMAGE_PLACEHOLDER|$TARGET_IMAGE|g" /work/ace-demo-pipeline/tekton/os/cp4i/*.yaml
Expand Down
2 changes: 1 addition & 1 deletion tekton/os/cp4i/cp4i-pipeline-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
name: cp4i-pipeline
params:
- name: dockerRegistry
value: "image-registry.openshift-image-registry.svc.cluster.local:5000"
value: "image-registry.openshift-image-registry.svc.cluster.local:5000/cp4i"
# Minikube
#value: "192.168.49.2:5000/default"
- name: appName
Expand Down
2 changes: 0 additions & 2 deletions tekton/os/cp4i/cp4i-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ spec:
value: $(params.dockerRegistry)
- name: appName
value: $(params.appName)
- name: appNamespace
value: $(params.appNamespace)
- name: url
value: $(params.url)
- name: revision
Expand Down

0 comments on commit 3762779

Please sign in to comment.