Skip to content
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

Revendored Swarmkit #35326

Merged
merged 3 commits into from
Nov 7, 2017
Merged

Conversation

RenaudWasTaken
Copy link
Contributor

@RenaudWasTaken RenaudWasTaken commented Oct 28, 2017

includes moby/swarmkit#2419, which:

fixes #34825
fixes #34996
fixes #35046
fixes #35395

Hello!

- What I did

  • Revendored swarmkit to the latest commit to include the recent GenericResource change
  • Updated the Generic resource CLI to match it's new CLI format
  • Fixed the DockerSwarmSuite.TestSwarmVolumePlugin as the error message is now surfaced in a new field

- Description for the changelog
Revendored Swarmkit

@anshulpundir can you confirm that the revendoring does not require me to change moby/moby ?
Ping @thaJeztah

- Bumps

moby/swarmkit@28f91d8...de950a7

- A picture of a cute animal (not mandatory but encouraged)
jack-russell-2-1024x683

@yongtang
Copy link
Member

Looks like the following failure happens on all platform:

14:55:19 FAIL: docker_cli_swarm_unix_test.go:15: DockerSwarmSuite.TestSwarmVolumePlugin
14:55:19 
14:55:19 [d539f05da0b31] waiting for daemon to start
14:55:19 [d539f05da0b31] daemon started
14:55:19 
14:55:19 docker_cli_swarm_unix_test.go:22:
14:55:19     // Make sure task stays pending before plugin is available
14:55:19     waitAndAssert(c, defaultReconciliationTimeout, d.CheckServiceTasksInState("top", swarm.TaskStatePending, "missing plugin on 1 node"), checker.Equals, 1)
14:55:19 docker_utils_test.go:465:
14:55:19     c.Assert(v, checker, args...)
14:55:19 ... obtained int = 0
14:55:19 ... expected int = 1
14:55:19 
14:55:19 [d539f05da0b31] exiting daemon
14:55:20 

@yongtang yongtang added status/2-code-review status/failing-ci Indicates that the PR in its current state fails the test suite and removed status/0-triage labels Oct 29, 2017
@GordonTheTurtle
Copy link

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 "swarmkit-revendored" git@github.com:RenaudWasTaken/moby.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354008608
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 added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Oct 29, 2017
@RenaudWasTaken
Copy link
Contributor Author

After some work I found that the root cause of this bug was introduced by moby/swarmkit#2287

The error message is now surfaced in the Error field. I've added a commit to fix this,

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Oct 29, 2017
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Oct 29, 2017
@yongtang yongtang removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Oct 30, 2017
@thaJeztah
Copy link
Member

thaJeztah commented Oct 30, 2017

Thanks! There's another PR as well that bumps swarm kit (#34424), so one of both will have to rebase probably. I created a quick overview of changes included in this PR (currently);

moby/swarmkit@872861d...de950a7

From that list; included in this bump are:

