Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Add --scheduler option in manage command to prepare pluggable schedulers #178

Closed

Conversation

francisbouvier
Copy link

Hi,

I've made some changes in order to add pluggable schedulers in the future.
Scheduler is an interface and SwarmScheduler its default implementation.

My idea is to add other scheduler, e.g. an ApiScheduler to connect to external services.

@vieux
Copy link
Contributor

vieux commented Dec 16, 2014

Hi @francisbouvier thanks for the contribution!

First tests are failing: https://travis-ci.org/docker/swarm/builds/44228278
Second, I have an issue here about the --strategy flag (and the future --filter) because if you don't use --scheduler swarm, theses flags are useless right ?

I would love to see your ApiScheduler or any other scheduler before merging this, to make sure the interface is correct.

@vieux vieux self-assigned this Dec 16, 2014
@francisbouvier
Copy link
Author

Thanks for your quick reply.

I've updated the pull request, tests are passing now: https://travis-ci.org/docker/swarm/builds/44246565.
Sorry about that.

Yes the --strategy and --filter flags are only used with the default swarm scheduler.
May be we can have a --scheduler-opts common flag (as pluggable scheduler may have their own options too) ?

@vieux
Copy link
Contributor

vieux commented Dec 16, 2014

@francisbouvier why not, that's why I'd love to see your scheduler

@vieux
Copy link
Contributor

vieux commented Dec 16, 2014

😈

@francisbouvier
Copy link
Author

@vieux I'm working on it :)

…e schedulers

Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
@francisbouvier
Copy link
Author

@vieux

Hi,

I've commited the ApiScheduler.

For the option I've created a --scheduler-option.
It's a cli.StringSliceFlag wich content is parsed as <option_name>:<option_content> and passed to the Initialize method of the Scheduler.
So the default options (for the SwarmScheduler) are --scheduler-option=strategy:binpacking:0.05 and --scheduler-option=filters:health,label,port.
Option for the ApiScheduler is --scheduler-option=url<ip>:<port>.

I've created a basic implementation of the corresponding API swarm-scheduler-api. It's a very basic API with random strategy, for tests purposes.

@vieux
Copy link
Contributor

vieux commented Dec 19, 2014

@francisbouvier thanks, I'll get back to this tomorrow once I have tried it out.

@vieux
Copy link
Contributor

vieux commented Dec 23, 2014

@francisbouvier sorry for the delay. If I understand correctly your api scheduler creates the container on the node ? I think it should only return the right node and let swarm create the container.

@francisbouvier
Copy link
Author

@vieux
Yes, the external API creates the container. If you want to plug to an external scheduler like Mesos-Marathon or Kubernetes I think you have to let him creates the container (if I understand well how they works).
Using only the node selection can be usefull too, but it's more a pluggable strategy.

@vieux vieux mentioned this pull request Jan 6, 2015
@vieux
Copy link
Contributor

vieux commented Jan 20, 2015

@francisbouvier thank for this, but it's a bit too abstract for us to merge. Be sure we are going to discuss the scheduler API publicly and I'm going to include you in the discussions.

@vieux vieux closed this Jan 20, 2015
@vieux
Copy link
Contributor

vieux commented Jan 20, 2015

See #213 for reference

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants