Skip to content

Upgrade to Python 3.12 base layer - #10

Merged
m-messer merged 2 commits into
mainfrom
python-3.12
Nov 10, 2026
Merged

m-messer merged 2 commits into
mainfrom
python-3.12

Conversation

@m-messer

@m-messer m-messer commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Moves off baseevalutionfunctionlayer:main-3.8 (Python 3.8 runtime, deprecated; the base layer has stopped building the 3.8 image).

  • app/Dockerfile: main-3.12, the same recipe as survey. yum install wget unzip becomes dnf install findutils wget unzip; python -m nltk.downloader becomes python3 -m …; also adds PYTHONPATH=/app, pytest, and CMD ["app.handler"]

  • Renamed evaluation_test.py to evaluation_tests.py. The base layer healthcheck imports evaluation_tests, which is why prod healthcheck currently reports tests_passed: false

  • Workflows now match survey's: test-lint runs on PRs (it was manual-only), the staging test job is enabled on 3.12 with needs: test (it was commented out), and run-database-tests: true on production deploy

  • Added pytest.ini and updated the README Python version

  • CI test jobs now download the NLTK data (wordnet word2vec_sample brown stopwords punkt punkt_tab). Without it the tests fail with LookupError: word2vec_sample, which is probably why test-lint had been made manual-only

Testing (branch deployed to staging; not tested locally):

  • PR CI on 3.12: 9 passed
  • Staging endpoint vs prod (warm): healthcheck tests_passed: true; eval output identical to prod (same similarity values)
  • Database tests on staging: 494/500. Of the 6 failures: 1 historical grade mismatch where response == answer (Origin/Origin, stored grade False), 1 payload that fails schema validation, and 5 network 503s
  • ⚠️ Open: the 503s and the first requests after deploy look like cold starts longer than API Gateway's 30s (loading word2vec/gensim). Not yet compared with prod cold-start time

🤖 Generated with Claude Code

m-messer and others added 2 commits November 9, 2026 17:25
- Base image baseevalutionfunctionlayer:main-3.8 -> main-3.12 (AL2023: dnf instead of yum,
  findutils, PYTHONPATH, pytest for healthcheck, python3 for nltk downloads, module-style CMD)
- Rename evaluation_test.py -> evaluation_tests.py so the base layer healthcheck can import it
- Workflows copied from survey: test-lint runs on PRs, staging test job enabled (3.12),
  database tests on production deploy
- Add pytest.ini

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests load word2vec_sample, wordnet, etc. (downloaded in the Dockerfile for the image),
so the GitHub runner needs them too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@m-messer
m-messer merged commit cc7c92d into main Nov 10, 2026
10 of 11 checks passed
@m-messer
m-messer deleted the python-3.12 branch November 10, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant