-
Notifications
You must be signed in to change notification settings - Fork 53
ref(scheduler): clean up scheduler with better organisation #172
Conversation
502d9f7 to
69ec089
Compare
c12a2e8 to
99e650c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue for this? not blocking this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no issue for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, I mean an issue for the intermittent DNS errors, so we remember
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, seems like it's a well-known enough issue. Thanks
|
Do you need me to test this? |
|
I'd love if you could throw it on your cluster and run the integration tests against a real k8s cluster since we have no k8s tests, barely any mocking for it even. |
|
@helgi ok, will test shortly |
|
@helgi I built and pushed my own image with ENG000656:example-go aaronschlesinger$ kd logs -f deis-workflow-zsg3a
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
Migrating...
Running migrations for authtoken:
- Nothing to migrate.
- Loading initial data for authtoken.
Installed 0 object(s) from 0 fixture(s)
Running migrations for api:
- Migrating forwards to 0026_auto__chg_field_config_tags__chg_field_config_values__chg_field_config.
> api:0001_initial
Traceback (most recent call last):
File "./manage.py", line 13, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "/usr/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 103, in handle_noargs
management.call_command('migrate', **options)
File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 159, in call_command
return klass.execute(*args, **defaults)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/usr/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/usr/lib/python2.7/site-packages/south/migration/migrators.py", line 256, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/usr/lib/python2.7/site-packages/south/migration/migrators.py", line 331, in migrate_many
result = self.migrate(migration, database)
File "/usr/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
result = self.run(migration, database)
File "/usr/lib/python2.7/site-packages/south/migration/migrators.py", line 106, in run
south.db.db.current_orm = self.orm(migration)
File "/usr/lib/python2.7/site-packages/south/migration/migrators.py", line 281, in orm
return migration.orm()
File "/usr/lib/python2.7/site-packages/south/utils/__init__.py", line 62, in method
value = function(self)
File "/usr/lib/python2.7/site-packages/south/migration/base.py", line 443, in orm
return FakeORM(self.migration_class(), self.app_label())
File "/usr/lib/python2.7/site-packages/south/orm.py", line 48, in FakeORM
_orm_cache[args] = _FakeORM(*args)
File "/usr/lib/python2.7/site-packages/south/orm.py", line 127, in __init__
self.models[name] = self.make_model(app_label, model_name, data)
File "/usr/lib/python2.7/site-packages/south/orm.py", line 324, in make_model
field = self.eval_in_context(code, app, extra_imports)
File "/usr/lib/python2.7/site-packages/south/orm.py", line 235, in eval_in_context
raise ValueError("Cannot import the required field '%s'" % value)
ValueError: Cannot import the required field 'json_field.fields.JSONField' |
|
Ah hmm @slack ran another PR and didn't see this problem. Seems like the djangos didn't like the removal of the other Hmm I can either reintroduce it in a sep PR or we can land #90 and it won't be a problem anymore because the |
99e650c to
d00f8f1
Compare
|
@helgi things look better now. Output below: Workflow startup logs: ENG000656:workflow aaronschlesinger$ kd logs -f deis-workflow-pxwt0
Operations to perform:
Synchronize unmigrated apps: guardian, jsonfield, corsheaders, registry, rest_framework
Apply all migrations: authtoken, sess
8000
ions, admin, sites, auth, contenttypes, api
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
Running migrations:
Applying contenttypes.0001_initial... FAKED
Applying auth.0001_initial... FAKED
Applying admin.0001_initial... FAKED
Applying api.0001_initial... OK
Applying authtoken.0001_initial... FAKED
Applying sessions.0001_initial... FAKED
Applying sites.0001_initial... FAKED
[2015-12-31 00:41:03 +0000] [116] [INFO] Starting gunicorn 19.3.0
[2015-12-31 00:41:03 +0000] [116] [INFO] Listening at: http://0.0.0.0:8000 (116)
[2015-12-31 00:41:03 +0000] [116] [INFO] Using worker: sync
[2015-12-31 00:41:03 +0000] [120] [INFO] Booting worker with pid: 120
[2015-12-31 00:41:03 +0000] [124] [INFO] Booting worker with pid: 124
[2015-12-31 00:41:03 +0000] [125] [INFO] Booting worker with pid: 125
Publishing DB state to etcd...
Done Publishing DB state to etcd.
deis-controller running...Zero to ENG000656:example-go aaronschlesinger$ deis register deis.108.59.84.244.xip.io
username: arschles
password:
password (confirm):
email: arschles@gmail.com
Registered arschles
Logged in as arschles
ENG000656:example-go aaronschlesinger$ deis keys:add ~/.ssh/id_rsa.pub
Uploading id_rsa.pub to deis... done
ENG000656:example-go aaronschlesinger$ deis create gotest
Creating Application... done, created gotest
Git remote deis added
remote available at ssh://git@deis.108.59.84.244.xip.io:2222/gotest.git
ENG000656:example-go aaronschlesinger$ git push deis master
The authenticity of host '[deis.108.59.84.244.xip.io]:2222 ([108.59.84.244]:2222)' can't be established.
ECDSA key fingerprint is SHA256:0QSJc8AT8qKofdmh8vKJoIYgkk9Gv/tM/JXZkEAPFsk.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[deis.108.59.84.244.xip.io]:2222,[108.59.84.244]:2222' (ECDSA) to the list of known hosts.
Counting objects: 270, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (125/125), done.
Writing objects: 100% (270/270), 3.02 MiB | 732.00 KiB/s, done.
Total 270 (delta 148), reused 241 (delta 131)
-----> Starting build
-----> Go app detected
-----> Checking Godeps/Godeps.json file.
-----> Installing go1.4.2... done
-----> Running: godep go install -tags heroku ./...
-----> Discovering process types
Procfile declares types -> web
-----> Compiled slug size is 4.7M
-----> Build complete.
-----> Launching app.
-----> Launching...
done, gotest:v1 deployed to Deis
http://gotest.localhost
To learn more, use `deis help` or visit http://deis.io
To ssh://git@deis.108.59.84.244.xip.io:2222/gotest.git
* [new branch] master -> master
ENG000656:example-go aaronschlesinger$ curl gotest.108.59.84.244.xip.io
Powered by Deis
Release v2 on gotest-v2-web-v1un0Scale didn't work, where it did before: ENG000656:example-go aaronschlesinger$ deis releases -a gotest
=== gotest Releases
v1 2015-12-31T00:45:07UTC arschles created initial release
ENG000656:example-go aaronschlesinger$ deis scale web=4 -a gotest
Scaling processes... but first, coffee!
Error:
400 BAD REQUEST
detail: No build associated with this release |
d00f8f1 to
609bb8e
Compare
|
@arschles I did some fixes in there but I haven't had time to properly test it myself |
…thods grouped by resource type
609bb8e to
acc4b0c
Compare
|
@helgi did some testing with this. TL;DR is LGTM Longer explanation: it starts up fine from an empty DB (migrations don't seem to work, but that's expected afaik), and registering, adding keys and However, the app doesn't seem to be running after the Upon talking with you and @krancour I understand this bug may be happening because router and workflow don't agree on the annotations used for domain handling. Is that issue tracked somewhere (perhaps here?) Logs below. Startup: ENG000656:example-go aaronschlesinger$ kd logs -f deis-workflow-3uhat
system information:
Django Version: 1.9
Python 2.7.10
Operations to perform:
Apply all migrations: authtoken, sessions, admin, guardian, sites, auth, contenttypes, api
Running migrations:
Rendering model states... DONE
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying api.0001_initial... OK
Applying api.0002_auto_20151215_0352... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying authtoken.0001_initial... OK
Applying guardian.0001_initial... OK
Applying sessions.0001_initial... OK
Applying sites.0001_initial... OK
Applying sites.0002_alter_domain_unique... OK
[2016-01-05 00:27:25 +0000] [132] [INFO] Starting gunicorn 19.4.1
[2016-01-05 00:27:25 +0000] [132] [INFO] Listening at: http://0.0.0.0:8000 (132)
[2016-01-05 00:27:25 +0000] [132] [INFO] Using worker: sync
[2016-01-05 00:27:25 +0000] [139] [INFO] Booting worker with pid: 139
[2016-01-05 00:27:25 +0000] [140] [INFO] Booting worker with pid: 140
[2016-01-05 00:27:25 +0000] [141] [INFO] Booting worker with pid: 141
Publishing DB state to etcd...
Done Publishing DB state to etcd.
deis-controller running...Registering, saving key, pushing: ENG000656:example-go aaronschlesinger$ deis register deis.108.59.84.244.xip.io
username: arschles
password:
password (confirm):
email: arschles@gmail.com
Registered arschles
Logged in as arschles
ENG000656:example-go aaronschlesinger$ deis apps
=== Apps
ENG000656:example-go aaronschlesinger$ deis keys:add ~/.ssh/id_rsa.pub
Uploading id_rsa.pub to deis... done
ENG000656:example-go aaronschlesinger$ deis create gotest
Creating Application... done, created gotest
Git remote deis added
remote available at ssh://git@deis.108.59.84.244.xip.io:2222/gotest.git
ENG000656:example-go aaronschlesinger$ git push deis master
The authenticity of host '[deis.108.59.84.244.xip.io]:2222 ([108.59.84.244]:2222)' can't be established.
ECDSA key fingerprint is SHA256:LU+BUQcukbLu72ab+Q8hgTCfFzKYgUk2R7S5pJq+scg.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[deis.108.59.84.244.xip.io]:2222,[108.59.84.244]:2222' (ECDSA) to the list of known hosts.
Counting objects: 273, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (128/128), done.
Writing objects: 100% (273/273), 3.02 MiB | 669.00 KiB/s, done.
Total 273 (delta 151), reused 241 (delta 131)
-----> Starting build
-----> Go app detected
-----> Checking Godeps/Godeps.json file.
-----> Installing go1.4.2... done
-----> Running: godep go install -tags heroku ./...
-----> Discovering process types
Procfile declares types -> web
-----> Compiled slug size is 4.7M
-----> Build complete.
-----> Launching app.
-----> Launching...
done, gotest:v2 deployed to Deis
http://gotest.localhost
To learn more, use `deis help` or visit http://deis.io
To ssh://git@deis.108.59.84.244.xip.io:2222/gotest.git
* [new branch] master -> master
ENG000656:example-go aaronschlesinger$ deis info
=== gotest Application
updated: 2016-01-05T00:29:55UTC
uuid: 05325e2e-58be-49b3-b2d4-8df7bbc4de42
created: 2016-01-05T00:28:43UTC
url: gotest.localhost
owner: arschles
id: gotest
=== gotest Processes
--- web:
web.1 up (v3)
=== gotest Domains
gotest |
|
also @helgi can you remove the |
No... it was a transient issue that occurred because there was a router PR and a workflow PR that were complimentary and should have been merged in tandem, but were not. |
|
Ah ok. Ran into the router issue... Created, scaled up/down, created config... Looks ok |
ref(scheduler): clean up scheduler with better organisation
|
@krancour I see, makes sense. |
This doesn't touch logic, only moves things around within the
k8s.pyin the first commit and then in turn makes it the__init__It's a very simplified version of #48 - again, no code modifications here. Just sets the stage for more refactoring down the line