{"action":"created","issue":{"url":"https://api.github.com/repos/deis/deis/issues/3289","labels_url":"https://api.github.com/repos/deis/deis/issues/3289/labels{/name}","comments_url":"https://api.github.com/repos/deis/deis/issues/3289/comments","events_url":"https://api.github.com/repos/deis/deis/issues/3289/events","html_url":"https://github.com/deis/deis/issues/3289","id":61046626,"number":3289,"title":"Proposal feat(controller): add fine-grain scheduling policy","user":{"login":"aledbf","id":161571,"avatar_url":"https://avatars.githubusercontent.com/u/161571?v=3","gravatar_id":"","url":"https://api.github.com/users/aledbf","html_url":"https://github.com/aledbf","followers_url":"https://api.github.com/users/aledbf/followers","following_url":"https://api.github.com/users/aledbf/following{/other_user}","gists_url":"https://api.github.com/users/aledbf/gists{/gist_id}","starred_url":"https://api.github.com/users/aledbf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledbf/subscriptions","organizations_url":"https://api.github.com/users/aledbf/orgs","repos_url":"https://api.github.com/users/aledbf/repos","events_url":"https://api.github.com/users/aledbf/events{/privacy}","received_events_url":"https://api.github.com/users/aledbf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-13T11:47:47Z","updated_at":"2015-03-20T18:46:59Z","closed_at":null,"body":"The idea behind this is the creation of a default policy to schedule apps inside the cluster using only the patterns shared by different implementations in fleet (the only option for now), mesos (and kubernetes?).\r\nIt must be possible to define a default configuration for all the apps but if any app can have a custom policy that will override the default.\r\n\r\nThe idea of this proposal is to see if this makes sense to other users :)  and what other options to schedule can/should be supported. \r\n\r\n\r\nPolicies:\r\n- one instance per node\r\n- metadata\r\n\r\n\r\nproposed etcd content:\r\n```\r\n/deis/controller/schedulerModule                  -> [fleet | mesos]\r\n/deis/controller/schedulingPolicy/default         -> [onePerNode | metadata]\r\n/deis/controller/schedulingPolicy/apps/<app name> -> [onePerNode | metadata]\r\n```\r\n\r\nto define the metadata in any app we can use a env var like `DEIS_SCHEDULER_METADATA=\"rack=rack-1\"`\r\n\r\n*the definition in deis must be agnostic to the scheduler and only the controller can be aware of the semantic of every scheduler option*\r\n\r\n**Only one instance per node:**\r\n\r\nmesos:\r\n```\r\n{\r\n \"instances\": XX,\r\n \"constraints\": [\r\n   [\"hostname\", \"UNIQUE\"],\r\n   [\"<app name_type.vXXX>\", \"GROUP_BY\"]\r\n ]\r\n}\r\n```\r\n\r\nfleet:\r\n```\r\n{\r\n  \"section\": \"X-Fleet\",\r\n  \"name\": \"Conflicts\",\r\n  \"value\": \"<app name_type.vXXX>\"\r\n}\r\n```\r\n\r\n\r\n**Schedule using metadata:**\r\n\r\nmesos:\r\n```\r\n{\r\n  \"instances\": XX,\r\n  \"constraints\": [\r\n    [\"rack\", \"CLUSTER\", \"rack-1\"]\r\n  ]\r\n}\r\n```\r\n\r\nfleet:\r\n```\r\n{\r\n  \"section\": \"X-Fleet\",\r\n  \"name\": \"MachineMetadata\",\r\n  \"value\": \"rack=rack-1\"\r\n}\r\n```\r\n\r\nhttps://github.com/coreos/fleet/blob/master/Documentation/unit-files-and-scheduling.md\r\nhttps://github.com/mesosphere/marathon/blob/master/docs/docs/constraints.md#unique-operator\r\nhttps://github.com/mesosphere/marathon/blob/master/docs/docs/constraints.md#group_by-operator\r\nhttps://github.com/mesosphere/marathon/blob/master/docs/docs/constraints.md#cluster-operator\r\n"},"comment":{"url":"https://api.github.com/repos/deis/deis/issues/comments/84098321","html_url":"https://github.com/deis/deis/issues/3289#issuecomment-84098321","issue_url":"https://api.github.com/repos/deis/deis/issues/3289","id":84098321,"user":{"login":"gabrtv","id":231123,"avatar_url":"https://avatars.githubusercontent.com/u/231123?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrtv","html_url":"https://github.com/gabrtv","followers_url":"https://api.github.com/users/gabrtv/followers","following_url":"https://api.github.com/users/gabrtv/following{/other_user}","gists_url":"https://api.github.com/users/gabrtv/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrtv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrtv/subscriptions","organizations_url":"https://api.github.com/users/gabrtv/orgs","repos_url":"https://api.github.com/users/gabrtv/repos","events_url":"https://api.github.com/users/gabrtv/events{/privacy}","received_events_url":"https://api.github.com/users/gabrtv/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T18:46:58Z","updated_at":"2015-03-20T18:46:58Z","body":"@aledbf I'd like to take a closer look at this once #3134 lands in an optional \"Swarm Preview\"."}}