-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Refactor RHCOS fetch API, support fetching qemu from partial config #856
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: cgwalters If they are not already assigned, you can assign the PR to them by writing 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 |
0170392
to
3132f2a
Compare
This is a trival subset of openshift#856 As I was arguing in this PR: The result of an install run is currently a function of the 3-tuple: (installer, RHCOS, release payload) I'd actually like to print out all 3 clearly in the logs; this is a first step to show the RHCOS version.
OK split out #866 However, some of the work in this PR to retain the structured metadata I think is still useful. |
Though of course if we go to an always-pinned model this PR would be obsolete. |
/hold |
3132f2a
to
1e9b39e
Compare
/hold cancel OK, this is rebased 🏄♂️ and while a lot of the code is the same, we landed the much more trivial #866 in the meantime. This PR now has a different primary purpose; see the updated commit message for details. |
/hold Will rebase this after #902 lands. |
@cgwalters after #902 lands, what does this PR get us? |
It makes the API more closely model how the coreos-assembler metadata looks. It's a useful step towards e.g. only fetching the AMI values once - it looks like to me today we fetch twice for AWS. For example, I want to change things to log/print the RHCOS version number for AWS too - one can always derive the AMI from that. |
@@ -28,7 +28,7 @@ func (libvirt *Libvirt) UseCachedImage() (err error) { | |||
return nil | |||
} | |||
|
|||
logrus.Infof("Fetching OS image: %s", filepath.Base(libvirt.Image)) | |||
logrus.Infof("Fetching qemu URL: %s", filepath.Base(libvirt.Image)) |
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.
nit: The log message should describe the resource being fetched, but "URL" is just how we're fetching it. If you don't like "OS image", how about "QEMU image"? Or "QCOW2" (although I don't know if we actually require this to be QCOW2 or if libvirt can handle other formats too)?
@@ -13,6 +13,8 @@ type MachinePool struct { | |||
// Image is the URL to the OS image. | |||
// E.g. "http://aos-ostree.rhev-ci-vms.eng.rdu2.redhat.com/rhcos/images/cloud/latest/rhcos-qemu.qcow2.gz" | |||
Image string `json:"image"` | |||
// Metadata string describing the image | |||
ImageDescription string `json:"imageDescription,omitempty"` |
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.
MachinePool
is for user-supplied input (although we supply defaults when the user doesn't care). This string doesn't seem like an actionable input.
// is reusing an install config) | ||
qemuImage := cfg.Platform.Libvirt.DefaultMachinePlatform.Image | ||
if qemuImage == "" { | ||
rhcosBuild, err := rhcos.FetchBuild(context.TODO(), rhcos.DefaultChannel) |
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 is too late (and the in-master AMI fetch above is also too late). We need these resolved by the time we generate the machine(-set) values we set up for the cluster API. #792 tries to straighten out dependencies to make this work.
1e9b39e
to
862c20f
Compare
The *main* thing I'm really fixing here is that I have an installer wrapper script: https://github.com/cgwalters/homegit/blob/master/bin/okdinst And I noticed recently that I kept fetching old RHCOS versions; that's of course because the image URL was hardcoded in my install config. What I really want is to fetch that dynamically. So this PR changes the TF rendering code to do an on-demand fetch if the image isn't filled out in the libvirt config. Now further, as I was arguing in this PR: openshift#710 (comment) The result of an install run from installer git master is currently a function of the 3-tuple: (installer, RHCOS, release payload) I'd actually like to print out all 3 clearly in the logs; this is a first step. Today as far as I can see we do separate fetches in AWS for master, bootstrap and worker, which is a bit broken. Need to move that to a higher level, and this will help with that.
This is primarily targeted for local development/testing.
862c20f
to
b547e64
Compare
@cgwalters: PR needs rebase. 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. |
@cgwalters: The following tests failed, say
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. |
This looks abandoned. and installer has the images hardcoded for boot. /close |
@abhinavdahiya: Closed this PR. In response to this:
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. |
The main thing I'm really fixing here is that I have an installer
wrapper script: https://github.com/cgwalters/homegit/blob/master/bin/okdinst
And I noticed recently that I kept fetching old RHCOS versions; that's
of course because the image URL was hardcoded in my install config. What
I really want is to fetch that dynamically.
So this PR changes the TF rendering code to do an on-demand fetch
if the image isn't filled out in the libvirt config.
Now further, as I was arguing in this PR:
#710 (comment)
The result of an install run from installer git master is currently a function
of the 3-tuple:
(installer, RHCOS, release payload)
I'd actually like to print out all 3 clearly in the logs; this is
a first step.
Today as far as I can see we do separate fetches in AWS for master,
bootstrap and worker, which is a bit broken. Need to move that
to a higher level, and this will help with that.