diff --git a/docker/Dockerfile b/docker/Dockerfile index c6a5d6c..1676c54 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -53,15 +53,24 @@ COPY --from=addon-sources --chown=ubuntu:ubuntu /opt/extra_addons /opt/extra_add RUN mkdir -p /volumes /opt/project \ && rm -f /volumes/pyproject.toml /volumes/uv.lock \ && ln -s /opt/project/pyproject.toml /volumes/pyproject.toml \ - && ln -s /opt/project/uv.lock /volumes/uv.lock \ - && rm -rf /opt/project/tools \ - && ln -s /volumes/tools /opt/project/tools + && ln -s /opt/project/uv.lock /volumes/uv.lock -FROM base-runtime AS production +FROM base-devtools AS production-deps ARG TARGETPLATFORM WORKDIR /opt/project +# Seed from the serving image so devtools-only packages and import paths stay out. RUN --mount=type=cache,target=/home/ubuntu/.cache/uv,uid=1000,gid=1000,sharing=locked \ - TARGETPLATFORM="${TARGETPLATFORM}" /usr/local/bin/odoo-python-sync.sh prod + --mount=from=base-runtime,source=/venv,target=/tmp/runtime-venv \ + --mount=from=base-runtime,source=/opt/uv/python,target=/opt/uv/python \ + --mount=from=base-runtime,source=/opt/launchplane/base-python-constraints.txt,target=/opt/launchplane/base-python-constraints.txt \ + rm -rf /venv \ + && cp -a /tmp/runtime-venv /venv \ + && TARGETPLATFORM="${TARGETPLATFORM}" /usr/local/bin/odoo-python-sync.sh prod + +FROM base-runtime AS production +RUN --mount=from=production-deps,source=/venv,target=/tmp/production-venv \ + rm -rf /venv && cp -a /tmp/production-venv /venv +COPY --from=production-deps /opt/launchplane/evidence/dependency-provenance.json /opt/launchplane/evidence/dependency-provenance.json WORKDIR / USER ubuntu @@ -70,5 +79,7 @@ ARG TARGETPLATFORM WORKDIR /opt/project RUN --mount=type=cache,target=/home/ubuntu/.cache/uv,uid=1000,gid=1000,sharing=locked \ - TARGETPLATFORM="${TARGETPLATFORM}" /usr/local/bin/odoo-python-sync.sh dev + rm -rf /opt/project/tools \ + && ln -s /volumes/tools /opt/project/tools \ + && TARGETPLATFORM="${TARGETPLATFORM}" /usr/local/bin/odoo-python-sync.sh dev USER ubuntu diff --git a/docker/artifact.Dockerfile b/docker/artifact.Dockerfile index 1510f89..a2fe71f 100644 --- a/docker/artifact.Dockerfile +++ b/docker/artifact.Dockerfile @@ -62,18 +62,27 @@ COPY --from=addon-sources --chown=ubuntu:ubuntu /opt/extra_addons /opt/extra_add RUN mkdir -p /volumes /opt/project \ && rm -f /volumes/pyproject.toml /volumes/uv.lock \ && ln -s /opt/project/pyproject.toml /volumes/pyproject.toml \ - && ln -s /opt/project/uv.lock /volumes/uv.lock \ - && rm -rf /opt/project/tools \ - && ln -s /volumes/tools /opt/project/tools + && ln -s /opt/project/uv.lock /volumes/uv.lock RUN /venv/bin/python /volumes/scripts/odoo_release_inventory.py --base-tools /opt/launchplane/evidence/base-devtools-inventory.json -FROM base-runtime AS production +FROM base-devtools AS production-deps ARG TARGETPLATFORM -COPY --from=base-devtools /opt/launchplane/evidence/base-devtools-inventory.json /opt/launchplane/evidence/base-devtools-inventory.json WORKDIR /opt/project +# Seed from the serving image so devtools-only packages and import paths stay out. RUN --mount=type=cache,target=/home/ubuntu/.cache/uv,uid=1000,gid=1000,sharing=locked \ - TARGETPLATFORM="${TARGETPLATFORM}" ODOO_PYTHON_SYNC_SKIP_ADDONS="${ODOO_PYTHON_SYNC_SKIP_ADDONS}" /usr/local/bin/odoo-python-sync.sh prod + --mount=from=base-runtime,source=/venv,target=/tmp/runtime-venv \ + --mount=from=base-runtime,source=/opt/uv/python,target=/opt/uv/python \ + --mount=from=base-runtime,source=/opt/launchplane/base-python-constraints.txt,target=/opt/launchplane/base-python-constraints.txt \ + rm -rf /venv \ + && cp -a /tmp/runtime-venv /venv \ + && TARGETPLATFORM="${TARGETPLATFORM}" ODOO_PYTHON_SYNC_SKIP_ADDONS="${ODOO_PYTHON_SYNC_SKIP_ADDONS}" /usr/local/bin/odoo-python-sync.sh prod + +FROM base-runtime AS production +RUN --mount=from=production-deps,source=/venv,target=/tmp/production-venv \ + rm -rf /venv && cp -a /tmp/production-venv /venv +COPY --from=production-deps /opt/launchplane/evidence/dependency-provenance.json /opt/launchplane/evidence/dependency-provenance.json +COPY --from=base-devtools /opt/launchplane/evidence/base-devtools-inventory.json /opt/launchplane/evidence/base-devtools-inventory.json COPY /release-inventory-inputs.json /opt/launchplane/evidence/release-inventory-inputs.json RUN /venv/bin/python /volumes/scripts/odoo_release_inventory.py \ /opt/launchplane/evidence/release-inventory-inputs.json /opt/launchplane/evidence/release-compatibility.json \ diff --git a/docs/tooling/consumer-build-checks.md b/docs/tooling/consumer-build-checks.md index bafce07..bfbdc7a 100644 --- a/docs/tooling/consumer-build-checks.md +++ b/docs/tooling/consumer-build-checks.md @@ -125,6 +125,12 @@ before the check succeeds. Base-image authentication uses the existing read path; image push authentication is omitted. Temporary evidence is removed when the command exits. +Both production Dockerfiles build dependencies with the devtools toolchain, +starting from the serving image's Python interpreter, virtual environment, and +base constraints. The serving image receives the completed production virtual +environment and its dependency provenance. The local development target keeps +the devtools environment and installs development dependencies there. + The JSON records built source commits, platforms, resolved addon inputs and base-image digests, staged lock hashes, and validated in-image `dependency_provenance`. It is build-check evidence, not a diff --git a/docs/tooling/renovate.md b/docs/tooling/renovate.md index a20ab78..c1d9d0e 100644 --- a/docs/tooling/renovate.md +++ b/docs/tooling/renovate.md @@ -27,6 +27,11 @@ Renovate opens a pull request for each alert it can fix. unmerged conversion does not. Odoo 19 shared-addons pins stay unchanged. Shared-addons updates use ordinary visible pull requests, preview checks and the merge train. Production still requires Client release acceptance. + For Community 20, the same preset proposes both digest-only base-image pins + together from the stable runtime and devtools tags. It also repairs one stale + pin when the other already matches. Before landing, check that both proposed + digests identify the same producer run in their manifest annotations. The two + stable tags are promoted separately. ## Repository Config diff --git a/renovate/devkit-pin.json b/renovate/devkit-pin.json index 5514c2b..f6651bf 100644 --- a/renovate/devkit-pin.json +++ b/renovate/devkit-pin.json @@ -1,6 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "description": "Moves exact devkit pins and Odoo 20 shared-addons pins to their main head commits.", + "description": "Updates exact devkit and Odoo 20 shared-addons commits and paired Community base image digests.", "customManagers": [ { "customType": "regex", @@ -12,6 +12,18 @@ "packageNameTemplate": "https://github.com/{{{depName}}}", "datasourceTemplate": "git-refs" }, + { + "customType": "jsonata", + "fileFormat": "toml", + "managerFilePatterns": ["/^workspace\\.toml$/"], + "matchStrings": [ + "$[build.odoo_version = '20.0'].build.base_runtime_image[$contains($, /^ghcr\\.io\\/cbusillo\\/odoo-docker@sha256:[a-f0-9]{64}$/)].{'currentValue': '20.0-runtime', 'currentDigest': $substringAfter($, '@')}", + "$[build.odoo_version = '20.0'].build.base_devtools_image[$contains($, /^ghcr\\.io\\/cbusillo\\/odoo-docker@sha256:[a-f0-9]{64}$/)].{'currentValue': '20.0-devtools', 'currentDigest': $substringAfter($, '@')}" + ], + "depNameTemplate": "ghcr.io/cbusillo/odoo-docker", + "datasourceTemplate": "docker", + "versioningTemplate": "exact" + }, { "customType": "regex", "managerFilePatterns": ["/^\\.github/workflows/[^/]+\\.ya?ml$/"], @@ -46,6 +58,13 @@ "matchDepNames": ["cbusillo/odoo-shared-addons"], "commitMessageTopic": "shared-addons pin", "schedule": ["at any time"] + }, + { + "matchManagers": ["custom.jsonata"], + "matchDatasources": ["docker"], + "matchPackageNames": ["ghcr.io/cbusillo/odoo-docker"], + "groupName": "Odoo 20 base images", + "schedule": ["at any time"] } ] }