Skip to content

build: serve the TEZI feed from the tree instead of /var/www/html - #319

Merged
daniel-rossier merged 1 commit into
mainfrom
build/tezi-feed-in-tree
Aug 14, 2026
Merged

build: serve the TEZI feed from the tree instead of /var/www/html#319
daniel-rossier merged 1 commit into
mainfrom
build/tezi-feed-in-tree

Conversation

@daniel-rossier

Copy link
Copy Markdown
Contributor

Propagates the edgem1 change 77707b54 ("[env]: Add local deploy into the IB tree", David Truan) into this tree, so both deploy the Verdin the same way.

Before

A verdin http deploy rsynced into /var/www/html/verdin-imx8mp-prod with sudo. That required an nginx serving that document root, a root-owned directory outside the tree, a machine-specific absolute path in a tracked local.conf, and — with a snap-packaged Docker, which cannot bind-mount outside $HOME — publishing from inside the build container was impossible.

After

  • IB_HTTP_DEPLOY_PATH defaults to ${IB_DIR}/build/deploy/tezi/${IB_PLATFORM} — inside the tree, already bind-mounted, owned by the calling user, so no privilege needed. The sudo rsync stays only as a fallback for a document root that really is root-owned. Under build/deploy/ rather than build/tmp/ so a clean does not wipe a feed a board may be pulling from.
  • __do_platform_deploy also writes image_list.json next to image.json, so the feed directory is self-contained: whoever serves it can use it as-is as its document root, and the board URL is always <root>/image_list.json.
  • New scripts/tezi-feed-serve.sh serves it: a detached python3 -m http.server on IB_HTTP_FEED_PORT (8080, unprivileged), with --ensure / --status / --stop. deploy.sh calls --ensure so a deploy leaves a working feed behind; dbuild.sh calls it on the host after the container exits, since --rm would take down a server started inside. No-op under $CI and inside the container.
  • Per-machine deviations go in the new untracked build/conf/site.conf, included by bitbake.conf after local.conf.
  • dbuild.sh also probes the daemon (docker infoDockerRootDir under /var/snap) to spot a snap Docker hiding behind the /usr/bin/docker wrapper, and skips feeds that are tree-relative or left unexpanded.

Two related .gitignore fixes

  • /build/conf/site.conf must be ignored explicitly, because !/build/conf/ re-includes the whole directory.
  • !/build/meta/ un-ignores the core layer, which meta-* never matched. build/meta/conf/bitbake.conf was tracked only because it predates the rule — without this fix, this very commit could not have added a file there. (pos_sol already carries this fix.)

Not propagated

This tree has no .gitlab-ci.yml and no scripts/tezi-custom/, so the feed URL is handed to the board by hand: tezictl feed-add http://<host>:8080/image_list.json (tezi-feed-serve.sh --status prints that exact line).

Testing

  • sh -n clean on dbuild.sh, deploy.sh, tezi-feed-serve.sh; Python compile of __do_platform_deploy.
  • bitbake -e parses clean: IB_HTTP_DEPLOY_PATH="<tree>/build/../build/deploy/tezi/virt64", IB_HTTP_FEED_PORT="8080".
  • tezi-feed-serve.sh --status resolves the feed path from local.conf.
  • No hardware test — no Verdin available, so the real http install path is unverified end to end here (it is the code already running in the edgem1 tree).

The same change is applied to the pos_sol tree.

Propagated from the edgem1 tree (77707b54, "[env]: Add local deploy into
the IB tree", David Truan) so both trees deploy the Verdin the same way.

A verdin `http` deploy used to rsync into /var/www/html/verdin-imx8mp-prod
with sudo, which meant an nginx serving that document root, a root-owned
directory outside the tree, a machine-specific absolute path in a TRACKED
local.conf, and — with a snap-packaged Docker, which cannot bind-mount
outside $HOME — no way to publish from inside the build container at all.

IB_HTTP_DEPLOY_PATH now defaults to ${IB_DIR}/build/deploy/tezi/${IB_PLATFORM},
which is already bind-mounted and owned by the calling user, so publishing
needs no privilege; the sudo rsync stays only as a fallback for a document
root that really is root-owned. It sits under build/deploy/ rather than
build/tmp/ so a clean does not wipe a feed a board may be pulling from.

do_platform_deploy also writes image_list.json next to image.json, making
the feed directory self-contained: whoever serves it can use it as-is as
its document root, and the board URL is always <root>/image_list.json.

Serving it is the new scripts/tezi-feed-serve.sh — a detached
`python3 -m http.server` on IB_HTTP_FEED_PORT (8080, unprivileged) with
--ensure/--status/--stop. deploy.sh calls --ensure so a deploy leaves a
working feed behind; dbuild.sh calls it on the HOST after the container
exits, since --rm would take a server started inside down with it. It is
a no-op under $CI and inside the container.

Per-machine deviations go in the new build/conf/site.conf, included by
bitbake.conf after local.conf and untracked.

Two related .gitignore fixes: site.conf must be ignored explicitly because
!/build/conf/ re-includes the whole directory, and !/build/meta/ un-ignores
the core layer, which "meta-*" never matched — build/meta/conf/bitbake.conf
was tracked only because it predates the rule, so this very commit could
not have added a file there.

Verdin-specific parts of the edgem1 commit do not apply here: this tree has
no .gitlab-ci.yml and no scripts/tezi-custom/, so the feed URL is handed to
the board by hand with `tezictl feed-add http://<host>:8080/image_list.json`
(tezi-feed-serve.sh --status prints that line).
@daniel-rossier
daniel-rossier merged commit 9f25177 into main Aug 14, 2026
6 checks passed
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