Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Datasette Docker to Python 3.11 #1853

Closed
simonw opened this issue Oct 25, 2022 · 7 comments
Closed

Upgrade Datasette Docker to Python 3.11 #1853

simonw opened this issue Oct 25, 2022 · 7 comments
Labels
docker The official Docker image, plus other things related to running Datasette on Docker

Comments

@simonw
Copy link
Owner

simonw commented Oct 25, 2022

Related:

I think this base image looks right: 3.11.0-slim-bullseye

@simonw simonw added the docker The official Docker image, plus other things related to running Datasette on Docker label Oct 25, 2022
@simonw
Copy link
Owner Author

simonw commented Oct 25, 2022

I ran a very crude benchmark on my laptop using Locust (against the official macOS packages from www.python.org for Python 3.10 and Python 3.11) and saw a substantial speed increase:

533.89 requests/second on 3.11
413.56 requests/second on 3.10

That was from running Locust against this locustfile.py:

from locust import HttpUser, task

class CounterOne(HttpUser):
    @task
    def hello(self):
        self.client.get("/-/static/app.css")

Using:

locust --headless --users 4 --spawn-rate 4 -H http://127.0.0.1:8001

@simonw
Copy link
Owner Author

simonw commented Oct 25, 2022

Ran the upgrade on the Datasette Cloud image first, works fine there.

https://simon.datasette.cloud/-/versions shows me:

{
    "python": {
        "version": "3.11.0",
        "full": "3.11.0 (main, Oct 25 2022, 05:00:36) [GCC 10.2.1 20210110]"
    },

@simonw
Copy link
Owner Author

simonw commented Oct 25, 2022

Also tested by running this locally:

datasette publish cloudrun fixtures.db --service issue-1853

https://issue-1853-j7hipcg4aq-uc.a.run.app/-/versions now shows Python 3.11.0.

@simonw
Copy link
Owner Author

simonw commented Oct 25, 2022

And tested datasette package like this:

datasette package fixtures.db -t datasette-package-python-upgrade-3-11

Then:

docker run -p 8081:8001 datasette-package-python-upgrade-3-11

And tested it like this:

curl http://localhost:8081/-/versions.json | jq

Output:

{
  "python": {
    "version": "3.11.0",
    "full": "3.11.0 (main, Oct 25 2022, 05:00:36) [GCC 10.2.1 20210110]"
  },

@simonw
Copy link
Owner Author

simonw commented Oct 25, 2022

This broke the deploy of https://latest.datasette.io/ - because it tries to install pysqlite3-binary which doesn't have a 3.11 release yet:

--install=pysqlite3-binary \

I started using that for the latest.datasette.io demo in a970276 because I wanted a version of SQLite that supported generated columns.

Those were added in SQLite 3.31.0 - and the SQLite version in the new base image is 3.34.1 - so I don't actually need pysqlite3-binary any more.

@simonw
Copy link
Owner Author

simonw commented Oct 25, 2022

https://latest.datasette.io/-/versions now shows 3.11.

@simonw
Copy link
Owner Author

simonw commented Oct 25, 2022

@simonw simonw mentioned this issue Oct 27, 2022
simonw added a commit that referenced this issue Oct 27, 2022
simonw added a commit that referenced this issue Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker The official Docker image, plus other things related to running Datasette on Docker
Projects
None yet
Development

No branches or pull requests

1 participant