-
Notifications
You must be signed in to change notification settings - Fork 223
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
MGMT-7705: Use os_images in deploy/operator scripts #2708
MGMT-7705: Use os_images in deploy/operator scripts #2708
Conversation
/retest-required |
1 similar comment
/retest-required |
tools/handle_ocp_versions.py
Outdated
|
||
if release_images != None: |
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 release_images != None: | |
if release_images is not None: |
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.
done
tools/handle_ocp_versions.py
Outdated
if bool(args.single_version_only): | ||
print("Using only single version of the RHCOS ISO", file=sys.stderr) | ||
ocp_versions = update_openshift_versions_hashmap_to_single_only(ocp_versions, args.ocp_override) | ||
verify_ocp_versions(ocp_versions, None) |
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.
verify_ocp_versions(ocp_versions, None) | |
verify_ocp_versions(ocp_versions, release_images=None) |
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.
done
@@ -51,7 +51,7 @@ def get_deployment_tag(args): | |||
|
|||
def main(): | |||
utils.verify_build_directory(deploy_options.namespace) | |||
verify_ocp_versions(json.loads(json.loads('"{}"'.format(deploy_options.ocp_versions)))) | |||
verify_ocp_versions(None, json.loads(json.loads('"{}"'.format(deploy_options.release_images)))) |
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.
verify_ocp_versions(None, json.loads(json.loads('"{}"'.format(deploy_options.release_images)))) | |
verify_ocp_versions(ocp_versions=None, release_images=json.loads(json.loads('"{}"'.format(deploy_options.release_images)))) |
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.
done
cmd/main.go
Outdated
@@ -203,10 +203,11 @@ func main() { | |||
|
|||
var openshiftVersionsMap models.OpenshiftVersions | |||
if Options.OpenshiftVersions == "" { | |||
log.Fatal("OpenShift versions is empty") | |||
log.Info("OpenShift versions is empty - using OsImages and ReleaseImages") |
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.
log.Info("OpenShift versions is empty - using OsImages and ReleaseImages") | |
log.Info("OpenShift versions is empty - using default values for OS and release images") |
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.
It's not necessarily the default values... as os_images/release_images can still be specified. But I'll rephrase to make it clearer.
ifndef RELEASE_IMAGES | ||
ifndef OS_IMAGES |
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.
what will happen if user overrides OS_IMAGES
and not RELEASE_IMAGES
?
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.
That's the kube-api flow, i.e. specifying only OS_IMAGES. So we handle it in line 120.
1e14668
to
56d6a33
Compare
openshiftVersions := h.GetOpenshiftVersions() | ||
if len(openshiftVersions) == 0 { | ||
return errors.Errorf("No OS images are available") | ||
} |
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.
Do we want to allow deploying the operator without any versions and add them in runtime?
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.
So we can add only release images in runtime, the os images must exist on service start.
RELEASE_IMAGES := $(shell (echo '$(DEFAULT_RELEASE_IMAGES)' | jq -c --arg v $(DEFAULT_VERSION) 'map(select(.openshift_version==$$v))')) | ||
OS_IMAGES := $(shell (echo '$(DEFAULT_OS_IMAGES)' | jq -c --arg v $(DEFAULT_VERSION) 'map(select(.openshift_version==$$v))')) |
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.
This manipulation should only work in case CI
is turned off (local deployments deploy a single image)
please comment a description of this behavior
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.
right, added
# RHCOS_VERSION should be consistent with BaseObjectName in pkg/s3wrapper/client.go | ||
RHCOS_BASE_ISO := $(shell (jq -n '$(OPENSHIFT_VERSIONS)' | jq '[.[].rhcos_image]|max')) | ||
# Support all OS images if missing - for kube-api flow | ||
OS_IMAGES := $(or ${OS_IMAGES},${DEFAULT_OS_IMAGES}) |
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.
It means that every deployment from test-infra will deploy all the versions, if I'm not mistaken (since test-infra overrides the environment variables)
So it needs to come up with a solution to a local test-infra (not CI) that deploys a single image to reduce deployment time
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.
Isn't this line a duplication of line 107?
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.
Nope, since line 107 is only for CI=true
56d6a33
to
03fcccd
Compare
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.
LGTM
/retest-required Please review the full test history for this PR and help us cut down flakes. |
8 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
ZTP is broken
/hold
I don't see MUST_GATHER images on the configmap
|
03fcccd
to
86db730
Compare
86db730
to
23cdc90
Compare
/unhold |
@@ -51,7 +51,7 @@ def get_deployment_tag(args): | |||
|
|||
def main(): | |||
utils.verify_build_directory(deploy_options.namespace) | |||
verify_ocp_versions(json.loads(json.loads('"{}"'.format(deploy_options.ocp_versions)))) | |||
verify_ocp_versions(ocp_versions=None, release_images=json.loads(json.loads('"{}"'.format(deploy_options.release_images)))) |
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.
verify_ocp_versions(ocp_versions=None, release_images=json.loads(json.loads('"{}"'.format(deploy_options.release_images)))) | |
verify_ocp_versions(ocp_versions=None, release_images=json.loads(json.loads(f'"{deploy_options.release_images}"'))) |
also, twice json.loads
?
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.
So that was in the original code:) The issue is that the json is double encoded, so need to double decode it for getting the object. see: https://stackoverflow.com/questions/67603183/why-do-i-need-to-do-json-loads-twice-to-parse-a-json-string
To allow openshift_versions deprecation: * Use default_os_images instead of default_ocp_versions in common.sh and setup_assisted_operator.sh. * Removed unused logic in hack/get_ocp_versions_for_testing.sh. * handle_ocp_versions: * Verify release images if specified. * ocp_versions verification could be removed after merging: openshift/assisted-test-infra#1128
23cdc90
to
a13ca83
Compare
/unhold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danielerez, osherdp, YuviGold 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 |
This PR backports part of openshift#2708. It is required since we use the new operator scripts also in release-ocm-2.4 branch of assisted-test-infra: openshift/assisted-test-infra#1276. I.e. the OPENSHIFT_VERSIONS var should be optional since the operator deployment script is specifying only OS_IMAGES and RELEASE_IMAGES in release-ocm-2.4 branch of assisted-test-infra.
To allow openshift_versions deprecation: * Use default_os_images instead of default_ocp_versions in common.sh and setup_assisted_operator.sh. * Removed unused logic in hack/get_ocp_versions_for_testing.sh. * handle_ocp_versions: * Verify release images if specified. * ocp_versions verification could be removed after merging: openshift/assisted-test-infra#1128
Assisted Pull Request
Description
To allow openshift_versions deprecation:
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Assignees
/cc @YuviGold
/cc @filanov
/cc @osherdp
Checklist
docs
, README, etc)Reviewers Checklist