opendatahub-io / ai-edge

ODH integration with AI at the Edge usecases
Apache License 2.0
9 stars 19 forks source link

RHOAIENG-1119: Remove need to explicitly create imagestream #215

Closed grdryn closed 8 months ago

grdryn commented 8 months ago

JIRA: https://issues.redhat.com/browse/RHOAIENG-1119

This is a preparatory change for RHOAIENG-1119, where we want to be able to use different image registries for the candidate image that the pipeline builds.

Description

Before this change, we were explicitly creating the imagestream for the candidate image from the build task, just so that we could set the value of spec.lookupPolicy.local to true. While we could have left the imagestream to be implicitly created with default config just by pushing an image with the equivalent name, this value would not have had the desired value.

When the value of spec.lookupPolicy.local is at the default of false, then referring to an image by just <name>:<tag> without fully qualifying it with the registry domain, then it would default to the docker.io registry, and ignore the repository with that name in the internal registry in the cluster.

By setting the container image path to the fully qualified name, including the registry part (the same has how we specify it with in the parameter to the buildah task), then we don't need to care about the spec.lookupPolicy.local field, and can rely on the default creation of the ImageStream.

How Has This Been Tested?

Pipeline has been run in a new namespace, where the ImageStream didn't exist.

Merge criteria:

openshift-ci-robot commented 8 months ago

@grdryn: This pull request references RHOAIENG-2758 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](https://github.com/opendatahub-io/ai-edge/pull/215): >JIRA: https://issues.redhat.com/browse/RHOAIENG-2758 > >This is a preparatory change for [RHOAIENG-2758](https://issues.redhat.com//browse/RHOAIENG-2758), where we want to be able to use different image registries for the candidate image that the pipeline builds. > > > >## Description > > >Before this change, we were explicitly creating the imagestream for the candidate image from the build task, just so that we could set the value of `spec.lookupPolicy.local` to `true`. While we could have left the imagestream to be implicitly created with default config just by pushing an image with the equivalent name, this value would not have had the desired value. > >When the value of `spec.lookupPolicy.local` is at the default of false, then referring to an image by just `:` without fully qualifying it with the registry domain, then it would default to the `docker.io` registry, and ignore the repository with that name in the internal registry in the cluster. > >By setting the container image path to the fully qualified name, including the registry part (the same has how we specify it with in the parameter to the buildah task), then we don't need to care about the `spec.lookupPolicy.local` field, and can rely on the default creation of the ImageStream. > >## How Has This Been Tested? > > > > >Pipeline has been run in a new namespace, where the ImageStream didn't exist. > >## Merge criteria: > > > >- [x] The commits are squashed in a cohesive manner and have meaningful messages. >- [x] Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious). >- [x] The developer has manually tested the changes and verified that the changes work > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=opendatahub-io%2Fai-edge). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 8 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grdryn, MarianMacik

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: - ~~[OWNERS](https://github.com/opendatahub-io/ai-edge/blob/main/OWNERS)~~ [MarianMacik,grdryn] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment