Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRVCOM-3319: Generate CSV with Konflux images (serving, eventing, operator) #2827

Merged
merged 12 commits into from
Oct 2, 2024

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Sep 2, 2024

No description provided.

Copy link
Contributor

openshift-ci bot commented Sep 2, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the approved label Sep 2, 2024
Comment on lines 159 to 196
function latest_konflux_image_sha() {
input=${1:?"Provide image"}

image_without_tag=${input%:*} # Remove tag, if any
image_without_tag=${image_without_tag%@*} # Remove sha, if any

# TODO uncomment, exit with error
# digest=$(docker manifest inspect "${image_without_tag}:latest" -v | jq '.Descriptor.digest')
digest=''
if [ "${digest}" = "" ]; then
# exit 1
echo "${image_without_tag}:latest"
return
fi

echo "${image_without_tag}@${digest}"
}
Copy link
Member Author

@pierDipi pierDipi Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix TODO once we are on 1.35 and we have serving, eventing, and SO built with Konflux

@pierDipi pierDipi changed the title Generate CSV with Konflux images (serving and eventing) Generate CSV with Konflux images (serving, eventing, operator) Sep 2, 2024
if ! grep "${bundle}" "${rootdir}/${index_dorkerfile_path}"; then
logger.error "Bundle ${bundle} not found in Dockerfile."
return 1
fi
sed -i "s_\(.*\)\(${bundle}\)\(.*\)_\1image-registry.openshift-image-registry.svc:5000/$OLM_NAMESPACE/serverless-bundle:latest\3_" "${rootdir}/${index_dorkerfile_path}"
sed -ri "s#(.*)(${bundle})(:[a-z0-9]*)?(@sha[0-9]+:[a-z0-9]+)?(.*)#\1image-registry.openshift-image-registry.svc:5000/${OLM_NAMESPACE}/serverless-bundle:latest\5#" "${rootdir}/${index_dorkerfile_path}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with:

$ bundle="quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-release-134/serverless-bundle"
$ sed -r "s#(.*)(${bundle})(:[a-z0-9]*)?(@sha[0-9]+:[a-z0-9]+)?(.*)#\1image-registry.openshift-image-registry.svc:5000/<namespace>/serverless-bundle:latest\5#" olm-catalog/serverless-operator/index/Dockerfile
FROM registry.ci.openshift.org/origin/4.15:operator-registry AS opm

FROM registry.access.redhat.com/ubi9/ubi-minimal as builder

COPY --from=opm /bin/opm /bin/opm

COPY olm-catalog/serverless-operator/index/configs /configs

RUN /bin/opm init serverless-operator --default-channel=stable --output yaml >> /configs/index.yaml
RUN /bin/opm render --skip-tls-verify -o yaml \
quay.io/openshift-knative/serverless-bundle:release-1.32.0 \
registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \
      registry.ci.openshift.org/knative/release-1.34.0:serverless-bundle >> /configs/index.yaml || \
    /bin/opm render --skip-tls-verify -o yaml \
quay.io/openshift-knative/serverless-bundle:release-1.32.0 \
registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \
      image-registry.openshift-image-registry.svc:5000/<namespace>/serverless-bundle:latest >> /configs/index.yaml

FROM registry.ci.openshift.org/origin/4.15:operator-registry

COPY --from=builder /configs /configs

LABEL operators.operatorframework.io.index.configs.v1=/configs

ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs"]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is for matching:

  1. (.*) match starting spaces and anything else until the next match
  2. (${bundle}) match the bundle image without tag or sha
  3. (:[a-z0-9]*)? optionally match tag
  4. (@sha[0-9]+:[a-z0-9]+)? optionally match sha
  5. (.*) match the rest

Replace:

  1. \1 Use everything matched by 1
  2. image-registry.openshift-image-registry.svc:5000/${OLM_NAMESPACE}/serverless-bundle:latest replace the image
  3. \5 use everything matched by 5

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@pierDipi pierDipi changed the title Generate CSV with Konflux images (serving, eventing, operator) [WIP] Generate CSV with Konflux images (serving, eventing, operator) Sep 2, 2024
hack/lib/images.bash Outdated Show resolved Hide resolved
Tested with:

