-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Revendored Swarmkit #35326
Conversation
Looks like the following failure happens on all platform:
|
4b3625a
to
8f7ac41
Compare
Please sign your commits following these rules: $ 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. |
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, |
8f7ac41
to
f091918
Compare
f091918
to
094102c
Compare
@@ -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"` |
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.
Do we have a test to test loading this configuration from a daemon.json
configuration file?
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.
Just added one :)
990a354
to
6828193
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.
Should we also include moby/swarmkit@312be59? @thaJeztah
Thanks @thaJeztah for the list! Can you point me to the mentioned PR revendoring swarmkit ? |
@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 |
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
6828193
to
216abca
Compare
@thaJeztah Looks like it also fixed the integration test: https://github.com/moby/moby/pull/34424/files#diff-eb3f7d0d8dfa41106bb74d7e5dfe43ecR203 I've removed that commit. |
@thaJeztah is this PR good to go ? |
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! Just some minor nits, but looks good otherwise
cmd/dockerd/config.go
Outdated
@@ -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") |
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.
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) |
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.
This message looks incomplete ("argument of the for .. ")?
Looking at other messages, I think we use invalid ...
for other similar messages (e.g.
moby/daemon/cluster/convert/container.go
Line 296 in d91c5f4
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?
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 it's ok, if you also include a got
portion to the error message. What is a "node-generic-resource"?
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.
@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>
216abca
to
734346a
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.
LGTM, thanks!
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 🐮
Thanks @RenaudWasTaken - I think this needs an update to the documentation (as the format for the |
@thaJeztah will be doing this as part of docker/cli/pull/429 |
Perfect, thanks @RenaudWasTaken |
Looks like I'll have to revendor ~100 commits of docker/docker though :( |
If you prefer, I can do a separate bump for all changes before yours |
@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 ? |
The dependencies of I would duplicate |
includes moby/swarmkit#2419, which:
fixes #34825
fixes #34996
fixes #35046
fixes #35395
Hello!
- What I did
- 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)