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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRVCLI-401: 馃巵 Add kn-event configuration #154

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

cardil
Copy link
Member

@cardil cardil commented May 9, 2024

Changes

  • 馃巵 Add kn-event configuration

Fixes SRVCLI-401

Here's the current config diff for kn-event: https://gist.github.com/cardil/adedaf1313446a6329fb9a958670198a (I'll keep it updated)

@openshift-ci openshift-ci bot requested review from aliok and pierDipi May 9, 2024 15:52
Copy link

openshift-ci bot commented May 9, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cardil
Once this PR has been reviewed and has the lgtm label, please assign skonto for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@cardil cardil marked this pull request as draft May 9, 2024 15:53
@cardil cardil changed the title 馃巵 Add kn-event configuration [WIP] 馃巵 Add kn-event configuration May 9, 2024
@cardil cardil changed the title [WIP] 馃巵 Add kn-event configuration [WIP] 馃巵 SRVCLI-401 Add kn-event configuration May 9, 2024
@cardil cardil changed the title [WIP] 馃巵 SRVCLI-401 Add kn-event configuration [WIP] SRVCLI-401: 馃巵 Add kn-event configuration May 9, 2024
@openshift-ci-robot
Copy link

@cardil: This pull request references SRVCLI-401 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 story to target the "4.16.0" version, but no target version was set.

In response to this:

Changes

  • 馃巵 Add kn-event configuration

Fixes SRVCLI-401

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.

@cardil
Copy link
Member Author

cardil commented May 9, 2024

/kind enhancement

@openshift-ci openshift-ci bot added the kind/enhancement New feature or request label May 9, 2024
@cardil
Copy link
Member Author

cardil commented May 10, 2024

repositories:
- org: openshift-knative
repo: kn-plugin-event
imagePrefix: client-plugin-event

Choose a reason for hiding this comment

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

It's a bit nit picking, but I wonder how the final names is generated from all those values. Is it going too verbose? I'd keep kn-plugin-event here. Wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is how they used to be called: https://github.com/openshift/release/blob/a45d8237303d117149c08a5c4c56a558fd62dfbf/ci-operator/config/openshift-knative/kn-plugin-event/openshift-knative-kn-plugin-event-release-next__415.yaml#L74-L79

However, I don't know if I'll be able to keep the current naming, and will be force to adjust kn-event to follow hack's machinery.

This is what I am currently getting (WIP):

     test:
     - as: test
+      cli: latest
       commands: openshift/e2e-tests.sh
       dependencies:
-      - env: TEST_IMAGES_EVENTSHUB
+      - env: CLIENT_PLUGIN_EVENT_BUILD_IMAGE
+        name: client-plugin-event-build-image
+      - env: CLIENT_PLUGIN_EVENT_SENDER
+        name: client-plugin-event-sender
+      - env: CLIENT_PLUGIN_EVENT_SOURCE_IMAGE
+        name: client-plugin-event-source-image
+      - env: CLIENT_PLUGIN_EVENT_TEST_EVENTSHUB
         name: client-plugin-event-test-eventshub
-      - env: TEST_IMAGES_WATHOLA_FORWARDER
+      - env: CLIENT_PLUGIN_EVENT_TEST_WATHOLA_FORWARDER
         name: client-plugin-event-test-wathola-forwarder
-      - env: IMAGES_KN_EVENT_SENDER
-        name: client-plugin-event-sender
-      from: src
+      from: client-plugin-event-source-image
       resources:
         requests:
           cpu: 100m
       timeout: 30m0s

Copy link
Member Author

Choose a reason for hiding this comment

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

Here's a full diff, if you're interested: https://gist.github.com/cardil/adedaf1313446a6329fb9a958670198a

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the diff above. I think it's acceptable to proceed.

The naming thing. Yes, we could proceed with an image prefix of kn-plugin-event, however:

So, we can change the image prefix to kn-plugin-event, but I'm a bit reluctant due to the above points.

Comment on lines 21 to 24
binaryBuildCommands: |-
export HOME=/tmp
export TEST_IMAGES_DIR=/usr/bin
./mage build

Choose a reason for hiding this comment

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

In case of client, I've been looking at this stanza and my thought's been to wrap it into Dockerfile stage build to simplify CI config. Similarly to Makefile PR in the kn-plugin-event midstream, but also execute the make withing Docker builds.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is how Openshift CI advises building binaries in a separate step, and later use the bin image contents, while building the images.

Since then, most Serverless repos moved to pure Docker approach, when the bin building doesn't matter, as everything is done in the build image step: https://github.com/openshift-knative/serving/blob/release-next/openshift/ci-operator/knative-images/activator/Dockerfile

IDK, if I keep kn-event current setup or shift it to how other repos does this. I'm leaning towards the pure Dockerfile approach.

Copy link
Member Author

@cardil cardil Jun 18, 2024

Choose a reason for hiding this comment

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

I decided to keep the current approach, as I managed to change the code to support both ways. Also, the current kn-event's approach may be better for multi-arch builds in Openshift CI. The current CI setup for kn-event works, and changing it just for the sake of bringing it on par with other repos seems pointless.

Still, maybe, I'll follow up the kn-event to add a Makefile target that detects Openshift CI environment and sets proper environment variables.

Comment on lines +300 to +301
env:
SKIP_MESH_AUTH_POLICY_GENERATION: "true"

Choose a reason for hiding this comment

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

Is it related to work on event plugin? Would it make more sense to check in S-O Makefile if PROW and based on that define defaults skips? Maybe we will need more skips in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a rather messy env var introduced in #77

Now, it is added to every command. I didn't like that, so I added support for defining the environmental variables.

I believe this variable makes sense only in terms of S-O, that's why I added it just to its config. Is it right, @skonto?

generate-ci-no-clean: generate-eventing-ci generate-serving-ci generate-serverless-operator-ci
.PHONY: generate-ci-no-clean

generate-eventing-ci:

Choose a reason for hiding this comment

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

These cmd name changes will most likely break GitHub actions that execute generators periodically.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll update the workflows in this repo. Are you aware of other cross-repo references to those targets?

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 actions are updated, and I restored those targets, as deprecated (they print a warn box when used).

Choose a reason for hiding this comment

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

I'd defer name change to @mgencur or @pierDipi to chime in here.
I'm not a huge fan to carry this change within "add config" PR, because it doesn't seem to me as necessary for adding event plugin config.

@openshift-ci-robot
Copy link

@cardil: This pull request references SRVCLI-401 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 story to target the "4.16.0" version, but no target version was set.

In response to this:

Changes

  • 馃巵 Add kn-event configuration

Fixes SRVCLI-401

Here's the current config diff for kn-event: https://gist.github.com/cardil/adedaf1313446a6329fb9a958670198a (I'll keep it updated)

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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase The PR needs to have conflicts fixed label Jun 18, 2024
**Conflicts fixed:**

 - pkg/prowgen/prowgen.go
 - pkg/prowgen/prowgen_images_discovery.go
@openshift-merge-robot openshift-merge-robot added needs-rebase The PR needs to have conflicts fixed and removed needs-rebase The PR needs to have conflicts fixed labels Jun 18, 2024
@cardil cardil force-pushed the feature/kn-event branch 4 times, most recently from 36fd7a7 to f076418 Compare June 18, 2024 18:54
@openshift-merge-robot openshift-merge-robot removed the needs-rebase The PR needs to have conflicts fixed label Jun 18, 2024
@cardil cardil marked this pull request as ready for review June 18, 2024 19:27
@openshift-ci openshift-ci bot requested review from rhuss and skonto June 18, 2024 19:27
@cardil cardil changed the title [WIP] SRVCLI-401: 馃巵 Add kn-event configuration SRVCLI-401: 馃巵 Add kn-event configuration Jun 18, 2024
@cardil cardil requested a review from dsimansk June 18, 2024 19:30
@cardil
Copy link
Member Author

cardil commented Jun 19, 2024

/hold

Let me provide the full diff, for all the components...

EDIT: The gist now contains the full diff, of all the components: https://gist.github.com/cardil/adedaf1313446a6329fb9a958670198a

The diff needs to be reviewed...

ImagePrefix string `json:"imagePrefix,omitempty" yaml:"imagePrefix,omitempty"`
ImageNameOverrides map[string]string `json:"imageNameOverrides,omitempty" yaml:"imageNameOverrides,omitempty"`
SlackChannel string `json:"slackChannel,omitempty" yaml:"slackChannel,omitempty"`
CanonicalGoRepository *string `json:"canonicalGoRepository,omitempty" yaml:"canonicalGoRepository,omitempty"`
E2ETests []E2ETest `json:"e2e,omitempty" yaml:"e2e,omitempty"`
Dockerfiles Dockerfiles `json:"dockerfiles,omitempty" yaml:"dockerfiles,omitempty"`
BaseImages map[string]cioperatorapi.ImageStreamTagReference `json:"baseImages,omitempty" yaml:"baseImages,omitempty"`
SharedInputs map[string]cioperatorapi.ImageBuildInputs `json:"sharedInputs,omitempty" yaml:"sharedInputs,omitempty"`

Choose a reason for hiding this comment

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

Wouldn't it make sense to keep variable name as per CI operator API, ImageBuildInputs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I can name it ImageBuildInputs although the shared aspect differs here from CI operator API.

In CI operator API, the ImageBuildInputs is used for a specific image. Here, I'm using that do add common, provided upfront inputs for all images from a given repo.

I could name it SharedImageBuildInputs, but isn't that too mouthful?

Org string
Repo string
Tag string
Digest string

Choose a reason for hiding this comment

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

Why is digest needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't use it currently, which doesn't mean at any point such image reference might be used in one of Dockerfiles.

cardil and others added 4 commits June 19, 2024 13:52
Conflicts fixed:

 - Makefile
 - pkg/prowgen/prowgen.go
Co-authored-by: David Simansky <dsimansk@redhat.com>
@openshift-merge-robot openshift-merge-robot added the needs-rebase The PR needs to have conflicts fixed label Jun 20, 2024
@openshift-merge-robot
Copy link

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold kind/enhancement New feature or request needs-rebase The PR needs to have conflicts fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants