{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16316","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16316/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16316/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16316/events","html_url":"https://github.com/kubernetes/kubernetes/pull/16316","id":113457559,"number":16316,"title":"WIP/MESOS: Refactor scheduler","user":{"login":"sttts","id":730123,"avatar_url":"https://avatars.githubusercontent.com/u/730123?v=3","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/platform/mesos","name":"area/platform/mesos","color":"d4c5f9"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XXL","name":"size/XXL","color":"ee0000"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/mesosphere","name":"team/mesosphere","color":"d2b48c"}],"state":"open","locked":false,"assignee":{"login":"sttts","id":730123,"avatar_url":"https://avatars.githubusercontent.com/u/730123?v=3","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},"milestone":null,"comments":39,"created_at":"2015-10-26T21:43:05Z","updated_at":"2015-11-11T14:53:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16316","html_url":"https://github.com/kubernetes/kubernetes/pull/16316","diff_url":"https://github.com/kubernetes/kubernetes/pull/16316.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/16316.patch"},"body":"Main goals\r\n- modularize scheduler such that unit tests are possible (in contrast to the huge integation_test.go we have now\r\n- reduce complexity by reducing dependencies\r\n\r\nSteps:\r\n- [x] rename things with speaking identifiers\r\n- [x] move code out of the MesosScheduler into operations or the service\r\n- [x] turn plugin into a SchedulerLoop\r\n- [x] move SchedulerLoop instantiation out of the MesosScheduler\r\n- [x] remove ExecutorInfo from podtask.T and create it with the TaskInfo\r\n- [x] split task and offer registry from MesosScheduler\r\n- [x] introduce interfaces for all operations\r\n- [x] clean up package structure\r\n- [x] document architecture\r\n\r\n```                                                                                                                                                             \r\n                                                                                                                                                                \r\n                    ┌───────────────────────────────────────────────────────────────────────┐                                                                   \r\n                    │                ┌───────────────────────────────────────┐            ┌─┴──────────────────────┐             ┌───────────────┐              \r\n              ┌─────▼─────┐          │Queuer                                 │  Await()   │       podUpdates       │             │               │              \r\n              │  updates  │          │- Yield() *api.Pod                     ├──pod CRUD ─▶ (queue.HistoricalFIFO) ◀──reflector──▶pods ListWatch ├──apiserver──▶\r\n              └─────▲─────┘          │- Requeue(pod)/Dequeue(id)/Reoffer(pod)│   events   │                        │             │               │              \r\n                    │                └───────────────────▲───────────────────┘            └───────────┬────────────┘             └───────────────┘              \r\n                    │                                    │                                            │                                                         \r\n                    │                                    │                                            │                                                         \r\n                    └───────────────┐┌───────────────────▲────────────────────▲─────────────────────┐ └───────────────────────┐                                 \r\n                                    ││                                        │                     │    ┌────────────────────┼─────────────────┐               \r\n                ┌───────────────────┼┼──────────────────────────────────────┐ │ ┌───────────────────┼────┼───────────┐        │                 │               \r\n    ┌───────────▼──────────┐┌───────┴┴───────┐   ┌───────────────────┐   ┌──┴─┴─┴──────┐   ┌────────┴────┴───┐  ┌────▼────────▼─────────────┐   │               \r\n    │Binder (task launcher)││Deleter         │   │PodReconciler      │   │SchedulerLoop│   │  ErrorHandler   │  │SchedulerAlgorithm         │   │               \r\n    │- Bind(binding)       ││- DeleteOne(pod)│   │- Reconcile(pod)   │   │- Run()      │   │- Error(pod, err)│  │- Schedule(pod) -> NodeName│   │               \r\n    │                      ││                │◀──│                   │   │             │──▶│                 │  │                           │   │               \r\n    │               ┌─────┐││    ┌─────┐     │   │      ┌─────┐      │   │   ┌─────┐   │   │    ┌─────┐      │  │┌─────┐                    │   │               \r\n    └───────────────┤sched├┘└────┤sched├─────┘   └──────┤sched├───▲──┘   └───┤sched├───┘   └────┤sched├──────┘  └┤sched├──────────────┬─────┘   │               \r\n                    ├-│││-┴──────┴--││-┴────────────────┴--│--┴───┼──────────┴--│--┴────────────┴-│---┴──────────┴-│││-┤ ┌────────────▼─────────▼─────────┐     \r\n                    │ │││           ││                     │      │             │                 │                │││ │ │          podScheduler          │     \r\n                    │ ││└───────────▼┼─────────────────────▼──────┼─────────────▼─────────────────▼────────────────┘││ │ │    (e.g. fcfsPodScheduler)     │     \r\n                    │ │└─────────────┼────────────────────────────┼─────────────┼──────────────────▼────────────────┘│ │ │                                │     \r\n                    │ │              │                            │             │                  │                 │ │ │  scheduleOne(pod, offers ...)  │     \r\n                    │ │              │                            │             │                  │                 │ │ │     ┌──────────────────────────┤     \r\n                    │ │              │         ╲   │   │   │   ╱  │             │                  │                 ▼ │ │     │    allocationStrategy    │     \r\n                    │ │              │          ╲  └┐  │  ┌┘  ╱   │             │                  │                   │ │     │      - FitPredicate      │     \r\n                    │ │              │           ╲  │  │  │  ╱    │             │                  │                   │ │     │      - Procurement       │     \r\n                    │ │              │            ╲ └┐ │ ┌┘ ╱     │             │                  │                   │ └─────┴──────────────────────────┘     \r\n                    │┌▼────────────┐┌▼──────────┐┌─▼─▼─▼─▼─▼─┐┌───┴────────┐┌───▼───┐         ┌────▼───┐               │                                        \r\n                    ││LaunchTask(t)││KillTask(t)││sync.Mutex ││reconcile(t)││Tasks()│         │Offers()│               │                                        \r\n                    │└──────┬──────┘└─────┬─────┘└───────────┘└────────▲───┘└───┬───┘         └────┬───┘               │                                        \r\n                    │       │             │                            │        │                  │                   │                                        \r\n                    │       │             └──────────────────┐         │    ┌───▼────────────┐     │                   │                                        \r\n                    │       └──────────────────────────────┐ │         │    │podtask.Registry│     │                   │                                        \r\n                    │                                      │ │         │    └────────────────┘     │                   │           ┌──────────────────────┐     \r\n                    │                                      │ │         │                           │                   │           │                      │     \r\n                    │Scheduler                             │ └──────┐  │                           │                   │           │   A ──────────▶ B    │     \r\n                    └──────────────────────────────────────┼────────┼─┬│----┬──────────────────────┼───────────────────┘           │                      │     \r\n                    ┌──────────────────────────────────────┼────────┼─┤sched├──────────────────────┼─────────────────────────┐     │  A has a reference   │     \r\n                    │Framework                             │        │ └─────┘                 ┌────▼───┐                     │     │   on B and calls B   │     \r\n                    │                               ┌──────▼──────┐┌▼──────────┐              │Offers()│                     │     │                      │     \r\n                    │                               │LaunchTask(t)││KillTask(t)│              └────┬───┘                     │     └──────────────────────┘     \r\n                    │                               └─────────┬───┘└──────┬────┘          ┌────────▼───────┐                 │                                  \r\n                    │implements: mesos-go/scheduler.Scheduler └───────────▼               │offers.Registry │                 │                                  \r\n                    │                                                     │               └────────────────┘                 │                                  \r\n                    │                        ┌─────────────────┐       ┌──▼─────────────┐                                    │                                  \r\n                    └────────────────────────┤                 ├───────┤     Mesos      ├────────────────────────────────────┘                                  \r\n                                             │ TasksReconciler │       │   Scheduler    │                                                                       \r\n                                             │                 ├───────▶     Driver     │                                                                       \r\n                                             └─────────────────┘       └────────┬───────┘                                                                       \r\n                                                                                │                                                                               \r\n                                                                                │                                                                               \r\n                                                                                ▼                                                                               \r\n```                                                                                                                                                             "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/155803620","html_url":"https://github.com/kubernetes/kubernetes/pull/16316#issuecomment-155803620","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16316","id":155803620,"user":{"login":"s-urbaniak","id":375856,"avatar_url":"https://avatars.githubusercontent.com/u/375856?v=3","gravatar_id":"","url":"https://api.github.com/users/s-urbaniak","html_url":"https://github.com/s-urbaniak","followers_url":"https://api.github.com/users/s-urbaniak/followers","following_url":"https://api.github.com/users/s-urbaniak/following{/other_user}","gists_url":"https://api.github.com/users/s-urbaniak/gists{/gist_id}","starred_url":"https://api.github.com/users/s-urbaniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-urbaniak/subscriptions","organizations_url":"https://api.github.com/users/s-urbaniak/orgs","repos_url":"https://api.github.com/users/s-urbaniak/repos","events_url":"https://api.github.com/users/s-urbaniak/events{/privacy}","received_events_url":"https://api.github.com/users/s-urbaniak/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T14:53:40Z","updated_at":"2015-11-11T14:53:40Z","body":"@jdef :+1: looks good for you? ;-)"}}