Skip to content

Commit 469ee72

Browse files
Gabriel MonroyMatthew Fisher
authored andcommitted
refactor(scheduler): use coreos/fleet for container scheduling
- add concept of cluster for external job scheduling - first pass at new container api with mock scheduler - simplify build + config = release - deprecate configuration management and provider packages - deprecate node management features (formation/layer/node/provider/flavor)
1 parent 50e4216 commit 469ee72

52 files changed

Lines changed: 1103 additions & 4789 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

controller/api/admin.py

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,10 @@
1111

1212
from .models import App
1313
from .models import Build
14+
from .models import Cluster
1415
from .models import Config
1516
from .models import Container
16-
from .models import Flavor
17-
from .models import Formation
1817
from .models import Key
19-
from .models import Layer
20-
from .models import Node
21-
from .models import Provider
2218
from .models import Release
2319

2420

@@ -27,8 +23,8 @@ class AppAdmin(GuardedModelAdmin):
2723
in the Django admin.
2824
"""
2925
date_hierarchy = 'created'
30-
list_display = ('id', 'owner', 'formation')
31-
list_filter = ('owner', 'formation')
26+
list_display = ('id', 'owner', 'cluster')
27+
list_filter = ('owner', 'cluster')
3228
admin.site.register(App, AppAdmin)
3329

3430

@@ -42,6 +38,16 @@ class BuildAdmin(admin.ModelAdmin):
4238
admin.site.register(Build, BuildAdmin)
4339

4440

41+
class ClusterAdmin(admin.ModelAdmin):
42+
"""Set presentation options for :class:`~api.models.Cluster` models
43+
in the Django admin.
44+
"""
45+
date_hierarchy = 'created'
46+
list_display = ('id', 'owner',)
47+
list_filter = ('owner',)
48+
admin.site.register(Cluster, ClusterAdmin)
49+
50+
4551
class ConfigAdmin(admin.ModelAdmin):
4652
"""Set presentation options for :class:`~api.models.Config` models
4753
in the Django admin.
@@ -57,31 +63,11 @@ class ContainerAdmin(admin.ModelAdmin):
5763
in the Django admin.
5864
"""
5965
date_hierarchy = 'created'
60-
list_display = ('short_name', 'owner', 'formation', 'app', 'status')
61-
list_filter = ('owner', 'formation', 'app', 'status')
66+
list_display = ('short_name', 'owner', 'cluster', 'app', 'state')
67+
list_filter = ('owner', 'cluster', 'app', 'state')
6268
admin.site.register(Container, ContainerAdmin)
6369

6470

65-
class FlavorAdmin(admin.ModelAdmin):
66-
"""Set presentation options for :class:`~api.models.Flavor` models
67-
in the Django admin.
68-
"""
69-
date_hierarchy = 'created'
70-
list_display = ('id', 'owner', 'provider')
71-
list_filter = ('owner', 'provider')
72-
admin.site.register(Flavor, FlavorAdmin)
73-
74-
75-
class FormationAdmin(admin.ModelAdmin):
76-
"""Set presentation options for :class:`~api.models.Formation` models
77-
in the Django admin.
78-
"""
79-
date_hierarchy = 'created'
80-
list_display = ('id', 'owner')
81-
list_filter = ('owner',)
82-
admin.site.register(Formation, FormationAdmin)
83-
84-
8571
class KeyAdmin(admin.ModelAdmin):
8672
"""Set presentation options for :class:`~api.models.Key` models
8773
in the Django admin.
@@ -92,36 +78,6 @@ class KeyAdmin(admin.ModelAdmin):
9278
admin.site.register(Key, KeyAdmin)
9379

9480

95-
class LayerAdmin(admin.ModelAdmin):
96-
"""Set presentation options for :class:`~api.models.Layer` models
97-
in the Django admin.
98-
"""
99-
date_hierarchy = 'created'
100-
list_display = ('id', 'owner', 'formation', 'flavor', 'proxy', 'runtime', 'config')
101-
list_filter = ('owner', 'formation', 'flavor')
102-
admin.site.register(Layer, LayerAdmin)
103-
104-
105-
class NodeAdmin(admin.ModelAdmin):
106-
"""Set presentation options for :class:`~api.models.Node` models
107-
in the Django admin.
108-
"""
109-
date_hierarchy = 'created'
110-
list_display = ('id', 'owner', 'formation', 'fqdn')
111-
list_filter = ('owner', 'formation')
112-
admin.site.register(Node, NodeAdmin)
113-
114-
115-
class ProviderAdmin(admin.ModelAdmin):
116-
"""Set presentation options for :class:`~api.models.Provider` models
117-
in the Django admin.
118-
"""
119-
date_hierarchy = 'created'
120-
list_display = ('id', 'owner', 'type')
121-
list_filter = ('owner', 'type')
122-
admin.site.register(Provider, ProviderAdmin)
123-
124-
12581
class ReleaseAdmin(admin.ModelAdmin):
12682
"""Set presentation options for :class:`~api.models.Release` models
12783
in the Django admin.

controller/api/exceptions.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,6 @@ class Meta:
2424
abstract = True
2525

2626

27-
class BuildNodeError(AbstractDeisException):
28-
"""
29-
Indicates a problem in building or bootstrapping a node.
30-
"""
31-
status_code = status.HTTP_401_UNAUTHORIZED
32-
33-
34-
class BuildFormationError(AbstractDeisException):
35-
"""
36-
Indicates a problem in creating a formation.
37-
"""
38-
status_code = status.HTTP_400_BAD_REQUEST
39-
40-
4127
class UserRegistrationException(AbstractDeisException):
4228
"""
4329
Indicates that there was a problem registering the user.

controller/api/fixtures/dev.json

Lines changed: 5 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -43,87 +43,19 @@
4343
"name": "deis-controller.local"
4444
}
4545
},
46-
{
47-
"pk": "1ef7e631-79e9-40f5-9702-e2edeab2d066",
48-
"model": "api.provider",
49-
"fields": {
50-
"updated": "2014-01-27T22:45:55.145Z",
51-
"created": "2014-01-27T22:23:49.861Z",
52-
"owner": [
53-
"devuser"
54-
],
55-
"type": "vagrant",
56-
"id": "vagrant",
57-
"creds": "{}"
58-
}
59-
},
60-
{
61-
"pk": "74ae11e2-6080-4817-934b-826d85418ce8",
62-
"model": "api.provider",
63-
"fields": {
64-
"updated": "2014-01-27T22:23:49.857Z",
65-
"created": "2014-01-27T22:23:49.857Z",
66-
"owner": [
67-
"devuser"
68-
],
69-
"type": "static",
70-
"id": "static",
71-
"creds": "{}"
72-
}
73-
},
74-
{
75-
"pk": "4b65ecb5-3c05-4d9b-9efa-e6b8195099ce",
76-
"model": "api.flavor",
77-
"fields": {
78-
"updated": "2014-01-27T22:23:52.079Z",
79-
"created": "2014-01-27T22:23:52.078Z",
80-
"params": "{\"memory\": \"512\"}",
81-
"provider": "1ef7e631-79e9-40f5-9702-e2edeab2d066",
82-
"owner": [
83-
"devuser"
84-
],
85-
"id": "vagrant-512"
86-
}
87-
},
88-
{
89-
"pk": "e62447cb-c08d-4e79-b3a4-ad19e52ad616",
90-
"model": "api.flavor",
91-
"fields": {
92-
"updated": "2014-01-27T22:23:52.092Z",
93-
"created": "2014-01-27T22:23:52.092Z",
94-
"params": "{\"memory\": \"2048\"}",
95-
"provider": "1ef7e631-79e9-40f5-9702-e2edeab2d066",
96-
"owner": [
97-
"devuser"
98-
],
99-
"id": "vagrant-2048"
100-
}
101-
},
102-
{
103-
"pk": "ebddfd0f-9d16-42b7-9f74-ac9ba4479234",
104-
"model": "api.flavor",
105-
"fields": {
106-
"updated": "2014-01-27T22:23:52.090Z",
107-
"created": "2014-01-27T22:23:52.090Z",
108-
"params": "{\"memory\": \"1024\"}",
109-
"provider": "1ef7e631-79e9-40f5-9702-e2edeab2d066",
110-
"owner": [
111-
"devuser"
112-
],
113-
"id": "vagrant-1024"
114-
}
115-
},
11646
{
11747
"pk": "8b196fb8-5774-4512-b3cc-569af8894a6c",
118-
"model": "api.formation",
48+
"model": "api.cluster",
11949
"fields": {
12050
"updated": "2014-01-27T23:32:51.173Z",
12151
"created": "2014-01-27T23:32:02.148Z",
12252
"domain": "deis-controller.local",
12353
"owner": [
12454
"devuser"
125-
],
126-
"nodes": "{}",
55+
],
56+
"hosts": "host1,host2,host3",
57+
"auth": "base64string",
58+
"options": "{}",
12759
"id": "dev"
12860
}
12961
}

