Skip to content

Commit ea709da

Browse files
author
Sergey
committed
fix: sync Docker runtime Python with builder and harden Renovate config
Renovate PR #598 bumped the runtime Python image from 3.13 to 3.14 independently of the builder stage, causing ModuleNotFoundError in all three Docker images. The venv is built with Python 3.13 site-packages but the 3.14 runtime looks under python3.14/, so nothing is found. - Revert all three Dockerfiles to Python 3.13 runtime, matching builder - Drop Debian codename from runtime tags (python:3.13-slim instead of python:3.13-slim-bookworm) so latest Debian is used automatically - Disable Renovate dockerfile manager for python images to prevent independent runtime bumps that break builder/runtime compatibility - Add missing files to Renovate postUpgradeTasks: addon-dev Dockerfile, _build-and-release.yml, build-binary.yml, hotfix-release.yml, performance-tests.yml - Add sed command for runtime image tags (python:3.X-slim pattern)
1 parent 934ad1c commit ea709da

5 files changed

Lines changed: 29 additions & 13 deletions

File tree

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: Ruff Lint
1919
runs-on: ubuntu-latest
2020
container:
21-
image: ghcr.io/astral-sh/uv:0.9.30-python3.13-bookworm-slim
21+
image: ghcr.io/astral-sh/uv:0.9.30-python3.13-trixie-slim
2222
timeout-minutes: 5
2323

2424
steps:
@@ -35,7 +35,7 @@ jobs:
3535
name: Unit Tests
3636
runs-on: ubuntu-latest
3737
container:
38-
image: ghcr.io/astral-sh/uv:0.9.30-python3.13-bookworm-slim
38+
image: ghcr.io/astral-sh/uv:0.9.30-python3.13-trixie-slim
3939
timeout-minutes: 5
4040

4141
steps:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Base images pinned by digest - Renovate will create PRs for updates
66

77
# --- Build stage: install dependencies with uv ---
8-
FROM ghcr.io/astral-sh/uv:0.9.30-python3.13-bookworm-slim@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca AS builder
8+
FROM ghcr.io/astral-sh/uv:0.9.30-python3.13-trixie-slim@sha256:a4174f4f3f3bc082b09e7c7d4de288c66b5a70c3cce22bbec35f23f0d24a8679 AS builder
99

1010
WORKDIR /app
1111

@@ -23,7 +23,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
2323
uv sync --locked --no-dev
2424

2525
# --- Runtime stage: clean image without uv ---
26-
FROM python:3.14-slim-bookworm@sha256:f0540d0436a220db0a576ccfe75631ab072391e43a24b88972ef9833f699095f
26+
FROM python:3.13-slim@sha256:3de9a8d7aedbb7984dc18f2dff178a7850f16c1ae7c34ba9d7ecc23d0755e35f
2727

2828
LABEL org.opencontainers.image.title="Home Assistant MCP Server" \
2929
org.opencontainers.image.description="AI assistant integration for Home Assistant via Model Context Protocol" \

homeassistant-addon-dev/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# WARNING: This is unstable and may break at any time
55

66
# --- Build stage: install dependencies with uv ---
7-
FROM ghcr.io/astral-sh/uv:0.9.30-python3.13-bookworm-slim@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca AS builder
7+
FROM ghcr.io/astral-sh/uv:0.9.30-python3.13-trixie-slim@sha256:a4174f4f3f3bc082b09e7c7d4de288c66b5a70c3cce22bbec35f23f0d24a8679 AS builder
88

99
WORKDIR /app
1010

@@ -22,7 +22,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
2222
uv sync --locked --no-dev --no-editable
2323

2424
# --- Runtime stage: clean image without uv ---
25-
FROM python:3.14-slim-bookworm@sha256:f0540d0436a220db0a576ccfe75631ab072391e43a24b88972ef9833f699095f
25+
FROM python:3.13-slim@sha256:3de9a8d7aedbb7984dc18f2dff178a7850f16c1ae7c34ba9d7ecc23d0755e35f
2626

2727
WORKDIR /app
2828

homeassistant-addon/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# No bashio needed - pure Python startup script
66

77
# --- Build stage: install dependencies with uv ---
8-
FROM ghcr.io/astral-sh/uv:0.9.30-python3.13-bookworm-slim@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca AS builder
8+
FROM ghcr.io/astral-sh/uv:0.9.30-python3.13-trixie-slim@sha256:a4174f4f3f3bc082b09e7c7d4de288c66b5a70c3cce22bbec35f23f0d24a8679 AS builder
99

1010
WORKDIR /app
1111

@@ -23,7 +23,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
2323
uv sync --locked --no-dev --no-editable
2424

