8000 feat(*): update from django 1.6 to 1.7 by helgi · Pull Request #90 · deis/controller · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Conversation

@helgi
Copy link
Contributor
@helgi helgi commented Dec 15, 2015

https://docs.djangoproject.com/en/1.7/releases/1.7/

Biggest one here is syncdb is replaced by migrate - it's still there but --migrate is no longer a flag. Part of that was to migrate us from south to native django migrations (done by the same guy) but starting from a clean slate on the migration

One thing to note is that get_user_model can't be used due to new App Loading logic, same goes for how we were doing default app names on the App class

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is auto called now

@technosophos
Copy link
Member

What's the risk level associated with this? Should we wait until after alpha?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default attribute has been removed? That would remove a lot of the boilerplate in save().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - Django 1.7 changes the application loading logic and does so not like it that we were accessing App in select_app_name and then throwing it into the SlugField - It has to be with loading of imports / operations and how they want to guarantee consistency and availability across the board

This caused the test runner (and others) to crap out and say "AppRegistry is not ready"

https://docs.djangoproject.com/en/1.7/releases/1.7/#app-loading-refactor is the relevant bit of the changelog

Django imports all application configurations and models as soon as it starts, through a deterministic and straightforward process. This should make it easier to diagnose import issues such as import loops.

@bacongobbler
Copy link
Member

This is a fairly risky change. We can't migrate over v1 databases to v2 with this change, which would be a huge win for us if we haven't changed the models significantly. IIRC south migrations are still supported in 1.7 so we should still be supporting them.

@helgi
Copy link
Contributor Author
helgi commented Dec 15, 2015

This can def wait - It was a late night change while waiting on things :)

South Migrations are not supported in Django 1.7 (see https://docs.djangoproject.com/en/1.7/topics/migrations/#upgrading-from-south and https://south.readthedocs.org/en/latest/releasenotes/1.0.html#library-migration-path)

I think running this against 1.x DB should be fine; All it does is assert that the schema is okay. What this could potentially look like is to do a 1.x release which brings people up to par with a 2.x release schema wise and then they switch over. It would have to be tested but you should be able to reduce your migrations to minimum (pruning) over time so I think this works the same way

Note we are not in the business of supporting multiple Djangos but https://docs.djangoproject.com/en/1.7/topics/migrations/#supporting-multiple-django-versions is semi relevant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.djangoproject.com/en/1.7/releases/1.7/#schema-migrations

syncdb is an alias for migrate but --migrate got removed so I figured I'd just get us up to scratch off the bat

@bacongobbler
Copy link
Member
8000

okay so my point is moot then. we should probably wait until alpha though since this isn't something we need to get done, and less things broken = happy release :)

@helgi
Copy link
Contributor Author
helgi commented Dec 15, 2015

Agreed - I hadn't figured I could get the current tests passing this quickly; Not that I'm highly confident right now given the fiasco i had last week ;-) I want the integration tests and other things in place before we do this

@mboersma
Copy link
Member

@helgi this is great--we need to move forward with Django just for security releases & bug fixes, so this is a good stepping stone (en route to 1.8 hopefully). I will try to review this soon.

@mboersma mboersma added this to the v2.0-beta1 milestone Dec 15, 2015
@helgi helgi changed the title feat(*): update from django 1.6 to 1.7 [WIP] feat(*): update from django 1.6 to 1.7 Dec 19, 2015
@helgi helgi force-pushed the django_1.7 branch 4 times, most recently from 5e03a6b to 50fd033 Compare December 25, 2015 06:12
@helgi
Copy link
Contributor Author
helgi commented Dec 29, 2015

Depends on #179

@helgi helgi force-pushed the django_1.7 branch 3 times, most recently from 96b2a83 to c139b1d Compare December 30, 2015 22:58
@slack
Copy link
Member
slack commented Dec 30, 2015

Testing image: quay.io/jhansen/workflow:git-96b2a83

~ $ kd describe po deis-workflow-amyic
Name:               deis-workflow-amyic
Namespace:          deis
Image(s):           quay.io/jhansen/workflow:git-96b2a83
Node:               ip-10-0-0-158.us-west-2.compute.internal/
Start Time:         Wed, 30 Dec 2015 15:07:42 -0800
Labels:             name=deis-workflow
Status:             Pending
Reason:
Message:
IP:
Replication Controllers:    deis-workflow (1/1 replicas created)
Containers:
  deis-workflow:
    Container ID:
    Image:      quay.io/jhansen/workflow:git-96b2a83
    Image ID:
    State:      Waiting
    Ready:      False
    Restart Count:  0
    Environment Variables:
      DEIS_DATABASE_USER:   deis
      DEIS_DATABASE_PASSWORD:   changeme123
Volumes:
  docker-socket:
    Type:   HostPath (bare host directory volume)
    Path:   /var/run/docker.sock
  minio-user:
    Type:   Secret (a secret that should populate this volume)
    SecretName: minio-user
  default-token-51eng:
    Type:   Secret (a secret that should populate this volume)
    SecretName: default-token-51eng
Events:
  FirstSeen LastSeen    Count   From                            SubobjectPath               Reason      Message
  ─────────   ────────    ───── ────                            ─────────────      
