10BC0 feat(*): update django from 1.7 to 1.8 by helgi · Pull Request #101 · 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 16, 2015

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

Notable changes:

Note: django_auth_ldap is disabled since it causes a migration issues I haven't been able to debug

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

Depends on #208

@helgi helgi force-pushed the django_1.8 branch 4 times, most recently from b8d44a9 to e19e297 Compare December 30, 2015 19:40
@helgi helgi changed the title WIP: feat(*): update django from 1.7 to 1.8 feat(*): update django from 1.7 to 1.8 Dec 31, 2015
@slack
Copy link
Member
slack commented Jan 1, 2016

Image: quay.io/jhansen/workflow:git-10a633f

~ $ kd logs deis-workflow-y9dfq -f
system information:
WARNING Cannot synchronize with etcd cluster
Django Version: 1.8.7
Python 2.7.10

Registration works just fine:

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:
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 bamboo-fireball
fatal: remote deis already exists.
To replace the existing git remote entry, run:
  git remote rename deis deis.old && deis git:remote -a bamboo-fireball
Error: exit status 128
example-go [master]$ git rm deis
fatal: pathspec 'deis' did not match any files
example-go [master]$ g remote rm deis
example-go [master]$ deis2 git:remote -a bamboo-fireball
Git remote deis added
example-go [master]$

Looks like apps and ps response bodies aren't working with the client:

example-go [master]$ deis2 apps
Error: json: cannot unmarshal array into Go value of type map[string]interface {}

Request:
2015-12-31 18:13:19 GET http://deis.chorizo.k8s.slack.io/v2/apps/?page_size=100
                        ← 200 application/json 182B 176ms

Response:
Server:                 nginx/1.9.6
Date:                   Fri, 01 Jan 2016 02:13:20 GMT
Content-Type:           application/json
Transfer-Encoding:      chunked
Connection:             close
Vary:                   Accept-Encoding
DEIS_PLATFORM_VERSION:  2.0.0-dev
Allow:                  GET, POST, HEAD, OPTIONS
DEIS_API_VERSION:       2.0
Content-Encoding:       gzip
content-length:         182
[decoded gzip] JSON                                                                                                                                                                                                                   [m:Auto]
[
    {
        "created": "2016-01-01T01:47:17UTC",
        "id": "bamboo-fireball",
        "owner": "jhansen",
        "structure": {
            "web": 10
        },
        "updated": "2016-01-01T01:54:16UTC",
        "url": "bamboo-fireball.localhost",
        "uuid": "dbf81612-f89e-4e55-9484-5cef1c664351"
    }
]
example-go [master]$ deis2 ps -a bamboo-fireball
Error: json: cannot unmarshal array into Go value of type map[string]interface {}

>> GET http://deis.chorizo.k8s.slack.io/v2/apps/bamboo-fireball/containers/?page_size=100
       ← 200 application/json 304B 321ms

Server:                 nginx/1.9.6
Date:                   Fri, 01 Jan 2016 02:19:50 GMT
Content-Type:           application/json
Transfer-Encoding:      chunked
Connection:             close
Vary:                   Accept-Encoding
DEIS_PLATFORM_VERSION:  2.0.0-dev
Allow:                  GET, HEAD, OPTIONS
DEIS_API_VERSION:       2.0
Content-Encoding:       gzip
content-length:         304
[decoded gzip] Raw                                                                                                                                                                                                                     [m:Raw]
[{"owner":"jhansen","app":"bamboo-fireball","release":"v4","type":"web","num":1,"state":"up","created":"2016-01-01T01:52:34UTC","updated":"2016-01-01T01:52:34UTC","uuid":"e7151ae2-4f70-4822-a7b8-deee96e78897"},{"owner":"jhansen","app":"ba
mboo-fireball","release":"v4","type":"web","num":2,"state":"up","created":"2016-01-01T01:53:16UTC","updated":"2016-01-01T01:53:16UTC","uuid":"2100ce42-d719-4758-b15c-9db45f424be8"},{"owner":"jhansen","app":"bamboo-fireball","release":"v4"
,"type":"web","num":3,"state":"up","created":"2016-01-01T01:53:16UTC","updated":"2016-01-01T01:53:16UTC","uuid":"708c353b-ab85-4bbe-a177-445024bae35b"},{"owner":"jhansen","app":"bamboo-fireball","release":"v4","type":"web","num":4,"state"
:"up","created":"2016-01-01T01:53:16UTC","updated":"2016-01-01T01:53:16UTC","uuid":"06577f0f-5218-4ec3-bda4-e468fe104f09"},{"owner":"jhansen","app":"bamboo-fireball","release":"v4","type":"web","num":5,"state":"up","created":"2016-01-01T0
1:53:16UTC","updated":"2016-01-01T01:53:16UTC","uuid":"97257c8c-2130-448a-a2f7-f498f02120e8"}]

@helgi
Copy link
Contributor Author
helgi commented Jan 1, 2016

Ah hmm I will look at that - this PR updates rest framework and I did have to change tests because of return format but given I couldn't track it down to django or drf then I thought it was the test client in django.

Hopefully it is just a configuration or else we need to fix up the client to understand the diff output - mind you the new format feels saner as it doesn't nest results and result count in the struct

@slack
Copy link
Member
slack commented Jan 1, 2016

Looks like the update dropped the pagination/count/next/results response:

From a working request:

Server:                 nginx/1.9.6
Date:                   Fri, 01 Jan 2016 02:41:20 GMT
Content-Type:           application/json
Transfer-Encoding:      chunked
Connection:             close
Vary:                   Accept-Encoding
DEIS_PLATFORM_VERSION:  2.0.0-dev
Allow:                  GET, HEAD, OPTIONS
DEIS_API_VERSION:       2.0
Content-Encoding:       gzip
content-length:         198
[decoded gzip] JSON                                                                                                                                                                                                                   [m:Auto]
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "app": "rococo-vocalist",
            "created": "2016-01-01T02:40:36UTC",
            "num": 1,
            "owner": "jhansen",
            "release": "v2",
            "state": "up",
            "type": "web",
            "updated": "2016-01-01T02:40:36UTC",
            "uuid": "b5c7a1d3-be15-44c2-ba82-dd0b91c90a99"
        }
    ]
}

