-
Notifications
You must be signed in to change notification settings - Fork 108
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
aws: allow the user to customize their AMI name #3886
Conversation
What kind of test would be adequate for this functionality do you think? I could change the aws test to add a snapshotName in the request and see if I can get access to the proper name after upload? Wdyt? |
What benefit is there in using a new UUID to make the AMI Name unique? Why not use the UUID of the image so that no matter which field you look at it is clear (ha!) that it is the same thing? |
Thanks for this input, I hadn't thought about it this way. I'll make the two UUIDs the same. |
The tests are failing and I'm starting to understand what's happening. We decided to reuse the osbuild-composer/test/cases/api/aws.sh Lines 69 to 79 in 6735e74
osbuild-composer/test/cases/api/aws.sh Lines 103 to 110 in 6735e74
The test suite is using this field to recover the Here's a few opened questions:
I think it's reasonable to could keep the broader filter (the one with a What do you think? |
9eb8f17
to
ec07fd1
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.
The consistent UUID part of things looks good.
7dba54d
to
4d6188e
Compare
0d9c3b2
to
bad6068
Compare
3454043
to
88c82f2
Compare
In the frontend a new field is allowing user to setup customized names for their images (see osbuild/image-builder-frontend#1136). To allow the customization to effectively take place, this commit is slightly changing how EC2 images are activated. The Name tag and the AMI Name are not always sharing the same value exactly anymore. If the user provides a SnaphsotName, the raw value is set in the `Name` tag and the AMI name is set to `$SnaphsotName-$UUID` (to make it unique). This means that the `Name` tag can't be used anymore for the maintenance tooling. The tooling will have to use the new Build-By tag to identify the images built by osbuild-composer.
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.
The change looks reasonable, but I'm wondering if we can't instead extend the maintenance service to use additional / different tag for filtering images? This would allow us to use the same value for the Name
tag and as image name and would reduce the complexity and required changes in osbuild-composer a lot. 🤔
// For service maintenance, images are discovered by the "Name:composer-api-*" | ||
// tag filter. Currently all image names in the service are generated, so they're | ||
// guaranteed to be unique as well. If users are ever allowed to name their images, |
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 think that part of this comment should be preserved. Especially the information that the maintenance service uses "Name:composer-api-*"
to discover images is very useful.
// Optional tag value if not provided will default to the ImageName's value. | ||
TagName string `json:"tag_name,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.
tiny nitpick: I would suggest to rename this to NameTag
instead. The TagName
indicates (at least to me) that it is a name (a.k.a. the key) of a tag, not a value of a tag named Name
.
{ | ||
Key: aws.String("Build-by"), | ||
Value: aws.String("osbuild-composer"), |
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 wondering if the maintenance service could not leverage this new tag instead of the image name for filtering? This would allow us to keep the image name and the value of the Name
tag consistent. Since you are appending an UUID to the user-provided image name, it will be unique and usable as the single image name.
@croissanne WDYT about using this new tag for the maintenance service?
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.
Yup!
I think that's already implied in the description. Might be useful to do this in the same PR though, would just require a tiny change. |
This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 30+7 days with no activity. |
In the frontend a new field is allowing user to setup customized names
for their images (see
osbuild/image-builder-frontend#1136).
To allow the customization to effectively take place, this commit is
slightly changing how EC2 images are activated.
The Name tag and the AMI Name are not always sharing the same value
exactly anymore. If the user provides a SnaphsotName, the raw value is
set in the
Name
tag and the AMI name is set to$SnaphsotName-$UUID
(to make it unique).
This means that the
Name
tag can't be used anymore for the maintenancetooling. The tooling will have to use the new Build-By tag to identify
the images built by osbuild-composer.
Example
The request:
Ended up producing this AMI:
This pull request includes:
https://issues.redhat.com/browse/HMS-2959