Skip to content

feat(rpm): use :dev image tag for non-release Packit builds#1218

Open
maxamillion wants to merge 3 commits intoNVIDIA:mainfrom
maxamillion:rpm-dev
Open

feat(rpm): use :dev image tag for non-release Packit builds#1218
maxamillion wants to merge 3 commits intoNVIDIA:mainfrom
maxamillion:rpm-dev

Conversation

@maxamillion
Copy link
Copy Markdown
Collaborator

Summary

RPM builds triggered by Packit for PRs and commits to main were always baking
:latest image tags into the compiled binaries and the installed systemd unit,
while the CI container pipeline only pushes :latest on tagged stable releases.
Main-branch and PR builds push :dev. This mismatch meant development RPMs
pointed at the wrong image stream.

This PR adds a %global image_tag macro (default: dev) to the spec file and
wires it through all three places where image tags appear. Packit's
fix-spec-file action now detects tagged stable releases via
git describe --exact-match and overrides the macro to latest. All other
build triggers keep the dev default.

Related Issue

N/A

Changes

  • openshell.spec: add %global image_tag dev macro; use %{image_tag} in
    the %build OPENSHELL_IMAGE_TAG export, the embedded systemd unit
    Environment= lines, and a sed in %install that patches the
    init-gateway-env.sh commented defaults to match
  • .packit.yaml: append a fix-spec-file step that runs
    git describe --exact-match and overrides %global image_tag to latest
    only when HEAD sits on a stable v*.*.* tag

Testing

  • mise run pre-commit passes (lint + clippy clean; license:check failures
    are pre-existing vendor/ SPDX issues unrelated to this change)
  • Unit tests added/updated (no Rust changes)
  • E2E tests added/updated (packaging-only change)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@maxamillion maxamillion requested review from a team, derekwaynecarr and mrunalp as code owners May 6, 2026 21:53
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 6, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@maxamillion maxamillion force-pushed the rpm-dev branch 2 times, most recently from 89bc74a to 99e9446 Compare May 6, 2026 22:00
TaylorMutch
TaylorMutch previously approved these changes May 6, 2026
drew
drew previously approved these changes May 6, 2026
@maxamillion maxamillion dismissed stale reviews from drew and TaylorMutch via 21d9f20 May 6, 2026 22:44
Comment thread openshell.spec Outdated
Metadata-Version: 2.1
Name: %{name}
Version: %{openshell_python_version}
Version: 0.0.37
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this meant to be hard coded?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

no, my coding agent went rogue and I missed it in my review...🤦

Add a %global image_tag macro to the spec file (default: dev) that
controls the container image tag baked into RPM-built binaries and
the installed systemd unit.

Packit's fix-spec-file action detects tagged stable releases via
git describe --exact-match and overrides the macro to 'latest'.
PR and commit-to-main builds keep the 'dev' default, matching the
:dev images pushed by release-dev.yml.

The init-gateway-env.sh installed copy is also patched at RPM build
time so its commented image defaults stay consistent with the tag
the RPM actually expects from the registry.

Signed-off-by: Adam Miller <admiller@redhat.com>
The community sandbox base image (ghcr.io/nvidia/openshell-community/
sandboxes/base) does not publish :dev tags -- only :latest and version-
pinned tags are available. Applying %{image_tag} to it caused a
manifest unknown error when pulling the image on non-release builds.

Scope the dynamic tag to the supervisor image only, which is part of
the core OpenShell release pipeline and does receive :dev tags from
release-dev.yml. The sandbox base image unconditionally uses :latest.

Also tighten the sed in %install to target only the supervisor image
line in init-gateway-env.sh rather than blanket-replacing all :latest
occurrences.

Signed-off-by: Adam Miller <admiller@redhat.com>
…TADATA

The Version field inside the METADATA heredoc was hardcoded to 0.0.37
instead of using the %%{openshell_python_version} macro. This caused
the installed Python dist-info to always report the wrong version on
non-release builds.

Signed-off-by: Adam Miller <admiller@redhat.com>
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.

3 participants