@helgi
Copy link
Contributor Author
helgi commented Jan 1, 2016

Yeah I have been looking at 3.1 of DRF (we went from 3.0 to 3.3) and they changed some paginations, still reviewing it https://github.com/tomchristie/django-rest-framework/blob/bf18c9f6e37d8d88800647013994e924748a34da/docs/topics/3.1-announcement.md

It looks like they added header based pagination and made that default (tho I haven't found the exact point when that happened).

Two options:

  • Make DRF move back to the old format, i revert the test changes and we move on with our live
  • Start doing pagination via the headers and update the client to use that (personally prefer header base pagination). Additionally there is some versioned API support in 3.1 which we may want to explore.

We could do both options, option 1 now and option 2 as a separate piece of work. Depends if we want that kind of APIs on Deis going forward? Up to you @slack

@helgi
Copy link
Contributor Author
helgi commented Jan 1, 2016

I moved to using the old style (not pushed yet) and reverted the tests to their original form but it seems that there are some internal pagination API changes that we are using that only break while using the old format.

I'll do more digging and see if I can figure that one out, be it today or Monday.

@helgi
Copy link
Contributor Author
helgi commented Jan 1, 2016

I found a fix, it was related to how the pagination serializer fetching works. This should work with the current version of the deis client and I linked to a ticket that talks about the header based pagination

@slack
Copy link
Member
slack commented Jan 4, 2016

For now, we should maintain api compat with the client (which is why I wish we hadn't bumped to /v2/ but that's another story).

Longer term, as we start folding in more stuff we can talk about standardizing on something like JSONAPI for the long haul (and another major api rev).

Copy link
Member

Choose a reason for hiding this comment

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

the newline is intentional IIRC. We had issues with parsing out the Dockerfile with a blank newline character with no text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was the only way to get the tests passing. I can try removing it again and see if there is a different issue somewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AssertionError: u'FROM busybox\n        CMD /bin/true' != u'\n        FROM busybox\n        CMD /bin/true'
+
- FROM busybox
+         FROM busybox
? ++++++++
          CMD /bin/true

Shrug - I don't see what would have changed to affect that. @bacongobbler are you sure this test was to test that particular issue you mentioned?

Copy link
Member

Choose a reason for hiding this comment

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

my guess would be the tab is missing from the old one, but if I'm reading the tests right, moving FROM busybox to after """ should make the tests pass:

"""FROM busybox
CMD /bin/true
"""

looks like some odd formatting hack in the build hook, but that should stop the bleeding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That'd be the same as:

        DOCKERFILE = """\
FROM busybox
        CMD /bin/true"""

But that one does look weird, hah. I changed the PR for now and kept that spacing there as it doesn't hurt.

Copy link
Member

Choose a reason for hiding this comment

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

honestly I don't even think we use this information any more so it's all good :)

@slack
Copy link
Member
slack commented Jan 4, 2016

Tested, looks good:

workflow [helgi-django_1.8]$ deis2 register http://deis.chorizo.k8s.slack.io
username: jhansen
password:
password (confirm):
email: jhansen@deis.com
Registered jhansen
Logged in as jhansen
workflow [helgi-django_1.8]$ deis2 keys:add ~/.ssh/id_subgenius.pub
Uploading id_subgenius.pub to deis... done
example-go [master]$ g remote rm deis
example-go [master]$ deis2 create
Creating Application... done, created scenic-villager
Git remote deis added
remote available at ssh://git@deis.chorizo.k8s.slack.io:2222/scenic-villager.git
The authenticity of host '[deis.chorizo.k8s.slack.io]:2222 ([52.35.172.246]:2222)' can't be established.
RSA key fingerprint is bd:a3:40:59:5e:5f:10:fe:4f:ef:a0:47:79:48:68:eb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[deis.chorizo.k8s.slack.io]:2222,[52.35.172.246]:2222' (RSA) to the list of known hosts.
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, scenic-villager:v2 deployed to Deis

       http://scenic-villager.localhost

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

To ssh://git@deis.chorizo.k8s.slack.io:2222/scenic-villager.git
 * [new branch]      master -> master
example-go [master]$ curl http://scenic-villager.chorizo.k8s.slack.io
Party-time by Deis
Release v2 on scenic-villager-v2-web-30o70
example-go [master]$
example-go [master]$ deis2 scale web=5
Scaling processes... but first, coffee!
done in 4s
=== scenic-villager Processes
--- web:
web.1 up (v2)
web.2 up (v2)
web.3 up (v2)
web.4 up (v2)
web.5 up (v2)
example-go [master]$ deis2 ps
=== scenic-villager Processes
--- web:
web.1 up (v2)
web.2 up (v2)
web.3 up (v2)
web.4 up (v2)
web.5 up (v2)

@slack slack added the LGTM1 label Jan 4, 2016
@carmstrong
Copy link
Contributor

Would like @mboersma to take a pass at this

helgi added a commit that referenced this pull request Jan 4, 2016
feat(*): update django from 1.7 to 1.8
@helgi helgi merged commit e404eaa into deis:master Jan 4, 2016
@helgi helgi deleted the django_1.8 branch January 4, 2016 22:10
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.

5 participants

0