@@ -171,7 +171,8 @@ type CommonConfig struct {
Experimental bool `json:"experimental"` // Experimental indicates whether experimental features should be exposed or not

// Exposed node Generic Resources
NodeGenericResources string `json:"node-generic-resources,omitempty"`
// e.g: ["orange=red", "orange=green", "orange=blue", "apple=3"]
NodeGenericResources []string `json:"node-generic-resources,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a test to test loading this configuration from a daemon.json configuration file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just added one :)

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Oct 30, 2017
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Oct 30, 2017
Copy link
Contributor

@anshulpundir anshulpundir left a comment

Choose a reason for hiding this comment

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

Should we also include moby/swarmkit@312be59? @thaJeztah

@RenaudWasTaken
Copy link
Contributor Author

RenaudWasTaken commented Oct 31, 2017

Thanks @thaJeztah for the list!
Including it and moby/swarmkit#2419 in the first post.

Can you point me to the mentioned PR revendoring swarmkit ?
EDIT: Found it :)

@thaJeztah
Copy link
Member

@anshulpundir ah! yes, missed that one in my overview; I updated the list, and updated the list at the top as well

@RenaudWasTaken #34424 was merged, so this PR now needs a rebase 😅; probably just amending the first commit ("Revendored swarmkit "), and running vndr again should do

Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
@RenaudWasTaken
Copy link
Contributor Author

RenaudWasTaken commented Nov 3, 2017

@thaJeztah Looks like it also fixed the integration test: https://github.com/moby/moby/pull/34424/files#diff-eb3f7d0d8dfa41106bb74d7e5dfe43ecR203

I've removed that commit.
Thanks for updating my first post!

@RenaudWasTaken
Copy link
Contributor Author

RenaudWasTaken commented Nov 6, 2017

@thaJeztah is this PR good to go ?
Hoping to revendor the CLI after this so we can get support of NVIDIA GPUs in swarm!

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

Thanks! Just some minor nits, but looks good otherwise

@@ -65,7 +65,8 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

flags.StringVar(&conf.MetricsAddress, "metrics-addr", "", "Set default address and port to serve the metrics api on")

flags.StringVar(&conf.NodeGenericResources, "node-generic-resources", "", "user defined resources (e.g. fpga=2;gpu={UUID1,UUID2,UUID3})")
flags.Var(opts.NewListOptsRef(&conf.NodeGenericResources, opts.ValidateSingleGenericResource), "node-generic-resource", "Advertise user defined resource")
Copy link
Member

Choose a reason for hiding this comment

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

nit: can you change user defined to user-defined here?

opts/opts.go Outdated
// i.e 'GPU=UID1' is valid however 'GPU:UID1' or 'UID1' isn't
func ValidateSingleGenericResource(val string) (string, error) {
if strings.Count(val, "=") < 1 {
return "", fmt.Errorf("bad attribute format `%s` expected argument of the for `name=value`", val)
Copy link
Member

Choose a reason for hiding this comment

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

This message looks incomplete ("argument of the for .. ")?

Looking at other messages, I think we use invalid ... for other similar messages (e.g.

return nil, fmt.Errorf("invalid MountType: %q", m.Type)
)

Perhaps something like:

invalid node-generic-resource format: expected 'name=value':

@MistyHacks perhaps you have a better suggestion?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's ok, if you also include a got portion to the error message. What is a "node-generic-resource"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MistyHacks the full design document is here.
The basic idea is that it's a way for a node to advertise user-defined resources

Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐮

@yongtang yongtang merged commit eec662b into moby:master Nov 7, 2017
@thaJeztah
Copy link
Member

Thanks @RenaudWasTaken - I think this needs an update to the documentation (as the format for the dockerd options changed); unfortunately those are not in this repository, but could you open a pull request for the dockerd command-line reference, and the man-page in the https://github.com/docker/cli repository?

@RenaudWasTaken
Copy link
Contributor Author

@thaJeztah will be doing this as part of docker/cli/pull/429

@thaJeztah
Copy link
Member

Perfect, thanks @RenaudWasTaken

@RenaudWasTaken
Copy link
Contributor Author

Looks like I'll have to revendor ~100 commits of docker/docker though :(

@thaJeztah
Copy link
Member

If you prefer, I can do a separate bump for all changes before yours

@RenaudWasTaken
Copy link
Contributor Author

@thaJeztah It would make things a lot easier :) Thanks!

On the other hand it does look like I'll still have to revendor docker because of the way parsing is done.

Basically parsing in the daemon is through swarmkit/api/genericresource.Parse and then docker/daemon/cluster/convert.GenericResourcesFromGRPC

Meaning that if I want to do the same in the CLI I'll need to add a lot of new dependencies. Because that'll mean vendoring docker/daemon/cluster/convert which has a lot of dependencies.

Should I copy swarmkit/api/genericresource.Parse in docker/cli or add the 10+ dependencies to the vendor.conf ?

@dnephin
Copy link
Member

dnephin commented Nov 8, 2017

The dependencies of swarmkit/api/genericresource/ are fine, it's just swarmkit/api which is already a dependency of docker/cli.

I would duplicate convert.GenericResourcesFromGRPC(). There's not much logic there, and daemon/cluster/convert is not an appropriate dependency for docker/cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants