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

cmd/openshift-install/upi: Add 'bootimage' subcommand #1529

Closed
wants to merge 4 commits into from

Conversation

wking
Copy link
Member

@wking wking commented Apr 4, 2019

Builds on #1528, I'll rebase after that lands.

This makes it easier for UPI folks to discover a recommended bootimage for the infrastructure they are setting up.

Fixes #1399.

I've taken a slightly different take on the CLI framework vs. what was discussed there:

  • I don't actually download anything (no point in downloading AMIs, and we want to expose them too, CC @dgoodwin). Downloading should be straightforward when we spit out URI(s).
  • I've used a positional platform argument (vs. --platform), because the argument is required and not optional. Without a requested platform, what would we show?

cgwalters and others added 2 commits April 3, 2019 19:45
This way we avoid needing a service available at least for AWS
installs.  The AMIs now get hardcoded into the binary.

`hack/update-rhcos-bootimage.py` is a small script which accepts
a URL to build metadata and updates our cached version with just
the subset of keys we care about (or potentially care about); e.g.
not the pkgdiff.

From Trevor:

Drop the HTTP stuff in favor of just the local asset or
`OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE`.

The codecs business works around the lack of byte-stream support in
json.load before Python 3.6 [1].

[1]: https://docs.python.org/3/library/json.html#json.load

Co-authored-by: Trevor King <[email protected]>
Uncomment all of the regions in pkg/types/aws/validation (unwinding
that part of bd88157, hack/build: Pin to RHCOS 400.7.20190306.0,
2019-03-12, openshift#1407).  Instead, perform the "can we find an AMI for that
region?" check directly in pkg/asset/installconfig/aws when we're
building a list of regions for the wizard prompt.  With this change,
bumping the rhcos.json asset (via hack/update-rhcos-bootimage.py) will
automatically keep the wizard prompt's choices in sync with the
published AMIs.
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 4, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wking

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 4, 2019
@abhinavdahiya abhinavdahiya removed the request for review from aaronlevy April 4, 2019 00:17
@abhinavdahiya
Copy link
Contributor

* I've used a positional platform argument (vs. `--platform`), because the argument is required and not optional.  Without a requested platform, what would we show?

if the user needs the platform information, it is present in the install-config. I would expect installer to drive it self from --dir or internal state.

@cgwalters
Copy link
Member

I guess a tricky topic is that this PR intersects the RHCOS artifact types (qemu, openstack, metal-bios, metal-uefi) with OpenShift platforms and those don't always have 1-1 mappings or name alignments.

I think we clearly want to have openstack in this list, and I'd definitely like to support downloading all of the "metal" artifacts (metal-bios, metal-uefi, and iso).

@cgwalters
Copy link
Member

But that doesn't necessarily need to be solved in this PR, we can add to it later - only gave this a skim but LGTM.

@wking wking force-pushed the upi-cli-show-bootimage branch from bde9ba0 to db9069c Compare April 4, 2019 04:12
@wking
Copy link
Member Author

wking commented Apr 4, 2019

if the user needs the platform information, it is present in the install-config.

Hmm. I like how the current implementation is decoupled from the install-config, so you don't have to go through the hassle of reading in an install-config just to figure out the bootimage. But I agree that there's a benefit to not having to document two separate interfaces. I dunno, I could go either way here. You're pretty solidly behind the install-config approach?

I guess a tricky topic is that this PR intersects the RHCOS artifact types (qemu, openstack, metal-bios, metal-uefi) with OpenShift platforms and those don't always have 1-1 mappings or name alignments.

I think the bootimage subcommand should take OpenShift platform names. If libvirt and openstack both return the QEMU URI (should they?), that's fine. And the implementation would just be:

case libvirt.Name, openstack.Name:

which seems pretty straightforward.

For the additional objects that are so UPI that they will never have in-cluster names, I'm fine rolling forward with whatever naming RHCOS wants to use. I'm fine putting that in this PR or saving it for followup work.

I've pushed bde9ba062 -> db9069c56 to address the test failures.

wking added 2 commits April 3, 2019 21:15
So users can easily see what the alternatives are.
To make it easier for UPI folks to discover a recommended bootimage
for the infrastructure they are setting up.
@wking wking force-pushed the upi-cli-show-bootimage branch from db9069c to e791a1b Compare April 4, 2019 04:15
@openshift-ci-robot
Copy link
Contributor

@wking: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws e791a1b link /test e2e-aws

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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

@dgoodwin
Copy link
Contributor

dgoodwin commented Apr 4, 2019

Am I correct that this solves Hive's need to know what AMI we should use for day 2 machinesets? If so that is awesome, this solves a big need for us.

Will the CLI interface need to change at all when we can pull this info from a release image?

The usage doesn't mention the positional platform argument, it probably should:

Usage:
  openshift-install user-provided-infrastructure bootimage [flags]

@wking
Copy link
Member Author

wking commented Apr 4, 2019

Am I correct that this solves Hive's need to know what AMI we should use for day 2 machinesets?

Well... say you upgrade to a new release, and the installer associated with that new release pins a newer bootimage. You probably want to use that newer bootimage for additional Machine(Set)s, right? But pulling the installer referenced by the current release image and running this command is slightly less of a cludge than querying existing Machines, and it may be a useful bridge until the machine-os-content images pick up the bootimage metadata. And this command would be a useful shortcut if you were adding Machines within a few minutes of launching the cluster and could assume that no bootimage-bumping upgrades had happened.

The usage doesn't mention the positional platform argument...

Good catch, will fix in the next reroll.

@cgwalters
Copy link
Member

Am I correct that this solves Hive's need to know what AMI we should use for day 2 machinesets? If so that is awesome, this solves a big need for us.

I don't think this does or should change the answer for that, which today is - it doesn't change from install time.

@abhinavdahiya
Copy link
Contributor

if the user needs the platform information, it is present in the install-config.

Hmm. I like how the current implementation is decoupled from the install-config, so you don't have to go through the hassle of reading in an install-config just to figure out the bootimage. But I agree that there's a benefit to not having to document two separate interfaces. I dunno, I could go either way here. You're pretty solidly behind the install-config approach?

We need to be consistent as much we can, therefore any perplatfrom stuff needs to through install-config.

only exception that we can support is --all to this subcommand that returns the entire meta.json with all the information.

@wking
Copy link
Member Author

wking commented Apr 5, 2019

We need to be consistent as much we can, therefore any perplatfrom stuff needs to through install-config.

So the easiest way to do that is probably to make rhcos.Image writeable and attach it to pre-cluster (#1532). I'll close this and open a new PR with that once #1532 lands.

@wking wking closed this Apr 5, 2019
@wking wking deleted the upi-cli-show-bootimage branch April 5, 2019 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants