Added support for Generic Resources#33440
Conversation
aaronlehmann
left a comment
There was a problem hiding this comment.
The design seems right to me. I agree with configuring the available resources on the node itself instead of on a manager, because that leaves open the future possibility of automatically detecting devices such as GPUs. It also fits the existing model where the node self-reports memory and CPU resources.
In the future we could potentially also add generic resource information to NodeSpec, so certain resources could be declared with node update on a manager. This could coexist with individual nodes self-reporting any resources they know about. The NodeSpec model might make sense for "abstract" resources (as opposed to real hardware resources). However, I think the self-reporting approach in this PR is the right place to start.
I think the main questions around this will center around UX. I'm not an expert in that area so I'll let others review this part and provide suggestions.
daemon/cluster/convert/service.go
Outdated
daemon/cluster/convert/service.go
Outdated
api/types/swarm/task.go
Outdated
There was a problem hiding this comment.
Both of these fields should have json:",omitempty"
ec6f956 to
6f558d1
Compare
|
@aaronlehmann I've addressed your issues, fixed vendors (I think) and compilation. |
|
@aaronlehmann I've addressed your issues, fixed vendors (I think) and compilation.
Should I also update api/swagger.yaml ?
Yes, please.
|
6f558d1 to
d5c648b
Compare
|
@aaronlehmann I've create a I'm not really sure about the choice of name but because there already exists a Thanks! |
332f702 to
6be19d8
Compare
|
@aaronlehmann @stevvooe @ehazlett @tonistiigi PTAL :) |
|
@tiborvass I gave the plugin PR a quick look and it seems to me that it wouldn't impact it :) |
|
Agreed I don't think there is any impact. |
vendor.conf
Outdated
There was a problem hiding this comment.
Hey @RenaudWasTaken 👋
You should be able to rebase and drop the swarmkit re-vendor now that a newer version is in moby via #33642.
6be19d8 to
ad3fd09
Compare
|
Please sign your commits following these rules: $ git clone -b "genericresource" git@github.com:RenaudWasTaken/moby.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842353767704
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
dfc4a7e to
ad3fd09
Compare
ad3fd09 to
359a18e
Compare
|
@RenaudWasTaken I agree! Thank you! |
cebf028 to
b167e8b
Compare
|
@stevvooe once the PR gets accepted in swarmkit should I do a seperate PR to update moby dependencies or should I update the deps in this PR ? |
|
@RenaudWasTaken Whatever is easiest for you! |
b167e8b to
1f9c26d
Compare
d7dd31c to
3581b3d
Compare
|
@stevvooe Rebased against master with the latests swarmkit revendoring |
|
This looks pretty good to me. The only concern I have is allowing the engine to define the resources (via the info endpoint as it does in in this PR) vs doing it at the node level. |
@cpuguy83 what do you mean by |
|
@RenaudWasTaken Sorry, for "node" level I mean on the swarm node object rather than the engine itself. |
|
@cpuguy83 we discussed that with @aaronlehmann before so I'll be quoting him in #2090 :)
and:
|
|
LGTM |
daemon/cluster/convert/service.go
Outdated
There was a problem hiding this comment.
I think this should be else if res.NamedResourceSpec != nil. These will be provided by users, and we can't assume that one of the two is non-nil.
Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
3581b3d to
87e1464
Compare
|
LGTM
|
|
CI is now green :) |
|
@aaronlehmann @cpuguy83 what is the process to integrate in the CLI ? |
|
@RenaudWasTaken Rebasing is done as needed. If you have changes that need to go into the CLI that require a bump of moby/moby, you can revendor in 1 commit and make your changes in a 2nd commit. |
Signed-off-by: Renaud Gaubert rgaubert@nvidia.com
Hi !
This implements support for Generic Resources in moby (after implementing it in swarmkit).
More details can be found on the issue here and the design doc
Thanks,