2525
# --- Runtime stage: clean image without uv ---
26-
FROM python:3.14-slim-bookworm@sha256:f0540d0436a220db0a576ccfe75631ab072391e43a24b88972ef9833f699095f
26+
FROM python:3.13-slim@sha256:3de9a8d7aedbb7984dc18f2dff178a7850f16c1ae7c34ba9d7ecc23d0755e35f
2727

2828
WORKDIR /app
2929

renovate.json

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
}
2828
],
2929
"packageRules": [
30+
{
31+
"description": "Python runtime images - managed by asdf postUpgradeTasks, not independently",
32+
"matchManagers": [
33+
"dockerfile"
34+
],
35+
"matchPackageNames": [
36+
"python"
37+
],
38+
"enabled": false
39+
},
3040
{
3141
"description": "Python version upgrades - wait 6 months after release",
3242
"matchManagers": [
@@ -45,21 +55,27 @@
4555
"sed -i \"s/requires-python = \\\">=3\\.[0-9]\\+,<3\\.[0-9]\\+\\\"/requires-python = \\\">=${PYTHON_VERSION},<${PYTHON_NEXT}\\\"/\" pyproject.toml",
4656
"sed -i '/Programming Language :: Python :: 3\\.[0-9]\\+/d' pyproject.toml",
4757
"sed -i \"/Programming Language :: Python :: 3\\\",/a\\\\ \\\"Programming Language :: Python :: ${PYTHON_VERSION}\\\",\" pyproject.toml",
48-
"sed -i \"s/python3\\.[0-9]\\+-bookworm-slim/python${PYTHON_VERSION}-bookworm-slim/\" Dockerfile",
49-
"sed -i \"s/python3\\.[0-9]\\+-bookworm/python${PYTHON_VERSION}-bookworm/\" homeassistant-addon/Dockerfile",
58+
"sed -i \"s/python3\\.[0-9]\\+\\(-[a-z]\\+-slim\\)/python${PYTHON_VERSION}\\1/\" Dockerfile homeassistant-addon/Dockerfile homeassistant-addon-dev/Dockerfile .github/workflows/pr.yml",
59+
"sed -i \"s/python:3\\.[0-9]\\+-slim/python:${PYTHON_VERSION}-slim/\" Dockerfile homeassistant-addon/Dockerfile homeassistant-addon-dev/Dockerfile",
5060
"sed -i \"s/Python 3\\.[0-9]\\+ - Security/Python ${PYTHON_VERSION} - Security/\" Dockerfile homeassistant-addon/Dockerfile",
51-
"sed -i \"s/PYTHON_VERSION: \\\"3\\.[0-9]\\+\\\"/PYTHON_VERSION: \\\"${PYTHON_VERSION}\\\"/\" .github/workflows/pr.yml .github/workflows/test.yml .github/workflows/e2e-tests.yml .github/workflows/semver-release.yml",
52-
"git add .python-version pyproject.toml Dockerfile homeassistant-addon/Dockerfile .github/workflows/pr.yml .github/workflows/test.yml .github/workflows/e2e-tests.yml .github/workflows/semver-release.yml"
61+
"sed -i \"s/PYTHON_VERSION: \\\"3\\.[0-9]\\+\\\"/PYTHON_VERSION: \\\"${PYTHON_VERSION}\\\"/\" .github/workflows/pr.yml .github/workflows/test.yml .github/workflows/e2e-tests.yml .github/workflows/semver-release.yml .github/workflows/hotfix-release.yml .github/workflows/performance-tests.yml",
62+
"sed -i \"s/python-version: '3\\.[0-9]\\+'/python-version: '${PYTHON_VERSION}'/\" .github/workflows/_build-and-release.yml .github/workflows/build-binary.yml",
63+
"git add .python-version pyproject.toml Dockerfile homeassistant-addon/Dockerfile homeassistant-addon-dev/Dockerfile .github/workflows/pr.yml .github/workflows/test.yml .github/workflows/e2e-tests.yml .github/workflows/semver-release.yml .github/workflows/hotfix-release.yml .github/workflows/performance-tests.yml .github/workflows/_build-and-release.yml .github/workflows/build-binary.yml"
5364
],
5465
"fileFilters": [
5566
".python-version",
5667
"pyproject.toml",
5768
"Dockerfile",
5869
"homeassistant-addon/Dockerfile",
70+
"homeassistant-addon-dev/Dockerfile",
5971
".github/workflows/pr.yml",
6072
".github/workflows/test.yml",
6173
".github/workflows/e2e-tests.yml",
62-
".github/workflows/semver-release.yml"
74+
".github/workflows/semver-release.yml",
75+
".github/workflows/hotfix-release.yml",
76+
".github/workflows/performance-tests.yml",
77+
".github/workflows/_build-and-release.yml",
78+
".github/workflows/build-binary.yml"
6379
],
6480
"executionMode": "branch"
6581
}

0 commit comments

Comments
 (0)