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

CORS-3652 : RHCOS Stream Marketplace Images #9329

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

Conversation

patrickdillon
Copy link
Contributor

This is an implementation of openshift/enhancements#1655

  • Adds a standalone go file ./hack/rhcos/populate-marketplace-imagestream.go which generates data/data/coreos/marketplace-rhcos.json
  • Adds packages to populate the stream with free Azure marketplace images published by ARO
  • Vendors local fork of coreos/stream-metadata-go with updated struct definitions for the marketplace (PR forthcoming)
  • Updates existing installer RHCOS libraries to merge marketplace-rhcos.json with rhcos.json when:
    • openshift-install coreos print-stream-json
    • running ./hack/build-coreos-manifest.go (as part of the Dockerfile build) to generate the RHCOS stream configmap
    • selecting boot images for IPI installs with openshift-install create cluster
  • Includes a PoC commit to demonstrate a CI-based IPI Azure install using the stream. I expect it may be better to break this work into a separate PR, but including the initial work here serves as a good test/verification.

openshift/enhancements#1655 is still a WIP and needs to be updated to reflect this work, but enough consensus has been reached that the work itself can help guide the enhancement.

How it works:

Users can run this standalone command (using authentication libs of the openshift-installer) to generate/update the marketplace stream:

STREAM_RELEASE_OVERRIDE=417.94.202407010000-0 go run -mod=vendor ./hack/rhcos/populate-marketplace-imagestream.go

By default, the command will look for (Azure unpaid) images in the current branch (discovered from the local rhcos.json). I added an override to force searching for a specific release. In this case, the override value is hacky with zero-padding because I could not determine the RHCOS build which was used to publish the ARO images (they truncate the timestamp).

The results of this command produce the marketplace-rhcos.json file, checked in here.

When using the print-stream-json command, the marketplace-rhcos.json results are merged with rhcos.json:

$ ./openshift-install coreos print-stream-json | jq '.architectures.x86_64."rhel-coreos-extensions"'
{
  "azure-disk": {
    "release": "418.94.202410090804-0",
    "url": "https://rhcos.blob.core.windows.net/imagebucket/rhcos-418.94.202410090804-0-azure.x86_64.vhd"
  },
  "marketplace": {
    "azure": {
      "no-purchase-plan": {
        "hyperVGen1": {
          "publisher": "azureopenshift",
          "offer": "aro4",
          "sku": "aro_417",
          "version": "417.94.20240701",
          "thirdParty": false
        },
        "hyperVGen2": {
          "publisher": "azureopenshift",
          "offer": "aro4",
          "sku": "417-v2",
          "version": "417.94.20240701",
          "thirdParty": false
        }
      }
    }
  }
}

Similarly, the configmap generated from ./hack/build-coreos-manifest.go contains the merged json.

Finally, the poc ipi azure install demonstrates the installation time gains we achieve when not needing to upload an image as part of the install process.

Adds a standalone go program that generates
data/data/coreos/marketplace-rhcos.json

This file is combined with rhcos.json to create the coreos stream,
but the files are updated at different cadences by different teams.
Updates the generation of the coreos stream manifest, which runs
during container building, to merge the contents of the
marketplace-rhcos.json file with rhcos.json when creating the coreos
stream configmap.
Reworks the logic for fetching the coreos stream to merge a
marketplace.json file (if it exists) with the (rhcos|fcos).json
file before producing the results.
Adds the ability to discover existing images in the Azure marketplace
to be used for populating the marketplace rhcos stream.
Adds armcompute package to provide an API for Azure marketplace
images.
go mod tidy && go mod vendor
@openshift-ci openshift-ci bot requested review from jlebon and mtulio December 19, 2024 02:14
Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from patrickdillon. For more information see the 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

@patrickdillon
Copy link
Contributor Author

/cc @bryan-cox @bennerv
fyi @sdodson @jlebon @travier
I will update the enhancement ASAP.

@openshift-ci openshift-ci bot requested review from bennerv and bryan-cox December 19, 2024 02:15
This is a WIP implementation of using Azure marketplace images from
the coreOS stream:
- reads marketplace images instead of azure disk from stream
- sets up images in control plane machine manifests (needs more work)
- removes image upload

Also includes a marketplace-rhcos.json file which was generated with
STREAM_RELEASE_OVERRIDE=417.94.202407010000-0 go run -mod=vendor ./hack/rhcos/populate-marketplace-imagestream.go
Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

@patrickdillon: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azure-default-config 6944b1b link false /test e2e-azure-default-config
ci/prow/golint 6944b1b link true /test golint
ci/prow/verify-vendor 6944b1b link true /test verify-vendor
ci/prow/e2e-azurestack 6944b1b link false /test e2e-azurestack

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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.

1 participant