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

NO-JIRA: fix(build): use yq to modify kustomization.yaml during deploy targets #828

Conversation

andyatmiami
Copy link
Contributor

Description

The current method of using sed to modify kustomization.yaml when running the deploy9- Makefile target runs into issues if the developer workstation is on MacOS.

Given the intended behavior here is to swap out a couple values in the yaml file - this PR adds yq as a self-contained dependency to the Makefile to handle this yaml modification.

The bin/yq target added to Makefile follows the existing conventions established around the bin/kubectl handling within the Makefile.

How Has This Been Tested?

I implemented this fix as part of my efforts working on RHOAING-12822 which is documented in part here:

I have been able to successfully deploy multiple workbench image files while running this fix. Running any deploy9- or deploy-c9s target will invoke the modified code.

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

The current method of using `sed` to modify `kustomization.yaml` when running the `deploy9-` `Makefile` target runs into issues if the developer workstation is on MacOS.

Given the intended behavior here is to swap out a couple values in the `yaml` file - this PR adds `yq` as a self-contained dependency to the `Makefile` to handle this `yaml` modification.

The `bin/yq` target added to `Makefile` follows the existing conventions established around the `bin/kubectl` handling within the `Makefile`.
@openshift-ci openshift-ci bot requested review from atheo89 and caponetto January 6, 2025 21:00
@@ -285,17 +287,28 @@ ifeq (,$(wildcard $(KUBECTL_BIN)))
@chmod +x $(KUBECTL_BIN)
endif

# Download yq binary
.PHONY: bin/yq
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One point of interest here (as this merely follows the pattern established from bin/kubectl) ...

I wonder if we should actually NOT declare a .PHONY target here? as the bin/yq (and likewise bin/kubectl) are actual files on the filesystem... such that we could simply allow make to do what it does ?

pros:

  • wouldn't run and download "stuff" on every invocation

cons:

  • users would ned to manually intervene if we needed to upgrade the version of the binary we pull down

@jiridanek
Copy link
Member

/lgtm

@jiridanek
Copy link
Member

I wonder if we should actually NOT declare a .PHONY target here? as the bin/yq (and likewise bin/kubectl) are actual files on the filesystem... such that we could simply allow make to do what it does ?

Subsequent PR, maybe? and change in both places? IMO its phony because somebody did not want to deal with Makefile details and just used it as task runner

@jstourac
Copy link
Member

jstourac commented Jan 7, 2025

/lgtm

@andyatmiami
Copy link
Contributor Author

/test notebook-rocm-jupyter-pyt-ubi9-python-3-11-pr-image-mirror

@jiridanek
Copy link
Member

/lgtm

@andyatmiami
Copy link
Contributor Author

@daniellutz had raised a concern that introducing yq here could necessitate additional paperwork documenting yq as a "build tool" to satisfy IBM/RH policies and processes.

In discussion during scrum - @harshad16 stated that while we are on ci-operator - this is not an issue. While it WILL be more of a "front of mind" concern when we move to Konflux - for the time being we can proceed with this change.

@andyatmiami
Copy link
Contributor Author

/override ci/prow/images

Copy link
Contributor

openshift-ci bot commented Jan 9, 2025

@andyatmiami: Overrode contexts on behalf of andyatmiami: ci/prow/images

In response to this:

/override ci/prow/images

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.

@andyatmiami
Copy link
Contributor Author

/approve

Copy link
Contributor

openshift-ci bot commented Jan 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyatmiami

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 openshift-ci bot added the approved label Jan 9, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 8a24d01 into opendatahub-io:main Jan 9, 2025
8 checks passed
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.

3 participants