-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add proposal E #13
Add proposal E #13
Conversation
From my standpoint, this is functionally almost equivalent to proposal A, it's just putting the metadata attributes in a slightly different spot. I'm indifferent to the two I think, and defer to the runtime tool maintainers. |
Switching from user extendable annotations to spec defined values means that scenarios like the MPI version dependency wouldn't be possible unless image-spec decided to support it and containerd implemented it. There's a trade-off between flexibility and control. I'm not pushing for this over A, just getting it documented so it's available as an option if we decide to combine a few of these proposals together later. |
@@ -0,0 +1,138 @@ | |||
# Proposal E - Platform Features | |||
|
|||
This proposal leverages the previously reserved `features` field in the platform to give a finer grain of control to runtimes selecting an image to run. |
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.
that's also the idea I mentioned in the proposal C for image selection: #8 (comment)
If there is still going to be an external artifact, then I can remain indifferent! But if this is just it, this is probably far worse for all the use cases I care about. |
It's already defined in the spec, so changing the data structure would be a breaking change. https://github.com/opencontainers/image-spec/blob/main/image-index.md |
@sudo-bmitch right, but:
At least in theory, no one has used that field so far. |
Damn, I just got called a "no one" 😂 If we need a map instead of a slice of strings, that would probably best be done with a new field. But before making a change like that, I'd want to establish the need. |
Can be an honor depending on who does the calling! |
In some aspects this overlaps in the ongoing discussion for proposal H.
I think it would be a good idea, as @ChaoyiHuang proposed, to introduce a new field Those would be (open for discussion):
I would also allow for custom labels, OCI would not care what is in there.
My reasoning behind that is: we have to come up with a standard way of describing generic compatibility. Other specific use cases (like telco, hpc) would have to use custom labels. We agreed that we have to build our own tools to solve our specific use cases, so the tools would recognize the custom labels which are known to the use case. Finally, if community and OCI see a need to graduate some specific custom label to well known labels we could do it carefully over time. EDIT: Note that fields with (like cpu.features.<FEATURE_NAME>) do not imply to list all possible features under OCI. We have to meet the half way and trust that whatever users defined in there potentially reflects in the reality on the host. If it doesn't it's user's business to fix this. Keeping all the possible cpu features, kernel modules etc. would be very difficult. |
I think we want that, but that's not what this specific proposal is looking at. This is focused at things like CPU features that would prevent a binary from executing on the host, and a finer grain difference than The goal of submitting this is two fold. First, it's putting up the scenario we discussed with the containerd maintainers so we can properly compare it to the other proposals (it's hard to compare something that doesn't get written down). And second is to have it as a potential building block in an eventual proposal that we adopt, not used on its own, but as part of a collection of solutions that work together. |
"platform": { | ||
"architecture": "amd64", | ||
"os": "linux", | ||
"features": [ "avx2", "bmi2" ] |
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.
My last question is about this as a list - is it already defined as a list? And the idea is that we'd need an ICD style design of features where every combination of features is represented as a single identifier?
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.
Initially it would be a list of CPU features. So you could build a generic amd64/v1 image, and a second image for amd64/v1 plus sse3 to run some application more efficiently.
For context, the OCI platform definition is based on the Go architecture list: https://tip.golang.org/wiki/MinimumRequirements#microarchitecture-support
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.
And yes, it is already defined in the spec as a list.
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.
LGTM
This proposal uses the previously reserved "platform.features" field for specifying strict hardware requirements. Signed-off-by: Brandon Mitchell <[email protected]>
Signed-off-by: Brandon Mitchell <[email protected]>
291cfd5
to
fa919a8
Compare
I've updated this with a link to a Go package that defines a list of possible feature values to further clarify the proposal. I'm leaning on Go since OCI already does that for the architecture support today. Edit: related is the Go supported platform details, where OCI defines the variants: https://go.dev/wiki/MinimumRequirements#microarchitecture-support |
``` | ||
|
||
In the above scenario, the generic `linux/amd64` entry is listed first and should be used by default. | ||
Runtimes that recognize and support the `avx2` AND `bmi2` features on a "v2" or newer variant would prefer the second entry as a better match. |
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.
Overall I like the proposal for its simplicity in image selection as I mentioned in previous comment.
just one question here, does it assume that the matching criteria is the more features match, the more prefered image. How does the runtime decide when two entries have same number of features, and both matched with the node's CPU features. (I am OK first come first serve)
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.
Good question! Entries with features listed would want to be listed after entries without any features to avoid breaking older clients that are unaware of features and would pick the first entry. I think among multiple matching entries with features specified, picking the first may be the most flexible for implementation.
Otherwise, trying to count the number of matching features and using the first match for ties could also work. My concern with that approach is that I could foresee the fallback to fast instruction being a combination of several slower instructions, and we don't want to prioritize the latter.
This proposal uses the previously reserved "platform.features" field for specifying strict hardware requirements. This is based on a discussion with a few of the containerd maintainers.
Fixes #12.