build: serve the TEZI feed from the tree instead of /var/www/html - #319
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
httpdeploy rsynced into/var/www/html/verdin-imx8mp-prodwith sudo. That required an nginx serving that document root, a root-owned directory outside the tree, a machine-specific absolute path in a trackedlocal.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_PATHdefaults to${IB_DIR}/build/deploy/tezi/${IB_PLATFORM}— inside the tree, already bind-mounted, owned by the calling user, so no privilege needed. The sudorsyncstays only as a fallback for a document root that really is root-owned. Underbuild/deploy/rather thanbuild/tmp/so a clean does not wipe a feed a board may be pulling from.__do_platform_deployalso writesimage_list.jsonnext toimage.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.scripts/tezi-feed-serve.shserves it: a detachedpython3 -m http.serveronIB_HTTP_FEED_PORT(8080, unprivileged), with--ensure/--status/--stop.deploy.shcalls--ensureso a deploy leaves a working feed behind;dbuild.shcalls it on the host after the container exits, since--rmwould take down a server started inside. No-op under$CIand inside the container.build/conf/site.conf, included bybitbake.confafterlocal.conf.dbuild.shalso probes the daemon (docker info→DockerRootDirunder/var/snap) to spot a snap Docker hiding behind the/usr/bin/dockerwrapper, and skips feeds that are tree-relative or left unexpanded.Two related
.gitignorefixes/build/conf/site.confmust be ignored explicitly, because!/build/conf/re-includes the whole directory.!/build/meta/un-ignores the core layer, whichmeta-*never matched.build/meta/conf/bitbake.confwas tracked only because it predates the rule — without this fix, this very commit could not have added a file there. (pos_solalready carries this fix.)Not propagated
This tree has no
.gitlab-ci.ymland noscripts/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 --statusprints that exact line).Testing
sh -nclean ondbuild.sh,deploy.sh,tezi-feed-serve.sh; Python compile of__do_platform_deploy.bitbake -eparses clean:IB_HTTP_DEPLOY_PATH="<tree>/build/../build/deploy/tezi/virt64",IB_HTTP_FEED_PORT="8080".tezi-feed-serve.sh --statusresolves the feed path fromlocal.conf.httpinstall 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_soltree.