-
Notifications
You must be signed in to change notification settings - Fork 38
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 IntelRdt to CDI spec #164
Conversation
66b31ca
to
c4b03ce
Compare
Updated PR:
|
@marquiz You may want to enclose CLOS as |
c4b03ce
to
026fdce
Compare
Thx, did that. Lovely smart spell checker... |
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.
Thanks for the work here @marquiz.
I have some questions / comments below.
One thing that is also missing is automatically determining spec version 0.7.0 when calling MinimumRequiredVersion
in version.go
.
@@ -202,7 +217,7 @@ func (e *ContainerEdits) isEmpty() bool { | |||
if e == nil { | |||
return false | |||
} | |||
return len(e.Env)+len(e.DeviceNodes)+len(e.Hooks)+len(e.Mounts) == 0 | |||
return len(e.Env)+len(e.DeviceNodes)+len(e.Hooks)+len(e.Mounts) == 0 && e.IntelRdt == nil |
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.
Question: Should we explicitly check for an empty IntelRdt
object here, or is checking for a nil
sufficient?
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 checking nil
is the right thing to do. From the OCI runtime-spec perspective (or the crun implementation, on it's behalf, IIRC) it's valid to have a non-nil IntelRdt in which all fields are empty. (In this case the runtime should create a container-specific CLOS with default settings).
@@ -192,6 +204,9 @@ func (e *ContainerEdits) Append(o *ContainerEdits) *ContainerEdits { | |||
e.DeviceNodes = append(e.DeviceNodes, o.DeviceNodes...) | |||
e.Hooks = append(e.Hooks, o.Hooks...) | |||
e.Mounts = append(e.Mounts, o.Mounts...) | |||
if o.IntelRdt != nil { |
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.
What is the expected behaviour is both are non-nil? Here we overwrite the previous value if the input value is non-nil.
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.
intelRDT fiels in OCI spec can't have multiple values, so overwriting already set values theoretically expected behaviour. One thing which is questionable, is to go over individual values, instead of overwriting as a whole struct.
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.
Yes, it's like @kad explained. There can only be single RDT configuration per container. Also, the config must be applied as a whole (merging multiple RDT configs together is not something that we want).
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.
As discussed in the COD working group meeting, I'm happy as long as this is consistent with what is done for other edits (Env, Mounts). It seems to be the case in that the last value applied takes precedence.
We also mentioned that if we do want to expose errors due to conflicts, we can do so in a follow-up.
One thing that would be good would be to add a unit test to capture this behaviour to prevent regressions.
3419299
to
6392a5f
Compare
TODO:
|
@marquiz here is the code to determine the automatic version: container-device-interface/pkg/cdi/version.go Line 122 in 7b12d28
Something like:
|
6392a5f
to
f01cdc8
Compare
Thanks @elezar. I now updated the PR with the TODO items resolved:
In addition I updated the |
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.
One last question / comment.
Otherwise LGTM.
Add support for specifying the OCI Linux.IntelRdt configuration that is the control point for cache and memory bandwidth allocation technologies sucn as Intel RDT (Resource Director Technology). There can only be one IntelRdt configuration per container so in case multiple specs happened to specify it the last one applied prevails. Also, the IntelRdt configuration is always applied as a whole - editing specific sub-fields is not supported. Signed-off-by: Markus Lehtonen <[email protected]>
f01cdc8
to
1537b1d
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.
Thanks @marquiz.
LGTM!
Add support for specifying the OCI Linux.IntelRdt configuration that is the control point for cache and memory bandwidth allocation technologies sucn as Intel RDT (Resource Director Technology). There can only be one IntelRdt configuration per container so in case multiple specs happened to specify it the last one applied prevails. Also, the IntelRdt configuration is always applied as a whole - editing specific sub-fields is not supported.