Skip to content

vpp-manager: update version file even when VPP build is cached#876

Open
aritrbas wants to merge 1 commit intomasterfrom
abasu-fix-version
Open

vpp-manager: update version file even when VPP build is cached#876
aritrbas wants to merge 1 commit intomasterfrom
abasu-fix-version

Conversation

@aritrbas
Copy link
Collaborator

@aritrbas aritrbas commented Feb 5, 2026

Summary:

Cached VPP tarballs include the calicovppversion file from the time VPP was built. When CI reuses the tarball for later commits, the VPP image reports a stale dataplane commit while the agent image reports the current commit.

RCA

The version-file target (which writes the current git commit to calicovppversion) is only called as a dependency of the vpp target. The VPP build system caches build artifacts in a tarball (vpp-${VPP_HASH}.tar) to avoid rebuilding VPP when there are no new changes. When the tarball already exists locally or is fetched from S3 in CI, the vpp target is never invoked. So the version-file target never runs. and the stale calicovppversion file baked in the cached tarball gets copied into the final docker images.

Fix

After extracting the cached tarball but before running docker build, overwrite the calicovppversion file with the current git commit information. This ensures the version metadata is always up to date while preserving the VPP build caching optimization.

When VPP tarball is cached (CI or local), the version file baked into the
tarball becomes stale. Overwrite it after extraction to always reflect the
current commit.

Signed-off-by: Aritra Basu <aritrbas@cisco.com>
@aritrbas aritrbas requested a review from sknat February 5, 2026 22:59
@aritrbas aritrbas self-assigned this Feb 5, 2026
Copy link
Collaborator

@sknat sknat left a comment

Choose a reason for hiding this comment

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

Agreed, this would work, but I think I'd be more comfortable with
an approach where we:

  • remove the VPP-dataplane version and Image tag from the calicovppversion file
  • Add the following to our dockerfiles
ARG GIT_COMMIT=unknown
LABEL git-commit=$GIT_COMMIT
  • run our builds with docker build --build-arg GIT_COMMIT=$(git log -1 --oneline)
  • This should be relatively easy as we have DOCKER_BUILD_ARGS referenced everywhere

That way the VPP version file will rightfully belong alongside VPP build

What do you think ?

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