8000
       ──────      ───────
  11s       11s     1   {scheduler }                                            Scheduled   Successfully assigned deis-workflow-amyic to ip-10-0-0-158.us-west-2.compute.internal
  11s       11s     1   {kubelet ip-10-0-0-158.us-west-2.compute.internal}  implicitly required container POD   Pulled      Container image "gcr.io/google_containers/pause:0.8.0" already present on machine
  11s       11s     1   {kubelet ip-10-0-0-158.us-west-2.compute.internal}  implicitly required container POD   Created     Created with docker id e9f8705bfa05
  11s       11s     1   {kubelet ip-10-0-0-158.us-west-2.compute.internal}  implicitly required container POD   Started     Started with docker id e9f8705bfa05
  11s       11s     1   {kubelet ip-10-0-0-158.us-west-2.compute.internal}  spec.containers{deis-workflow}      Pulling     Pulling image "quay.io/jhansen/workflow:git-96b2a83"


~ $ kd logs deis-workflow-amyic
~ $ kd logs deis-workflow-amyic
~ $ kd logs deis-workflow-amyic
~ $ kd logs deis-workflow-amyic
~ $
~ $ kd logs deis-workflow-amyic
Operations to perform:
  Synchronize unmigrated apps: django_auth_ldap, corsheaders, guardian, registry, rest_framework, jsonfield
  Apply all migrations: authtoken, sessions, admin, sites, auth, contenttypes, api
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  No migrations to apply.
[2015-12-30 23:08:20 +0000] [136] [INFO] Starting gunicorn 19.3.0
[2015-12-30 23:08:20 +0000] [136] [INFO] Listening at: http://0.0.0.0:8000 (136)
[2015-12-30 23:08:20 +0000] [136] [INFO] Using worker: sync
[2015-12-30 23:08:20 +0000] [140] [INFO] Booting worker with pid: 140
[2015-12-30 23:08:20 +0000] [141] [INFO] Booting worker with pid: 141
[2015-12-30 23:08:20 +0000] [142] [INFO] Booting worker with pid: 142
Publishing DB state to etcd...
[2015-12-30 23:08:20 +0000] [143] [INFO] Booting worker with pid: 143
Done Publishing DB state to etcd.
deis-controller running...
[2015-12-30 23:08:20 +0000] [145] [INFO] Booting worker with pid: 145
workflow [django-17]$ host deis.chorizo.k8s.slack.io
deis.chorizo.k8s.slack.io is an alias for add17b661af4911e58ef70246788aeaf-1050466599.us-west-2.elb.amazonaws.com.
add17b661af4911e58ef70246788aeaf-1050466599.us-west-2.elb.amazonaws.com has address 52.35.175.1
workflow [django-17]$ cd ~/p/example-go/
example-go [master]$ g remote -v
origin  https://github.com/deis/example-go.git (fetch)
origin  https://github.com/deis/example-go.git (push)
example-go [master]$ deis2 register http://deis.chorizo.k8s.slack.io
username: jhansen
password:
password (confirm):
email: jhansen@deis.com
Registered jhansen
Logged in as jhansen
example-go [master]$ deis2 keys:add
Found the following SSH public keys:
1) deis-test.pub jhansen@plinth.local
2) google_compute_engine.pub jhansen@plinth.local
3) id_azure.pub jhansen@spall.local
4) id_boot2docker.pub jhansen@plinth.local
5) id_dsa.pub jhansen@spall.local
6) id_rsa.pub jhansen@plinth.local
7) id_subgenius.pub jason@subgenius.local
8) jhansen-ec2.pub jhansen-ec2
9) kube_aws_rsa.pub jhansen@plinth.local
0) Enter path to pubfile (or use keys:add <key_path>)
Which would you like to use with Deis? 7
Uploading id_subgenius.pub to deis... done
example-go [master]$ deis2 create
Creating Application... done, created expert-inventor
Git remote deis added
remote available at ssh://git@deis.chorizo.k8s.slack.io:2222/expert-inventor.git
example-go [master]$ git push deis master
Counting objects: 87, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (82/82), done.
Writing objects: 100% (87/87), 18.08 KiB | 0 bytes/s, done.
Total 87 (delta 40), reused 0 (delta 0)
-----> 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 1.7M
-----> Build complete.
-----> Launching app.
-----> Launching...
       done, expert-inventor:v2 deployed to Deis

       http://expert-inventor.localhost

       To learn more, use `deis help` or visit http://deis.io

To ssh://git@deis.chorizo.k8s.slack.io:2222/expert-inventor.git
 * [new branch]      master -> master
example-go [master]$ curl expert-inventor.chorizo.k8s.slack.io
Party-time by Deis
Release v2 on expert-inventor-v2-web-op6md
example-go [master]$

@slack slack added the LGTM1 label Dec 30, 2015
helgi added a commit that referenced this pull request Dec 31, 2015
[WIP] feat(*): update from django 1.6 to 1.7
@helgi helgi merged commit e639e2a into deis:master Dec 31, 2015
@helgi helgi deleted the django_1.7 branch December 31, 2015 00:20
@helgi helgi changed the title [WIP] feat(*): update from django 1.6 to 1.7 feat(*): update from django 1.6 to 1.7 Dec 31, 2015
aledbf pushed a commit to aledbf/workflow that referenced this pull request Mar 26, 2016
doc(load balancer): Expand detail on manual LB configuration
oliverisaac pushed a commit to myriadmobile/deis-controller that referenced this pull request Mar 27, 2019
fix(controller): check_image_access only when using docker
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.

6 participants

0