-
Notifications
You must be signed in to change notification settings - Fork 217
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-2977 Cluster specific minimal iso #932
MGMT-2977 Cluster specific minimal iso #932
Conversation
6adff31
to
eaf06aa
Compare
5e209c2
to
f306878
Compare
@avishayt Can you please take a look? |
type: string | ||
description: Type of image that should be generated. | ||
$ref: '#/definitions/image_type' |
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.
I'm not sure it's legal to have a string with a ref?
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.
Seems it behaves as expected, works with 'host-stage' at least :)
Lines 3792 to 3794 in f557006
current_stage: | |
type: string | |
$ref: '#/definitions/host-stage' |
f306878
to
0942ead
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.
looks good, just one small comment
pkg/s3wrapper/upload_iso.go
Outdated
} | ||
if err := gzipWriter.Close(); err != nil { | ||
err = errors.Wrapf(err, "Failed to gzip ignition config") | ||
imageBytes, err := isoeditor.IgnitionImageArchive(ignitionConfig) |
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.
imageBytes, err := isoeditor.IgnitionImageArchive(ignitionConfig) | |
ignitionBytes, err := isoeditor.IgnitionImageArchive(ignitionConfig) |
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.
sure, done
This adds a type enum to both the cluster image info and the image creation parameters
This will make it easier to share between the existing logic which creates the archive then uploads it to s3 and the new logic which will write the archive to the fs before bundling it into the minimal iso directly
This allows us to create the entire iso locally and skip the process of uploading the ignition to S3
This will be a good place to add "ratelimiting" for concurrent iso editing if that's something we need. Additionally it makes things easier to test by giving us somewhere to inject mock objects at the inventory API level. Authored-by: Nick Carboni <ncarboni@redhat.com>
Extracted generate cluster minimal ISO logic to 'generateClusterMinimalISO' function in order to avoid a cyclomatic complexity error.
0942ead
to
5f447d9
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avishayt, carbonin 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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
12 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
Added "Regenerates the iso for a new type" unit-test.
5f447d9
to
a535916
Compare
/retest |
/lgtm |
* MGMT-297 Add discovery image type This adds a type enum to both the cluster image info and the image creation parameters * MGMT-2977 Move tempfile handling into create() * MGMT-2977 Move logic for creating ignition archive to isoeditor This will make it easier to share between the existing logic which creates the archive then uploads it to s3 and the new logic which will write the archive to the fs before bundling it into the minimal iso directly * MGMT-2977 Add the full ignition to the iso before re-creating it This allows us to create the entire iso locally and skip the process of uploading the ignition to S3 * MGMT-2977 Create a cluster-specific minimal iso when requested * MGMT-2977 Create a factory interface for isoeditor This will be a good place to add "ratelimiting" for concurrent iso editing if that's something we need. Additionally it makes things easier to test by giving us somewhere to inject mock objects at the inventory API level. Authored-by: Nick Carboni <ncarboni@redhat.com> * MGMT-2977 extract generate cluster minimal iso logic Extracted generate cluster minimal ISO logic to 'generateClusterMinimalISO' function in order to avoid a cyclomatic complexity error. * MGMT-2977 negative unit-tests for generate minimal iso * MGMT-2977 unit-test for regenerating iso template Added "Regenerates the iso for a new type" unit-test. * MGMT-2977 added minimal-iso ImageType to subsystem tests Co-authored-by: Daniel Erez <derez@redhat.com>
This PR allows a user to select a "minimal" iso for discovery which does not contain a rootfs. This reduces the iso size to 93M from 876M. This is required for users where the virtual media interface is significantly slower than the booted machine's network.
See coreos/fedora-coreos-tracker#661 for a larger discussion
This PR customizes the "template" minimal iso which was created in #911 by downloading the template iso, unpacking it locally, adding the ignition, and recreating the iso. A user specifies they want the minimal iso using the new API parameter (
image_type
) when requesting an image be generated. Installation then proceeds as it would otherwise.Requires
#930 and #931MERGEDTODO: add testsDone, thanks @danielerezcc @danielerez