Repository navigation
security(images): bump the server's Python pins, drop its venv tooling and upgrade the UI's Alpine packages - #19
Conversation
Regenerated with `cvat/requirements/regenerate.sh --no-upgrade --upgrade-package ...` in an Ubuntu 24.04 / Python 3.12 container (pip-tools 7.6.2). Only these pins change: - Django 5.2.18 - cryptography 50.0.1 - lxml 6.1.3 (base.in now allows lxml 6, as develop does) - sqlparse 0.6.0 - urllib3 2.8.0 - idna 3.15 - pyasn1 0.6.4 - djangorestframework 3.17.2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pe4wMaSPgK3pcbbsShPjqz
The runtime stage installs python3-venv only to create /opt/venv. Once the venv is built and pip is uninstalled from it, python3-venv, python3.12-venv and the pip and setuptools wheels they bundle are unused. Image scanners report the bundled pip wheel as the OS python-pip package, so purge them after the venv is built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pe4wMaSPgK3pcbbsShPjqz
The nginx-unprivileged 1.31.6 Alpine 3.24 image still ships zlib 1.3.2-r0, and Alpine 3.24 now has 1.3.2-r1. Upgrade the base image's packages at build time, as the server image does, so the UI image gets Alpine's fixes without waiting for a new nginx-unprivileged build. The upgrade runs as root; the stage then switches back to uid 101, the base image's unprivileged user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pe4wMaSPgK3pcbbsShPjqz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pe4wMaSPgK3pcbbsShPjqz
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
The server image now removes python3-venv once its venv is built, so `python3 -m ensurepip` in Dockerfile.ci failed with "No module named ensurepip" and the unit tests never started. Reinstall python3-venv in the CI image only; the production image stays without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pe4wMaSPgK3pcbbsShPjqz
|
As on #18, the REST and e2e jobs cannot start their test stack on this base, because its MinIO images are no longer pullable. The server and UI image builds passed. |
|
Test status for review on
|
Summary
This bumps eight pinned Python dependencies in the server image, removes the Python venv tooling from the server's runtime stage, and has the UI image upgrade its Alpine packages at build time. It builds on
release/2.72(2.72.1 plus #18). CVAT's own code is unchanged. There are no database migrations and no settings or compose changes.Upstream
developalready pins Django 5.2.18, cryptography 50.0.1, lxml 6.1.3, sqlparse 0.6.0, urllib3 2.8.0 and pyasn1 0.6.4. The two Dockerfile changes are not ondevelop; forward-porting them is left to a follow-up.Server image: Python pins (
cvat/requirements/base.in,base.txt)Regenerated with
cvat/requirements/regenerate.sh --no-upgrade --upgrade-package …. Only these pins change:base.innow allows lxml 6 (lxml>=6.1.3,<7), asdevelopdoes. Datumaro's pinned commit is the same on both branches. oauthlib stays on 3.x: 4.0 is a major release, anddevelophas not moved to it.Server image: runtime stage (
Dockerfile)After the venv is built and pip is uninstalled from it, the runtime stage purges
python3-venv,python3.12-venv,python3-pip-whlandpython3-setuptools-whl. Nothing uses them at runtime, and image scanners report the bundled pip wheel as the OSpython-pippackage.UI image (
Dockerfile.ui)The pinned
nginx-unprivileged:1.31.6-alpine3.24-slimbase still ships zlib 1.3.2-r0, and Alpine 3.24 now has 1.3.2-r1. The runtime stage runsapk upgrade --no-cacheas root, as the server image already upgrades its Ubuntu packages, then switches back to uid 101, the base image's unprivileged user.YOLOv7 sidecar
No change. Its apt packages are unpinned, so rebuilding it picks up the current Ubuntu 24.04 packages, including libx11 2:1.8.7-1ubuntu0.1.
Testing
Done locally:
docker build .succeeds. The purge step removes exactlypython3-pip-whl,python3-setuptools-whl,python3-venvandpython3.12-venv, and nothing else.import xmlsecraises no version mismatch. PyAV 16.0.1 loads the bundled FFmpeg 8.0. pip,/usr/share/python-wheelsand the four purged packages are absent, and the image still runs asdjango(uid 1000).manage.py checkreports no issues, andmanage.py makemigrations --check --dry-runreports no changes, so the Django bump needs no migrations.react_nginx.conf: zlib is 1.3.2-r1, every nginx process runs as uid 101, and/,/robots.txtand an SPA route return 200.-t error, as CI runs it, passes. The new serverRUNadds one info-level DL3059 (consecutiveRUNs); it stays separate so upstream's pip-uninstall line is untouched. The UI change adds no findings.Still to run:
🤖 Generated with Claude Code
https://claude.ai/code/session_01Pe4wMaSPgK3pcbbsShPjqz