```
$ bundle="quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-release-134/serverless-bundle"
$ sed -r "s#(.*)(${bundle})(:[a-z0-9]*)?(@sha[0-9]+:[a-z0-9]+)?(.*)#\1image-registry.openshift-image-registry.svc:5000/<namespace>/serverless-bundle:latest\5#" olm-catalog/serverless-operator/index/Dockerfile
FROM registry.ci.openshift.org/origin/4.15:operator-registry AS opm

FROM registry.access.redhat.com/ubi9/ubi-minimal as builder

COPY --from=opm /bin/opm /bin/opm

COPY olm-catalog/serverless-operator/index/configs /configs

RUN /bin/opm init serverless-operator --default-channel=stable --output yaml >> /configs/index.yaml
RUN /bin/opm render --skip-tls-verify -o yaml \
quay.io/openshift-knative/serverless-bundle:release-1.32.0 \
registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \
      registry.ci.openshift.org/knative/release-1.34.0:serverless-bundle >> /configs/index.yaml || \
    /bin/opm render --skip-tls-verify -o yaml \
quay.io/openshift-knative/serverless-bundle:release-1.32.0 \
registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \
      image-registry.openshift-image-registry.svc:5000/<namespace>/serverless-bundle:latest >> /configs/index.yaml

FROM registry.ci.openshift.org/origin/4.15:operator-registry

COPY --from=builder /configs /configs

LABEL operators.operatorframework.io.index.configs.v1=/configs

ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs"]
```

Signed-off-by: Pierangelo Di Pilato <[email protected]>
Signed-off-by: Pierangelo Di Pilato <[email protected]>
Signed-off-by: Pierangelo Di Pilato <[email protected]>
@pierDipi
Copy link
Member Author

/test 416-operator-e2e-aws-416
/test 416-images

Signed-off-by: Pierangelo Di Pilato <[email protected]>
@pierDipi
Copy link
Member Author

/test 416-operator-e2e-aws-416
/test 416-images

1 similar comment
@pierDipi
Copy link
Member Author

/test 416-operator-e2e-aws-416
/test 416-images

skopeo because, Podman doesn't work, Docker needs DinD in CI.

Signed-off-by: Pierangelo Di Pilato <[email protected]>
@pierDipi pierDipi changed the title [WIP] Generate CSV with Konflux images (serving, eventing, operator) Generate CSV with Konflux images (serving, eventing, operator) Sep 30, 2024
@pierDipi pierDipi changed the title Generate CSV with Konflux images (serving, eventing, operator) SRVCOM-3319: Generate CSV with Konflux images (serving, eventing, operator) Sep 30, 2024
@openshift-ci-robot
Copy link

@pierDipi: This pull request references SRVCOM-3319 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@pierDipi
Copy link
Member Author

/test 416-upstream-e2e-kafka-aws-416

@pierDipi
Copy link
Member Author

pierDipi commented Oct 1, 2024

/test 416-test-upgrade-aws-416

Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ k -n knative-eventing get po eventing-controller-5dcb8787-4d4jb -ojsonpath='{.spec.containers[*].image}'
quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-135/kn-eventing-controller@sha256:221b032b42a451896b2f73530b327934c8d662a67a6ea3b1e1e8bcfecd1a666f registry.ci.openshift.org/origin/4.15:kube-rbac-proxy

/lgtm

export GOPATH="$PATH:$go_bin"
digest=$(skopeo inspect "docker://${image_without_tag}:latest" | jq -r '.Digest')
if [ "${digest}" = "" ]; then
exit 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: print the reason for the exit (can be done as a follow up)

Copy link
Contributor

openshift-ci bot commented Oct 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 7e578e6 and 2 for PR HEAD db10a4b in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 7e578e6 and 2 for PR HEAD db10a4b in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD ad83047 and 2 for PR HEAD db10a4b in total

2 similar comments
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD ad83047 and 2 for PR HEAD db10a4b in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD ad83047 and 2 for PR HEAD db10a4b in total

Copy link
Contributor

openshift-ci bot commented Oct 2, 2024

@pierDipi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/416-test-upgrade-aws-416 db10a4b link true /test 416-test-upgrade-aws-416

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD ad83047 and 2 for PR HEAD db10a4b in total

@pierDipi
Copy link
Member Author

pierDipi commented Oct 2, 2024

FAIL test/upgrade.TestServerlessUpgradePrePost/Run/Steps/PostUpgradeTests/Verify_jobs_in_knative-serving (-1.00s)

=== Failed
=== FAIL: test/upgrade  (0.00s)
panic: test timed out after 1h30m0s
running tests:
	TestServerlessUpgradePrePost (1h30m0s)
	TestServerlessUpgradePrePost/Run/Steps (1h27m38s)
	TestServerlessUpgradePrePost/Run/Steps/PostUpgradeTests (1h26m38s)
	TestServerlessUpgradePrePost/Run/Steps/PostUpgradeTests/Verify_jobs_in_knative-serving (1h26m38s)

goroutine 2732 [running]:
testing.(*M).startAlarm.func1()
	/usr/lib/golang/src/testing/testing.go:2366 +0x265
created by time.goFunc
	/usr/lib/golang/src/time/sleep.go:177 +0x45

@pierDipi
Copy link
Member Author

pierDipi commented Oct 2, 2024

It doesn't seem related

@pierDipi pierDipi merged commit a28da85 into openshift-knative:main Oct 2, 2024
14 of 16 checks passed
@pierDipi pierDipi deleted the konflux-csv branch October 2, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants