X Tutup
Skip to content

Topology-aware scheduling#30725

Merged
thaJeztah merged 1 commit intomoby:masterfrom
aaronlehmann:topology
Mar 3, 2017
Merged

Topology-aware scheduling#30725
thaJeztah merged 1 commit intomoby:masterfrom
aaronlehmann:topology

Conversation

@aaronlehmann
Copy link

@aaronlehmann aaronlehmann commented Feb 3, 2017

This adds support for placement preferences in Swarm services (design doc: moby/swarmkit#1473, swarmkit PR: moby/swarmkit#1512). This feature allows services to be balanced over nodes based on a particular user-defined property, such as which datacenter or rack they are located in.

  • Convert PlacementPreferences between GRPC API and HTTP API
  • Add --placement-pref-add and --placement-pref-rm to CLI
  • Add support for placement preferences in service inspect --pretty
  • Add integration test

cc @aluzzardi @dongluochen @dnephin

Copy link
Author

Choose a reason for hiding this comment

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

Note: Constraints was misspelled here, and the extra - in the template on the line above caused the lines of text to get merged together. These problems are fixed here. Unfortunately it's not the first time I've noticed problems like this in the template. We should review it carefully.

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Design LGTM

@aaronlehmann aaronlehmann changed the title [WIP] Topology-aware scheduling Topology-aware scheduling Feb 7, 2017
@aaronlehmann
Copy link
Author

swarmkit PR was merged. No longer WIP.

Changed the command line syntax from spread,... to spread=... as suggested in moby/swarmkit#1512 (comment)

@vdemeester
Copy link
Member

@aaronlehmann some test failures

22:47:48 # github.com/docker/docker/cli/command/service
22:47:48 cli/command/service/update_test.go:63: undefined: updatePlacement

@vdemeester vdemeester added the status/failing-ci Indicates that the PR in its current state fails the test suite label Feb 8, 2017
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.

Design LGTM

@aaronlehmann
Copy link
Author

Fixed, sorry about that.

yongtang added a commit to yongtang/docker that referenced this pull request Feb 8, 2017
This fix updates SwarmKit to ed384f3.
Notable changes since last update (3ca4775):

1. Fix duplicated ports allocation with restarted swarm. (Docker issue moby#29247)
2. Topology-aware scheduling (Docker PR moby#30725)

Docker issue moby#29247 was labeled 1.13.1, though it is advised that
related SwarmKit changes only to be merged to master
(based on the feedback moby/swarmkit#1802 (comment))

This fix fixes moby#29247 (master only).
This fix is related to moby#30725.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

@aaronlehmann aaronlehmann removed status/failing-ci Indicates that the PR in its current state fails the test suite status/needs-vendoring labels Feb 11, 2017
@aaronlehmann
Copy link
Author

Rebased.

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 🐸
/cc @thaJeztah @vieux

Copy link
Member

Choose a reason for hiding this comment

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

missing a " 👼

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, fixed

@aaronlehmann
Copy link
Author

Thanks for the thoughtful response. This was my initial instinct, but using a comma-separated list has some serious disadvantages as well. See the discussion thread starting at moby/swarmkit#1512 (comment) where this was discussed, and the alternative of using a repeated flag was encouraged.

@dnephin
Copy link
Member

dnephin commented Feb 21, 2017

Looks like this needs a rebase.

Do we have other options that depend on ordering?

Yes we do, but Aaron noted that a change in order for most of those options is less significant than in this case.

@aaronlehmann
Copy link
Author

Rebased

@aluzzardi
Copy link
Member

I do agree with UX consistency as well...

--placement-pref would have the same behavior as --placement-pref-add during service create, it's just called differently...

@aaronlehmann
Copy link
Author

Then is there a consensus around calling it --placement-pref in service create and --placement-pref-add in service update?

It's not my favorite outcome, but I don't see another way to move forward.

@dnephin
Copy link
Member

dnephin commented Feb 27, 2017

Yes, I think that is the most consistent naming

This adds support for placement preferences in Swarm services.

- Convert PlacementPreferences between GRPC API and HTTP API
- Add --placement-pref, --placement-pref-add and --placement-pref-rm to CLI
- Add support for placement preferences in service inspect --pretty
- Add integration test

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@aaronlehmann
Copy link
Author

Okay, I've updated this to use --placement-pref for service create.

@vieux
Copy link
Contributor

vieux commented Feb 27, 2017

that's very cool, LGTM!

@aaronlehmann
Copy link
Author

@thaJeztah: Are you happy with the latest change to the CLI flags?

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, new names for the flags work 👍

I see there's no man page yet for these commands, so I won't hold up this PR because of that (it's something to be addressed in general)

@davidhiendl
Copy link

Is this supported when deploying services via docker-compose file yet? I can't seem to find any reference to it.

@aaronlehmann
Copy link
Author

I don't believe it is supported in compose yet. I just filed #32584 to track this.

dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
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.

10 participants

X Tutup