Skip to content

libcloud: build and replicate aws-winli images for supported streams#1134

Merged
marmijo merged 1 commit intocoreos:mainfrom
marmijo:build-aws-winli
Apr 29, 2025
Merged

libcloud: build and replicate aws-winli images for supported streams#1134
marmijo merged 1 commit intocoreos:mainfrom
marmijo:build-aws-winli

Conversation

@marmijo
Copy link
Copy Markdown
Member

@marmijo marmijo commented Apr 23, 2025

Expand the replicate to clouds functionality to build AWS Windows License Included (winli) images for streams that support it before replicating AMIs to other regions. cosa aws-replicate will now replicate both traditional AMIs and aws-winli AMIs if present in the metadata.

See: coreos/coreos-assembler#4069

Also add a winli knob to the pipeline config clouds.aws section to only build winli images for specific streams.

@marmijo marmijo force-pushed the build-aws-winli branch 3 times, most recently from 551596f to 25f16c6 Compare April 24, 2025 14:39
Comment thread docs/config.yaml Outdated
Comment thread libcloud.groovy Outdated
Comment thread libcloud.groovy Outdated
Comment thread libcloud.groovy Outdated
Comment thread docs/config.yaml Outdated
@marmijo marmijo force-pushed the build-aws-winli branch 2 times, most recently from a3287bb to 70f1779 Compare April 24, 2025 21:46
Copy link
Copy Markdown
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

@marmijo marmijo force-pushed the build-aws-winli branch 4 times, most recently from 05663a8 to 163550d Compare April 25, 2025 21:32
Comment thread libcloud.groovy Outdated
Comment thread libcloud.groovy
Comment on lines +69 to +67
shwrap("""
cosa buildfetch --build=${buildID} \
--arch=x86_64 --artifact=aws --url=s3://${s3_stream_dir}/builds \
--aws-config-file \${AWS_CONFIG_FILE} \
&& cosa decompress --build=${buildID} --artifact=aws
""")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this is an artificial requirement in this case how about we just touch /path/to/foo.vmdk.gz here and then delete the empty file when we're done with the upload

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SGTM, I updated the PR to grab the file name from the metadata and then touch it just before creating the AMI.

@marmijo marmijo force-pushed the build-aws-winli branch 3 times, most recently from 309369e to f6e8abb Compare April 28, 2025 18:51
@marmijo marmijo requested a review from dustymabe April 28, 2025 18:59
Comment thread libcloud.groovy Outdated
Comment on lines +62 to +63
// file to satisfy ore aws upload, which still requires the file in the
// cosa working dir.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

to be clear here. it's not actually ore it's the cosalib wrapper that checks to see if we "have the artifact" before attempting to upload.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks! I updated the comments.

Comment thread libcloud.groovy Outdated
// cosa working dir.
def s3_stream_dir = pipeutils.get_s3_streams_dir(pipecfg, stream)
shwrap("""
touch builds/${buildID}/${basearch}/${aws_image_name}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we clean this up when we're done running cosa imageupload-aws? Not sure if it might cause any issues (i.e. wouldn't want this empty file to get uploaded back overtop the actual file somehow).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's a good idea. I updated the PR to include a rm command on it. I dont think it would be uploaded since this is the replicate portion of the code, but it's better to be safe!

Copy link
Copy Markdown
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM.

WDYT about waiting to merge this when the FCOS releases are done?

@marmijo marmijo force-pushed the build-aws-winli branch 2 times, most recently from 0c27708 to 79a7d10 Compare April 29, 2025 14:15
Comment thread libcloud.groovy Outdated
// Since we are not uploading anything, let's just touch the vmdk image
// file to satisfy the cosa ore wrapper, which still requires the file
// in the cosa working dir.
aws_image_path = "builds/${buildID}/${basearch}/${aws_image_name}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
aws_image_path = "builds/${buildID}/${basearch}/${aws_image_name}"
def aws_image_path = "builds/${buildID}/${basearch}/${aws_image_name}"

??

Expand the replicate to clouds functionality to build AWS Windows
License Included (winli) images for streams that support it before
replicating AMIs to other regions. `cosa aws-replicate` will now
replicate both traditional AMIs and aws-winli AMIs if present in the
metadata.

See: coreos/coreos-assembler#4069

Also add `create_and_replicate_winli_ami` as a stream level knob to the
pipeline config to enable building and replicating the AMIs for specific
streams.
@marmijo marmijo merged commit 34038e8 into coreos:main Apr 29, 2025
1 of 2 checks passed
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.

2 participants