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
Add tooling for publishing OpenShift kubebuilder tools #1774
Add tooling for publishing OpenShift kubebuilder tools #1774
Conversation
Skipping CI for Draft Pull Request. |
/test integration |
Hello @JoelSpeed! Some important instructions when contributing to openshift/api: |
/test integration |
|
||
.PHONY: publish-kubebuilder-tools | ||
publish-kubebuilder-tools: | ||
go run ./publish-kubebuilder-tools/main.go -version 1.29.1 -output-dir /tmp/kubebuilder-tools -payload=registry.ci.openshift.org/ocp/release:4.16.0-0.ci-2024-02-20-022620 -pull-secret $(PULL_SECRET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if memory serves, there's some way to have a repo build produce a change to an imagestream. I'm ok with some ugliness to get our current problem resolved, but a thing to consider for a future update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a suggestion for automating this? Typically we only update the artifacts version once a release, so given this needs to be run circa 3 times a year, I didn't see too much point investing in further automation, but if you think it would be better to release more frequently, I can look into that.
} | ||
|
||
// We only expect images from the internal releases | ||
if *payload == "" || !strings.HasPrefix(*payload, "registry.ci.openshift.org/ocp/release:") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is talk of removing our internal registry. Do we have a fall-back that mostly works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could update it to use any registry I guess, I just made some assumptions here that people would always use a nightly. Any timeline for that?
tests/Makefile
Outdated
@@ -8,7 +8,7 @@ integration: verify-vendor test | |||
|
|||
.PHONY: test | |||
test: ## Run only the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have the old version of this as a different target? Say test-legacy
or test-upstream
or some such? When this breaks, I'd like to get our repo mostly unstuck quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
flag.Parse() | ||
|
||
if *pullSecretFile == "" { | ||
panic("pull-secret is required") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give me a hint for how to create this. Do I log into a CI cluster and do the oc registry login
thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note to the makefile where this is being called
|
||
func main() { | ||
pullSecretFile := flag.String("pull-secret", "", "The pull secret to use for the kubebuilder tools") | ||
version := flag.String("version", "", "The version of the kubebuilder tools to publish. This should be a Kubernetes version that the build is based upon.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it include z-streams or not?
tests/Makefile
Outdated
@@ -8,7 +8,7 @@ integration: verify-vendor test | |||
|
|||
.PHONY: test | |||
test: ## Run only the tests. | |||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(PROJECT_DIR)/bin)" ./hack/test.sh | |||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(PROJECT_DIR)/bin --remote-bucket openshift-kubebuilder-tools)" ./hack/test.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can I get a comment with a link to the docs for whatever command has this --remote-bucket arg so should you win the lottery I have some shot at reverse engineering how it works. :)
I understand the goal. I think it'll be fragile over time. I'm ok doing this to resolve our initial problem, but in three releases or so we should try to collapse back. Some comments. I'd like the legacy-test target created for a rapid fallback. /lgtm @JoelSpeed your credit in the area is good. Your call on IOU or pre-merge. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, JoelSpeed 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 |
@JoelSpeed: all tests passed! 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/test-infra repository. I understand the commands that are listed here. |
Envtest, a testing suite used in openshift/api and most controller-runtime based operators leverages archives from a GCS bucket to provide etcd and KAS binaries for local and integration testing.
As of 4.16, we are carrying patches in KAS that bring some upstream API features into OpenShift ahead of their general release in KAS, specifically the CEL net.IP and net.CIDR extensions.
To leverage these, both o/api and others will need binaries provided to be able to test CRDs leveraging these extensions.
This PR adds a go tool/script that extracts the binaries from a payload image, creates the required archives and then uploads them to an openshift GCS bucket.
We will need to run this periodically to create new releases when new binaries are needed, circa once a release.
We may also deprecate support for this when the API features reconverge (4.18), but it's worth keeping the tooling and setup around in case we need to leverage it again in the future