Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
21 changes: 15 additions & 6 deletions docker/artifact.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 6 additions & 0 deletions docs/tooling/consumer-build-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions docs/tooling/renovate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 20 additions & 1 deletion renovate/devkit-pin.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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$/"],
Expand Down Expand Up @@ -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"]
}
]
}