Skip to content

Harden service builds: uv sync --locked instead of --frozen across all Dockerfiles #531

Description

@amarcozzi

Motivation

All 9 service Dockerfiles build their environment with uv sync --frozen. --frozen installs exactly what uv.lock pins and never checks the lock against pyproject.toml — so a lock that has drifted out of sync with pyproject is installed silently.

This shipped the wrong dependency to production once already: griddle's pyproject.toml required fastfuels-core>=0.14.0 while its committed uv.lock still pinned 0.10.1 (an uncommitted relock). uv sync --frozen happily installed core 0.10.1, whose older compute_canopy_metrics computed canopy bulk density ~0.060 kg/m³ instead of ~0.044, failing the FuelCalc-reproduction integration test only after deploy. Root cause + fix: #529 / #530.

uv sync --locked installs from the lock but first asserts the lock is up-to-date with pyproject.toml, failing the build loudly on drift instead of shipping a stale dependency. It would have caught this at build time.

Scope

Switch RUN uv sync --frozenRUN uv sync --locked in every service Dockerfile:

  • services/api/Dockerfile
  • services/etcher/Dockerfile
  • services/exporter/Dockerfile
  • services/griddle/Dockerfile
  • services/lakitu/Dockerfile
  • services/standgen/Dockerfile
  • services/treevox/Dockerfile
  • services/uploader/Dockerfile
  • services/walle/Dockerfile

Before flipping each, confirm that service's lock is already consistent (cd services/<svc> && uv lock --check) so the change doesn't turn an existing latent drift into a red build unexpectedly — relock any that fail as part of this work.

Optional stronger guard

Consider also adding a uv lock --check step to each service's CI workflow (before the build job), so lock drift is caught on the PR rather than only at image build. This catches it even earlier and independent of the Docker build. Left out of the required scope above; decide whether it's worth the 9 workflow edits.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions