Skip to content

docker: publish branch-aligned repeater images and trigger rebuilds from core#258

Open
yellowcooln wants to merge 2 commits into
pyMC-dev:devfrom
yellowcooln:docker-image-core-sync
Open

docker: publish branch-aligned repeater images and trigger rebuilds from core#258
yellowcooln wants to merge 2 commits into
pyMC-dev:devfrom
yellowcooln:docker-image-core-sync

Conversation

@yellowcooln
Copy link
Copy Markdown
Collaborator

PR Summary

This PR fixes how pyMC_Repeater Docker images are built and consumed so published images reliably track the matching pyMC_core branch and commit state.

Before this change, Docker builds installed repeater using a plain:

pip install .

That allowed the pyMC_core@dev dependency to remain stale inside freshly published images if Docker reused cached layers.

The sample docker-compose.yml also rebuilt locally instead of pulling the published image, which bypassed the Docker publish workflow entirely.

This PR makes the Docker pipeline deterministic and channel-aware.


What Changed

Deterministic pyMC_core Pinning

Docker builds are now branch-aware:

  • dev repeater images build against pyMC_core@dev
  • main repeater images build against pyMC_core@main

The publish workflow now:

  • Resolves the exact current pyMC_core commit SHA at build time

  • Passes both:

    • PYMC_CORE_REF
    • PYMC_CORE_SHA
  • Installs pyMC_core by exact commit SHA

  • Installs repeater using:

    • pip install --no-deps

This guarantees the published image contains a pinned and traceable pyMC_core revision instead of a floating or cached branch tip.


Docker Consumption Changes

The sample container workflow now consumes published images directly instead of rebuilding locally.

docker-compose.yml

Updated to:

  • Use image: instead of build:

  • Set:

    • pull_policy: always
  • Pass:

    • PUID
    • PGID

as runtime environment variables instead of build args.

README Updates

Documentation now instructs users to:

docker compose pull
docker compose up -d --force-recreate

This ensures deployments actually receive the latest published image.


CI / Workflow Changes

Repeater Docker Publish Workflow

Extended .github/workflows/docker-publish.yml to support automatic rebuilds when pyMC_core changes.

Added:

  • repository_dispatch support

  • Dispatch payload support for:

    • channel
    • core_ref
    • core_sha
  • Matching repeater branch checkout for dispatch-triggered rebuilds

  • Docker tagging by:

    • Channel
    • Repeater SHA
  • OCI-style image labels for:

    • Repeater revision
    • Core ref
    • Core SHA

pyMC_core Trigger Workflow

Added companion workflow:

  • .github/workflows/trigger-repeater-docker-rebuild.yml

This workflow:

  • Triggers on main and dev pushes

  • Dispatches rebuild events to the repeater repo

  • Sends:

    • Matching channel
    • Exact core commit SHA

This allows a new pyMC_core merge to automatically rebuild the correct repeater Docker image.


Files Changed

Repeater

  • dockerfile
  • .github/workflows/docker-publish.yml
  • docker-compose.yml
  • README.md

Core

  • .github/workflows/trigger-repeater-docker-rebuild.yml

Why This Matters

This removes the stale-core-in-fresh-image problem and keeps main and dev channels aligned across repositories.

It also makes the published Docker images the real source of truth for:

  • Direct Docker users
  • Downstream consumers
  • Home Assistant add-ons
  • Automated deployments

Notes

Required Secret

The core-side dispatch workflow requires:

  • REPEATER_REPO_DISPATCH_TOKEN

Manual Workflow Support

The repeater publish workflow still supports manual workflow_dispatch, but:

  • Normal channel selection is now automatic
  • Manual core commit entry is no longer required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant