Skip to content

Added support for Generic Resources#33440

Merged
cpuguy83 merged 1 commit intomoby:masterfrom
RenaudWasTaken:genericresource
Jul 25, 2017
Merged

Added support for Generic Resources#33440
cpuguy83 merged 1 commit intomoby:masterfrom
RenaudWasTaken:genericresource

Conversation

@RenaudWasTaken
Copy link
Copy Markdown
Contributor

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,

Copy link
Copy Markdown

@aaronlehmann aaronlehmann left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: GenericResourcesToGRPC

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: GenericResourcesFromGRPC

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Both of these fields should have json:",omitempty"

@RenaudWasTaken RenaudWasTaken force-pushed the genericresource branch 3 times, most recently from ec6f956 to 6f558d1 Compare June 1, 2017 00:25
@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

@aaronlehmann I've addressed your issues, fixed vendors (I think) and compilation.
Should I also update api/swagger.yaml ?

@aaronlehmann
Copy link
Copy Markdown

aaronlehmann commented Jun 1, 2017 via email

@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

RenaudWasTaken commented Jun 1, 2017

@aaronlehmann I've create a ResourceObject object to encapsulate NanoCPUs and MemoryBytes which were hardcoded in every structures.

I'm not really sure about the choice of name but because there already exists a Resources object I don't have any other suggestions. Do you have some idea ?

Thanks!

@RenaudWasTaken RenaudWasTaken force-pushed the genericresource branch 3 times, most recently from 332f702 to 6be19d8 Compare June 2, 2017 01:39
@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

@aaronlehmann @stevvooe @ehazlett @tonistiigi PTAL :)
Thanks!

@tiborvass
Copy link
Copy Markdown
Contributor

I wonder how this impacts #33575 by @cpuguy83

@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

RenaudWasTaken commented Jun 12, 2017

@tiborvass I gave the plugin PR a quick look and it seems to me that it wouldn't impact it :)
Though I think that the current model would let your plugin request Generic resources which I think is something that seems reasonable ?

@cpuguy83
Copy link
Copy Markdown
Member

Agreed I don't think there is any impact.

vendor.conf Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @RenaudWasTaken 👋

You should be able to rebase and drop the swarmkit re-vendor now that a newer version is in moby via #33642.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks !

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jun 13, 2017
@GordonTheTurtle
Copy link
Copy Markdown

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ 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 -f

Amending updates the existing PR. You DO NOT need to open a new one.

@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jun 13, 2017
@stevvooe
Copy link
Copy Markdown
Contributor

@RenaudWasTaken I agree! Thank you!

@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

@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 ?

@stevvooe
Copy link
Copy Markdown
Contributor

@RenaudWasTaken Whatever is easiest for you!

@cyli cyli mentioned this pull request Jul 11, 2017
@RenaudWasTaken RenaudWasTaken force-pushed the genericresource branch 2 times, most recently from d7dd31c to 3581b3d Compare July 15, 2017 22:25
@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

@stevvooe Rebased against master with the latests swarmkit revendoring

@cpuguy83
Copy link
Copy Markdown
Member

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.
By "concern" here, I mean I'm not sure which is the right approach, not necessarily that I think there's something wrong with it.

@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

RenaudWasTaken commented Jul 16, 2017

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 doing it at the node level ?

@cpuguy83
Copy link
Copy Markdown
Member

@RenaudWasTaken Sorry, for "node" level I mean on the swarm node object rather than the engine itself.

@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

RenaudWasTaken commented Jul 18, 2017

@cpuguy83 we discussed that with @aaronlehmann before so I'll be quoting him in #2090 :)

The current behavior for the existing resources (NanoCPUs and MemoryBytes) is that they get filled in by Describe (see agent/exec/dockerapi/executor.go for the dockerapi executor implementation). I think we should follow this with generic resources, so that they are consistent with the existing resources, and because it's an easy way to address the hotplug case (Describe is called periodically, and the node is updated dynamically based on the result).

and:

But once this is all integrated in Docker, I think the source of truth should be the SystemInfo call, not information passed through Node.

@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

@cpuguy83 @stevvooe is there anything in this PR that needs to be changed ?

@stevvooe
Copy link
Copy Markdown
Contributor

LGTM

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
@aaronlehmann
Copy link
Copy Markdown

aaronlehmann commented Jul 25, 2017 via email

@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

CI is now green :)

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@cpuguy83 cpuguy83 merged commit 9319a8a into moby:master Jul 25, 2017
@RenaudWasTaken
Copy link
Copy Markdown
Contributor Author

@aaronlehmann @cpuguy83 what is the process to integrate in the CLI ?
It seems they don't rebase very often should I open an issue ?

@cpuguy83
Copy link
Copy Markdown
Member

cpuguy83 commented Aug 5, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants