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

FIX: Invoke "get_image_by_id" before "tag_image" #7

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

JAVGan
Copy link
Collaborator

@JAVGan JAVGan commented Jul 15, 2024

We must send the actual EC2 image object to "tag_image" and not a string, otherwise it won't properly work.

@JAVGan JAVGan requested review from jajreidy and lslebodn as code owners July 15, 2024 21:08
@JAVGan
Copy link
Collaborator Author

JAVGan commented Jul 15, 2024

Dears, PTAL.

I've ran tests locally and it worked:

pubtools-marketplacesvm-push --workflow marketplace --starmap https://starmap.engineering.redhat.com  --credentials creds/prod/aws-na.json,creds/prod/aws-emea.json,creds/prod/azure-na.json,creds/prod/azure-emea.json --starmap-url='https://starmap.stage.engineering.redhat.com' 'koji:https://brewhub.engineering.redhat.com/brewhub?vmi_build=rhcos-x86_64-415.92.202402201450-0&basedir=/mnt/redhat/brewroot' --pre-push
2024-07-15 18:07:49,857 [INFO    ] Loading items from koji:https://brewhub.engineering.redhat.com/brewhub?vmi_build=rhcos-x86_64-415.92.202402201450-0&basedir=/mnt/redhat/brewroot
2024-07-15 18:07:52,719 [INFO    ] Skipping PushItem rhcos for region us-gov-west-1
2024-07-15 18:07:52,719 [INFO    ] Retrieving the mappings for rhcos from https://starmap.stage.engineering.redhat.com
2024-07-15 18:07:52,719 [INFO    ] Sending a get request to /query
2024-07-15 18:07:53,299 [INFO    ] starmap query returned for rhcos : {"name": "rhcos-x86_64", "version": "4.15", "query_response": {"name": "rhcos-x86_64-aws", "workflow": "stratosphere", "clouds": {"aws-na": [{"id": null, "meta": {"marketplace_entity_type": "AmiProduct", "recommended_instance_type": "m5.large", "release": {"base_product": "RHEL", "base_version": "8.9", "product": "RHCOS", "type": "ga", "variant": "Server"}, "release_notes": "https://docs.openshift.com/container-platform/{major_minor}/release_notes/ocp-{major_version}-{minor_version}-release-notes.html", "scanning_port": 22, "security_groups": [{"from_port": 22, "ip_protocol": "tcp", "ip_ranges": ["0.0.0.0/0"], "to_port": 22}], "usage_instructions": "RHCOS is supported only as a component of OpenShift Container Platform {major_minor} for all OpenShift Container Platform machines.\nRHCOS is the only supported operating system for OpenShift Container Platform control plane, or master, machines.\nWhile RHCOS is the default operating system for all cluster machines, you can create compute machines, which are also known as worker machines, that use RHEL as their operating system.\nThere are two general ways RHCOS is deployed in OpenShift Container Platform {major_minor}:\n\n1. If you install your cluster on infrastructure that the installation program provisions, RHCOS images are downloaded to the target platform during installation. Suitable Ignition config files, which control the RHCOS configuration, are also downloaded and used to deploy the machines.\n2. If you install your cluster on infrastructure that you manage, you must follow the installation documentation to obtain the RHCOS images, generate Ignition config files, and use the Ignition config files to provision your machines.\n4. For more information please see the [Deploying RHCOS](https://docs.openshift.com/container-platform/{major_minor}/architecture/architecture-rhcos.html) documentation.", "user_name": "ec2-user", "virtualization": "hvm"}, "architecture": "x86_64", "destination": "d87bcebf-9cf4-47f5-9b5b-5470d4490f3d", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "provider": null, "tags": {}}]}}} 
2024-07-15 18:07:53,299 [INFO    ] Retrieving the mappings for rhcos from https://starmap.stage.engineering.redhat.com
2024-07-15 18:07:53,299 [INFO    ] Sending a get request to /query
2024-07-15 18:07:53,740 [INFO    ] starmap query returned for rhcos : {"name": "rhcos-x86_64", "version": "4.15", "query_response": {"name": "rhcos-x86_64-azure", "workflow": "stratosphere", "clouds": {"azure-na": [{"id": null, "meta": {}, "architecture": "x86_64", "destination": "rhcos/rhcos", "overwrite": false, "restrict_version": false, "restrict_major": null, "restrict_minor": null, "provider": null, "tags": {}}]}}} 
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.boot_mode, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.marketplace_title_template, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.type, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.volume, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.root_device, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.sriov_net_support, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.ena_support, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.uefi_support, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.billing_codes, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.image_id, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.public_image, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.version_title, leaving it unset.
2024-07-15 18:07:53,741 [WARNING ] Missing information for the attribute rhcos.access_endpoint_url, leaving it unset.
2024-07-15 18:07:53,742 [INFO    ] Uploading the item rhcos to AWS-NA.
2024-07-15 18:07:53,742 [WARNING ] Missing information for the attribute rhcos.boot_mode, leaving it unset.
2024-07-15 18:07:53,742 [WARNING ] Missing information for the attribute rhcos.marketplace_title_template, leaving it unset.
2024-07-15 18:07:53,742 [WARNING ] Missing information for the attribute rhcos.sku_id, leaving it unset.
2024-07-15 18:07:53,742 [WARNING ] Missing information for the attribute rhcos.support_legacy, leaving it unset.
2024-07-15 18:07:53,742 [WARNING ] Missing information for the attribute rhcos.legacy_sku_id, leaving it unset.
2024-07-15 18:07:53,742 [WARNING ] Missing information for the attribute rhcos.disk_version, leaving it unset.
2024-07-15 18:07:53,742 [WARNING ] Missing information for the attribute rhcos.recommended_sizes, leaving it unset.
2024-07-15 18:07:53,742 [WARNING ] Missing information for the attribute rhcos.sas_uri, leaving it unset.
2024-07-15 18:07:53,742 [INFO    ] Uploading the item rhcos to AZURE-NA.
2024-07-15 18:07:53,772 [INFO    ] Image name: RHEL-8.9-RHCOS-4.15_HVM_GA-20240220-x86_64-0 | Sharing groups: []
2024-07-15 18:07:53,781 [INFO    ] Searching for image: rhcos-415.92.202402201450-0-azure.x86_64.vhd in container pubupload
2024-07-15 18:07:54,574 [INFO    ] Image already exists with name "rhcos-415.92.202402201450-0-azure.x86_64.vhd"
2024-07-15 18:07:54,575 [INFO    ] Image published: pubupload/rhcos-415.92.202402201450-0-azure.x86_64.vhd
2024-07-15 18:07:54,696 [INFO    ] Generating the SAS URI for pubupload/rhcos-415.92.202402201450-0-azure.x86_64.vhd
2024-07-15 18:07:54,696 [INFO    ] Upload finished for rhcos on AZURE-NA
2024-07-15 18:07:54,895 [INFO    ] AMI already exits in account.Skipping Copying AMI.
2024-07-15 18:07:55,285 [INFO    ] Tagging image: rhcos-x86_64-415.92.202402201450-0 with {'nvra': 'rhcos-x86_64-415.92.202402201450-0.x86_64', 'name': 'rhcos-x86_64', 'version': '415.92.202402201450', 'release': '0', 'arch': 'x86_64', 'buildid': '2918767'}
2024-07-15 18:07:55,714 [INFO    ] Upload finished for rhcos on AWS-NA
2024-07-15 18:07:55,716 [INFO    ] Collecting results
2024-07-15 18:07:55,719 [INFO    ] Logging to /home/jgangi/Documents/RedHat/exd-sp/stratosphere/pub-integration/pubtools-marketplacesvm/artifacts/20240715180755/pushitems.jsonl
2024-07-15 18:07:55,719 [INFO    ] Logging to /home/jgangi/Documents/RedHat/exd-sp/stratosphere/pub-integration/pubtools-marketplacesvm/artifacts/20240715180755/clouds.json

We must send the actual EC2 image object to "tag_image" and not a
string, otherwise it won't properly work.
@JAVGan
Copy link
Collaborator Author

JAVGan commented Jul 15, 2024

Note: Related to #4

@lslebodn
Copy link
Collaborator

IIUC release-engineering/cloudimg#35 will not be needed with this PR.

@JAVGan
Copy link
Collaborator Author

JAVGan commented Jul 16, 2024

IIUC release-engineering/cloudimg#35 will not be needed with this PR.

That's correct

Copy link
Collaborator

@lslebodn lslebodn left a comment

Choose a reason for hiding this comment

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

LGTM and lets close release-engineering/cloudimg#35 :-)

@JAVGan JAVGan merged commit 21b2ad0 into main Jul 16, 2024
18 checks passed
@JAVGan JAVGan deleted the yetanotherfix branch July 16, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants