Skip to content

Migrate dashboard to esphome-device-builder and build with uv - #63

Merged
ptr727 merged 11 commits into
developfrom
support-device-builder
Jun 21, 2026
Merged

Migrate dashboard to esphome-device-builder and build with uv#63
ptr727 merged 11 commits into
developfrom
support-device-builder

Conversation

@ptr727

@ptr727 ptr727 commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Closes #60.

ESPHome split its dashboard into the separate esphome-device-builder package. This installs it alongside the esphome[displays] compiler and launches esphome-device-builder /config.

Changes

  • Dashboard: Docker/entrypoint/dashboard.sh now runs esphome-device-builder /config. It binds 0.0.0.0:6052 and serves /version, so the port, healthcheck, and entrypoint passthrough model are unchanged. (Kept this project's entrypoint/passthrough model rather than upstream's dashboard-subcommand routing.)
  • Build → uv: the builder stage builds a uv virtual environment (uv venv /opt/venv + uv pip install esphome[displays]==$VER esphome-device-builder==$VER) and the slim final stage copies it whole (PATH=/opt/venv/bin). Removes the wheel-archive shuffle, keeps build tools out of the final image, matches upstream's uv move.
  • Pin + auto-track both versions: esphome-version.json gains device_builder_version; check-esphome-version.yml resolves/bumps both from PyPI (one rolling PR); build-docker-task.yml passes both as build-args; a device_builder_version image label is added. The image tag still tracks the esphome version.
  • Docs: version.json → 1.7; new HISTORY.md (full history, template style); README release notes trimmed to the current release + link; Project Design updated to the uv approach.

Verification (local, amd64)

Built the image and ran it as --user 1001:100:

  • /version healthy in ~6s; device-builder boots fully; ESPHome CLI sanity check OK (2026.6.2) via /opt/venv/bin/esphome; binds 0.0.0.0:6052.
  • All device-builder state written under /config as uid 1001 with no EACCES / no root-owned files: .device-builder.json (0600), .device-builder-peer-link-key.bin (0600), secrets.yaml, and the git version-history tree.
  • Boots healthy with and without a /cache volume (tmpfs /tmp).
  • Labels: esphome_version=2026.6.2, device_builder_version=1.0.12, version=1.7.x.

actionlint + markdownlint clean.

CI note

This is the first real exercise of the new pipeline: the PR touches Docker/**, esphome-version.json, and version.json, so test-pull-request.yml runs the amd64-only smoke build (no push). The build-only smoke can't catch runtime issues — covered by the local non-root run above. Full multi-arch publish stays deferred to workflow_dispatch/the weekly schedule.

🤖 Generated with Claude Code

ESPHome moved its dashboard into the separate `esphome-device-builder`
package; install it alongside the `esphome[displays]` compiler and launch
`esphome-device-builder /config` (issue #60). It binds 0.0.0.0:6052 and serves
/version, so the port, healthcheck, and the entrypoint passthrough model are
unchanged.

Build: replace the pip wheel-archive stage with a `uv` virtual environment
built in the builder stage and copied whole into the slim final stage
(PATH=/opt/venv/bin), keeping build tools out of the final image and matching
upstream's move to uv.

Pin and auto-track both upstream versions: esphome-version.json gains
`device_builder_version`, check-esphome-version.yml resolves and bumps both
from PyPI, and build-docker-task.yml passes both as build-args. A
device_builder_version image label is added; the image tag still tracks the
esphome version.

Docs: bump version.json to 1.7, add HISTORY.md (full history, template style),
and trim the README release notes to the current release plus a link.

Verified locally: the amd64 image builds, and as user 1001:100 the dashboard
starts, /version is healthy, the ESPHome CLI sanity check passes, and all
device-builder state (.device-builder*.json, peer-link key, secrets.yaml, the
git version-history tree) is written under /config as the non-root user with
no permission errors, with and without a /cache volume.
Copilot AI review requested due to automatic review settings June 21, 2026 02:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Docker image to follow ESPHome's dashboard split by switching the container entrypoint to esphome-device-builder, and modernizes the build by constructing a self-contained uv virtual environment in the builder stage and copying it into the final image. It also extends version pinning/tracking so both ESPHome and device-builder versions can be resolved and bumped together.

Changes:

  • Switch dashboard startup from esphome dashboard /config to esphome-device-builder /config.
  • Build/install ESPHome + device-builder into a uv venv in the builder stage and copy it into the slim final stage (no build toolchain in final image).
  • Track and bump both esphome and esphome-device-builder versions via esphome-version.json + the scheduled version-check workflow; pass both as Docker build args and label the image accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
version.json Bumps NBGV version floor from 1.6 to 1.7.
README.md Trims release notes to current release and links to full history; updates design notes to mention uv.
HISTORY.md Adds a dedicated release history document for older versions.
esphome-version.json Extends the pin file to include device_builder_version alongside ESPHome version.
Docker/entrypoint/dashboard.sh Launches the new esphome-device-builder dashboard process.
Docker/Dockerfile Switches install strategy to a copied uv virtual environment and adds device-builder version labeling/build args.
.github/workflows/check-esphome-version.yml Resolves and bumps both upstream PyPI versions in a single rolling PR per branch.
.github/workflows/build-docker-task.yml Reads/passes both pinned versions as build args for the Docker build.

Comment thread Docker/Dockerfile Outdated
Comment thread Docker/Dockerfile Outdated
Comment thread .github/workflows/build-docker-task.yml Outdated
ptr727 added 2 commits June 20, 2026 19:57
Construct each pip spec with ${VAR:+==$VAR} so passing only one of
ESPHOME_VERSION / DEVICE_BUILDER_VERSION pins that package instead of silently
installing latest for both. Reword the build-arg and version-step comments to
not overstate reproducibility and to cover both pinned versions.
Relocate the License section below all content, convert remaining inline
https URLs to reference-style links, and collect every link definition at the
bottom sorted alphabetically (relative repo links stay inline).
Copilot AI review requested due to automatic review settings June 21, 2026 03:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread HISTORY.md
Comment thread README.md Outdated
device-builder does not honor ESPHOME_DASHBOARD_USE_PING; it always uses an
mDNS browser with a periodic ping fallback for device state. Drop it from the
README config docs, the Compose example, and the devcontainer env.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md
Comment thread HISTORY.md
Comment thread esphome-version.json Outdated
- Use past tense for the 1.7 'pinned and auto-tracked' changelog bullet
- Fix 'Code and pipeline are on GitHub' subject-verb agreement
- Convert HISTORY.md list URLs to reference-style with a sorted definition block
- Capitalize ESPHome in the esphome-version.json comment
Clarify the AGENTS.md Markdown convention to allow a trailing backslash for
intentional hard line breaks (badges, status, license blocks), preferred over
trailing whitespace - so reviews stop flagging the explicit form.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/build-docker-task.yml Outdated
Comment thread .github/workflows/check-esphome-version.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/check-esphome-version.yml
Comment thread .github/workflows/check-esphome-version.yml Outdated
Comment thread .github/workflows/build-docker-task.yml Outdated
Comment thread README.md Outdated
…d wording

- Capitalize ESPHome in the build-docker comment and the tracker PR body
- Split the PyPI version-resolution null-check so the error names which lookup failed
- Reword the README build line: image rebuilds on the weekly schedule and on demand (two-phase), not event-driven on release

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/check-esphome-version.yml Outdated
Comment thread Docker/Dockerfile Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/build-docker-task.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread Docker/entrypoint/dashboard.sh
@ptr727
ptr727 merged commit bde136c into develop Jun 21, 2026
10 checks passed
@ptr727
ptr727 deleted the support-device-builder branch June 21, 2026 04:06
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.

2 participants