controller/api/fixtures/test_sharing.json

Lines changed: 7 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -54,81 +54,16 @@
5454
}
5555
},
5656
{
57-
"pk": "3daa9d07-d6b8-40c2-869d-792e2438140d",
58-
"model": "api.flavor",
59-
"fields": {
60-
"updated": "2013-11-25T21:58:46.672Z",
61-
"created": "2013-11-25T21:58:46.671Z",
62-
"params": "{}",
63-
"provider": "d879d3c5-1953-4b1e-92ef-e14ab3d52cf8",
64-
"owner": 2,
65-
"id": "mock-west"
66-
}
67-
},
68-
{
69-
"pk": "79121781-9cbb-4300-94ac-59131a0bc487",
70-
"model": "api.flavor",
71-
"fields": {
72-
"updated": "2013-11-25T21:59:31.237Z",
73-
"created": "2013-11-25T21:59:31.237Z",
74-
"params": "{}",
75-
"provider": "1f251c8b-c72b-4616-9c92-126890bf1567",
76-
"owner": 3,
77-
"id": "mock-west"
78-
}
79-
},
80-
{
81-
"pk": "1f251c8b-c72b-4616-9c92-126890bf1567",
82-
"model": "api.provider",
83-
"fields": {
84-
"updated": "2013-11-25T21:59:31.227Z",
85-
"created": "2013-11-25T21:59:31.227Z",
86-
"owner": 3,
87-
"type": "mock",
88-
"id": "mock",
89-
"creds": "{}"
90-
}
91-
},
92-
{
93-
"pk": "d879d3c5-1953-4b1e-92ef-e14ab3d52cf8",
94-
"model": "api.provider",
95-
"fields": {
96-
"updated": "2013-11-25T21:58:46.658Z",
97-
"created": "2013-11-25T21:58:46.658Z",
98-
"owner": 2,
99-
"type": "mock",
100-
"id": "mock",
101-
"creds": "{}"
102-
}
103-
},
104-
{
105-
"pk": "f74ab47c-d20e-4cb5-893a-9bcda9f40f08",
106-
"model": "api.layer",
107-
"fields": {
108-
"updated": "2013-11-25T22:09:38.150Z",
109-
"created": "2013-11-25T22:09:38.150Z",
110-
"ssh_port": 22,
111-
"ssh_username": "ubuntu",
112-
"formation": "2345a3e0-867e-4839-928b-449380dd99f7",
113-
"proxy": true,
114-
"owner": 2,
115-
"ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUnuepSvLVxC1XUbZE2LAMdu4tqOSJFx9aZ2HMY7xmeYovHVUFOb8+AGgwhOfHuAh7E1N3dB4/HbbUoO/l6eyU6RHiQn7eq0OltaGn1WgGLNSjDRZwf/4MoFAKGZr3BUGQ6cN9O65K8FsnK0urQTRoTmA5m/QtFGBC9AJLu1/XWIYs/IHs/HrVWecsAMdM/6ulgdrsosammhkv89mfBSJHY5Wuy1Eg1EArG/cv5Bi0LRDuzz3j1sASKZIug82N5QfVZ4xRPz0ZEpotFOAu7KC4r078XQakBH+arphTunyScTZO30ysak2SACBT9kprbIW8FXwf23e19ygAFDo8l1/J",
116-
"flavor": "3daa9d07-d6b8-40c2-869d-792e2438140d",
117-
"runtime": true,
118-
"config": "{}",
119-
"id": "runtime",
120-
"ssh_private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEA1J7nqUry1cQtV1G2RNiwDHbuLajkiRcfWmdhzGO8ZnmKLx1V\nBTm/PgBoMITnx7gIexNTd3QePx221KDv5enslOkR4kJ+3qtDpbWhp9VoBizUow0W\ncH/+DKBQChma9wVBkOnDfTuuSvBbJytLq0E0aE5gOZv0LRRgQvQCS7tf11iGLPyB\n7Px61VnnLADHTP+rpYHa7KLGppoZL/PZnwUiR2OVrstRINRAKxv3L+QYtC0Q7s89\n49bAEimSLoPNjeUH1WeMUT89GRKaLRTgLuyguK9O/F0GpAR/mq6YU7p8knE2Tt9M\nrGpNkgAgU/ZKa2yFvBV8H9t3tfcoABQ6PJdfyQIDAQABAoIBADZuwAwdPfHwGVOD\nfdA+UUO/ptZVqLxYCRTR5r22wuLRNsk9DykZUZaD8CiLvfLpcHJhzjqEpcGuz8G7\nue74ZjLxQDzWnThQTC8+QrZ+8fSywXVEwnvmqJl+6T7Ms1mOJOz+i6eiAcr5obxz\nXxnmxY32krfs7yQjVUmOwo+01qKAdadfnOoOCLTGc/UG7IEsutjtu18x7nkvDs0s\nj12t/osJ8OBWXpwbitYYxSUkVPrivyvO8W5yvKPRpsSrSD7yDLr1SHNp1OHqZbed\nDZJHx8eXdZxmthxRW4Vb8H2nDRZznpUs3VDuevghaD5VmoLgeYf15ogtoMApqjaw\ncXF5MckCgYEA3QJz7jWKWQ3774FWDT6Q8kHoJdYDEr4k6S545v9pHt0H0YeN2AGG\nOBmDIca5CBN37nwT0UR8eXZYxLw6RaEiF1VC7Ld6j4L9k3USYVCYJm/epESh+b8X\nm1MrKbqzc7auJF647VQ/1DmdZ68l+df8D0i5m28w2vJ69sDSPARUe38CgYEA9khz\nVVi9X4f3ore24R2UiIm0zRcnOuT8b3IAyIm9NiXnQcDmhKZtkiEa74DjIvMLV4Hd\nzA5GupeRxxgceaPK+Fu8sccUmGlyr5hSfahyx3/4KrwuXPPyiid6zFl/9XUvuOkM\nTdyb70AWypdbwrrCdBBP6GjUOOMvYKIevq+46LcCgYAS09Wqclcx1PYkZiE9iZnx\neVncd0nVu+sLDlFwZEvBPFUhLWoQ/7g+aTX5l6NFo9rwrxNFHY95DXLsd5iDPAHa\neQH1hn/jX+ZYPH3vWl1L0PXnio096GCLc99Wc7g74FEfeg5I8YdqfeoB3jLfAN5R\nMwHU0vkXfdap1K1UPY4w4wKBgGwFgRi5EG67S2GCZOM+PyzYAYZHFnzdfN9AyJks\n2OHMJC+R9UnPWZXTkWXlSTrGEX5zRp4+0MT8wALsT2kG73qZeh0bravf7F6aV+wn\nmxhnx6iu20MH+KSiBlllFBvMJ39aMHxiO77nhFedpbC2i52une3ZNOQyuVAQK54F\novvnAoGBAKqCEF0HCEmDIMyWy4dZhwA+9+I6q1hmXVuVZxSk1iTO7S4rKT590jAl\nWcRw/kS3rdrmLZvoBYnIOUJk356TCVNOVDwp3CXmD9/P/GIXzhWQtScZdBd91ekU\n4h+84S5yGdaF3SEJz1+UIdlh1lWxndBVyFucuSI0RF/FOB9jK7iE\n-----END RSA PRIVATE KEY-----"
121-
}
122-
},
123-
{
124-
"pk": "2345a3e0-867e-4839-928b-449380dd99f7",
125-
"model": "api.formation",
57+
"pk": "80e9db5a-d394-41c7-b153-3ea0314dc8ca",
58+
"model": "api.cluster",
12659
"fields": {
12760
"updated": "2013-11-25T22:09:36.726Z",
12861
"created": "2013-11-25T22:09:36.726Z",
129-
"domain": null,
62+
"domain": "autotest.local",
13063
"owner": 2,
131-
"nodes": "{}",
64+
"hosts": "host1,host2,host3",
65+
"auth": "base64string",
66+
"options": "{}",
13267
"id": "autotest-1"
13368
}
13469
},
@@ -138,9 +73,8 @@
13873
"fields": {
13974
"updated": "2013-11-25T22:09:36.726Z",
14075
"created": "2013-11-25T22:09:36.726Z",
141-
"formation": "2345a3e0-867e-4839-928b-449380dd99f7",
76+
"cluster": "80e9db5a-d394-41c7-b153-3ea0314dc8ca",
14277
"owner": 2,
143-
"containers": "{}",
14478
"id": "autotest-1-app"
14579
}
14680
}

0 commit comments

Comments
 (0)