version: support OCI labels, version file in tar files, app version report, and dashboard (other dashboard enhancements) - #505
version: support OCI labels, version file in tar files, app version report, and dashboard (other dashboard enhancements)#505gmarzot wants to merge 7 commits into
Conversation
michalhosna
left a comment
There was a problem hiding this comment.
Why is this docker-only? Shouldn't we be able to bake this to every binary? Even for local-dev builds this would be nice.
I.e. move this logic from docker to cmake?
@michalhosna made 2 comments.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on afrind, gmarzot, and mondain).
.github/workflows/ci-main.yml line 389 at r1 (raw file):
# Leading "v" stripped — /info reports bare semver-style ("0.2.1", # "0.2.1-14-gabc1234"); display layers add their own "v". echo "describe=$(git describe --tags --always | sed 's/^v//')" >> "$GITHUB_OUTPUT"
This may resolve to snapshot-latest, it probably needs some logic to only care about v prefixed tags?
michalhosna
left a comment
There was a problem hiding this comment.
@michalhosna made 1 comment.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on afrind, gmarzot, and mondain).
.github/workflows/ci-main.yml line 389 at r1 (raw file):
Previously, michalhosna (Michal Hošna) wrote…
This may resolve to
snapshot-latest, it probably needs some logic to only care aboutvprefixed tags?
Something like this should work
git describe --tags --match 'v[0-9].*'
mondain
left a comment
There was a problem hiding this comment.
@mondain reviewed 3 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on afrind and gmarzot).
yes - good idea. updates added. |
Addresses review on #505. Why docker-only was wrong: the version was a docker --build-arg, so only published images carried a real one — local builds, release tarballs and the artifact tarball all reported the static project version (0.1.0). Derivation now lives in cmake/MoqxVersion.cmake with an explicit precedence chain: 1. -DMOQX_VERSION_STRING explicit (release workflow passes the tag) 2. <src>/VERSION stamped by CI; docker + source tarballs have no .git, so this is how they resolve 3. git describe any clone, including local dev builds 4. v${PROJECT_VERSION} last resort Tag filtering is load-bearing. The repo carries moving non-version tags (snapshot-latest, build-*, archive/*); an unfiltered describe returns "snapshot-latest" as the version of every image built from main — demonstrated on 4969f8c, where naive describe gives snapshot-latest and --match 'v[0-9]*' gives the sha. The v prefix is kept: the string is a git identifier and round-trips into git checkout / gh release view. Generalization payoff, all verified in a container build: - moqx --version -> moqx version v0.2.1-2-g59fe6a9b - admin /info -> {"service":"moqx","version":"v0.2.1-2-g59fe6a9b"} - startup log banner -> first line attributes the log stream to a build - /usr/local/VERSION -> identify an image without executing it - install tree VERSION -> release + snapshot tarballs carry the id The version is now an interface target (moqx_version) carrying a generated header, so any target can use it — not a private compile definition on moqx_core.
|
Both review points addressed in 73a1bf7. "Why is this docker-only? Move the logic to cmake" — done. Derivation now lives in
The build arg is now just an override, not the mechanism. Local builds get a real version with no CI involvement (and a "This may resolve to The tag moves to the newest main commit on every publish, so it would have overtaken One deliberate change of direction: the leading Since the version is no longer welded to plus a startup log banner so a relay's log stream is attributable to a build, and Verified locally end to end: full docker build with no build-arg (resolving purely through the stamped VERSION file), all four precedence levels exercised, and both workflow files YAML-validated. |
|
@michalhosna good to go? |
michalhosna
left a comment
There was a problem hiding this comment.
@michalhosna made 4 comments.
Reviewable status: 0 of 9 files reviewed, 5 unresolved discussions (waiting on afrind, gmarzot, and mondain).
-- commits line 67 at r3:
What commit message will land on main? This doesn't seem reviable
cmake/MoqxVersion.cmake line 9 at r3 (raw file):
# # Format is git-describe output with the "v" tag prefix retained, so the # string round-trips into `git checkout` / `gh release view`:
Why does the PR comment, commit message and this comment talk about gh release view?
It seems to me everything this does is pure git, and gh is used only in the CI.
cmake/MoqxVersion.cmake line 31 at r3 (raw file):
# # Only v-prefixed numeric tags are considered. The repo also carries moving # tags (snapshot-latest, build-*, archive/*) that are NOT versions; an
Nit: I don't think remarks about what other tags currently exists (snapshot-latest, build-*, archive/*) really make sense.
If we start doing tags differently, this file becomes out-of-date.
Generally, could the comments (and git commit messages) be toned down? Its adding a lot of not-that-useful text to review.
docker/Dockerfile line 55 at r3 (raw file):
# executing it — inspecting a layer, or a foreign-arch image that cannot run # here. `docker run --rm <image> moqx --version` reports the same string. COPY --from=builder /install/VERSION /usr/local/VERSION
VERSION file can drift from the baked-in version.
Even just passing MOQX_VERSION_STRING build arg different from the VERSION file will make them drift.
Is /usr/local/VERSION something standard/commonly used? I cannot find a good outside reference.
Why not use standardized labels? See https://specs.opencontainers.org/image-spec/annotations/
For example
ARG MOQX_VERSION_STRING=""
LABEL org.opencontainers.image.version="$MOQX_VERSION_STRING" \
org.opencontainers.image.source="https://github.com/openmoq/moqx"
but probably include a more complete set if we want to do this. FYI there's oficial action for gh https://github.com/docker/metadata-action
And then the whole VERSION file logic can be dropped
michalhosna
left a comment
There was a problem hiding this comment.
@michalhosna made 1 comment.
Reviewable status: 0 of 9 files reviewed, 6 unresolved discussions (waiting on afrind, gmarzot, and mondain).
cmake/MoqxVersion.cmake line 53 at r3 (raw file):
execute_process( COMMAND "${GIT_EXECUTABLE}" describe --tags --match "v[0-9]*" --always --dirty
--dirty is good, but FYI it doesn't catch untracked files, i.e. new files not yet in git.
michalhosna
left a comment
There was a problem hiding this comment.
@michalhosna reviewed 10 files and all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on afrind, gmarzot, and mondain).
Previously, michalhosna (Michal Hošna) wrote…
with squash-merge the pr title is the merged commit message. this detail is retained for more complete history |
|
Previously, michalhosna (Michal Hošna) wrote…
i think the point was the even though we tag w/ M.m.f the reported and and expected format in a number of cases has vM.m.f |
|
Previously, michalhosna (Michal Hošna) wrote…
--porcelain appears to produce the more sensitive detection of "dirty" .. but may also produce dirty in cases where it is not really relevant .. but it is now the sensitive mode and will catch the untracked file case |
|
Previously, michalhosna (Michal Hošna) wrote…
The other sources of version trump the file and the file is written/over-written by the true version. the VERSION file now is only relevant to tar files |
gmarzot
left a comment
There was a problem hiding this comment.
@gmarzot made 1 comment and resolved 2 discussions.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on afrind, michalhosna, and mondain).
.github/workflows/ci-main.yml line 389 at r1 (raw file):
Previously, michalhosna (Michal Hošna) wrote…
Something like this should work
git describe --tags --match 'v[0-9].*'
Done.
…eleases The relay reported the static CMake project version (0.1.0) forever — tags never touched it. Now the docker publish job computes `git describe --tags` (bare tag on release commits, e.g. v0.2.1; tag-distance-sha on snapshots, e.g. v0.2.1-14-g2ed29c8) and passes it through a build arg into MOQX_VERSION. Local builds keep the static fallback. The dashboard badge picks it up via the existing /info -> json-exporter -> moqx_build_info chain, no dashboard changes. Publish checkout needs fetch-depth 0 for describe to see tags. NOTE: the Dockerfile path is only exercised by the main publish job — watch the first post-merge publish.
…ys bare semver-style)
Addresses review on #505. Why docker-only was wrong: the version was a docker --build-arg, so only published images carried a real one — local builds, release tarballs and the artifact tarball all reported the static project version (0.1.0). Derivation now lives in cmake/MoqxVersion.cmake with an explicit precedence chain: 1. -DMOQX_VERSION_STRING explicit (release workflow passes the tag) 2. <src>/VERSION stamped by CI; docker + source tarballs have no .git, so this is how they resolve 3. git describe any clone, including local dev builds 4. v${PROJECT_VERSION} last resort Tag filtering is load-bearing. The repo carries moving non-version tags (snapshot-latest, build-*, archive/*); an unfiltered describe returns "snapshot-latest" as the version of every image built from main — demonstrated on 4969f8c, where naive describe gives snapshot-latest and --match 'v[0-9]*' gives the sha. The v prefix is kept: the string is a git identifier and round-trips into git checkout / gh release view. Generalization payoff, all verified in a container build: - moqx --version -> moqx version v0.2.1-2-g59fe6a9b - admin /info -> {"service":"moqx","version":"v0.2.1-2-g59fe6a9b"} - startup log banner -> first line attributes the log stream to a build - /usr/local/VERSION -> identify an image without executing it - install tree VERSION -> release + snapshot tarballs carry the id The version is now an interface target (moqx_version) carrying a generated header, so any target can use it — not a private compile definition on moqx_core.
The VERSION file is gitignored, so a stamp left in a working tree (e.g. after reproducing a CI build by hand) is invisible to git status and silently pinned every later build to a dead version. git describe now takes precedence whenever .git exists; the contexts that actually need the file — docker build context, source tarballs — have no .git and are unaffected. Verified: clone+stale file -> git describe wins; -DMOQX_VERSION_STRING still outranks both; a .git-less tree still reads the file. Also ignore /_build, the directory docker/Dockerfile and version-release.yml configure into — same hand-reproduced-CI scenario.
- describe --dirty only inspects tracked files; add a git status check so a tree with new files is not reported as a clean commit - images carry org.opencontainers.image.* labels and take the version via build-arg; drop the in-image VERSION file and the optional-copy glob - the VERSION file remains for tarballs, which have no label mechanism - trim comments per review
Active Tracks gains media columns (type, codec, resolution, fps, bitrate, data tx) as constant labels until metrics exist, plus QoS/QoE/status pills. Latency reports p50 and p99 overlaid; loss/drops in violet, egress green; wider rate windows to cut sampling noise. Banner collapses to a one-line logo+version strip before going single-column.
Overview: echarts readouts for latency/loss/ingress/egress with logo-derived trace colours, native pill cells for QoS/QoE/Status, LIVE vs DONE computed from the time window, stable top-10 subscriptions graph, full-resolution peak queries, placeholder media attributes derived from track names. prometheus: scrape /info at 10s so the version badge tracks a redeploy.
939c5e5 to
2a15a49
Compare
michalhosna
left a comment
There was a problem hiding this comment.
@michalhosna reviewed 2 files and all commit messages, made 1 comment, and resolved 4 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on afrind and mondain).
Previously, gmarzot (Giovanni Marzot) wrote…
with squash-merge the pr tiotle is the merged commit message. this detail is retained for more complete history
I'd prefer to see more human readable/human curated PR descriptions and commit messages, this is challenging to read.
The deployed relay still reports
0.1.0after the v0.2.1 release — the version is the static CMake project version and nothing updates it.This bakes
git describe --tagsinto the image at publish time:v0.2.1v0.2.1-14-g<sha>— identifies exactly what's deployed.git, hence the build-arg approach)Flows to the dashboard badge through the existing
/info→ json-exporter →moqx_build_infochain — zero dashboard changes. Publish checkout gainsfetch-depth: 0so describe can see tags.Caveat: the Dockerfile path only runs in the main publish job, so the proof is the first post-merge publish — the badge should flip from
v0.1.0tov0.2.1-N-g…on the following deploy.This change is