Dockerfile.spdk: pass SPDK_GIT_COMMIT to RPM build#1658
Dockerfile.spdk: pass SPDK_GIT_COMMIT to RPM build#1658baum wants to merge 1 commit intoceph:develfrom
Conversation
gbregman
left a comment
There was a problem hiding this comment.
We already tried to use the same method with other env variables, like NVMEOF_GIT_COMMIT and it didn't work in downstream. As I said, something is different in the way containers are used in the downstream versions. The variables from the Dockerfile are not set. When you open a shell in the gateway container and display the environment you don't see all these values.
As I understand, they might have changed the way they build the downstream, we should check it again. But at least as of two weeks ago, this didn't work.
Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
Thank you for looking into this, @gbregman . Rebased the PR on the current 25.09 spdk branch. To avoid any surprises or breakage downstream, let’s make sure we discuss the proposed changes with the teams/people responsible for the downstream builds before we proceed. It might be a good idea to make spdk SHA report consistent (Issue: #1660), see current demo (unsecured) Display logs https://github.com/ceph/ceph-nvmeof/actions/runs/20001536464/job/57357871175: Using the change above this inconsistency is resolved. |
Dockerfile.spdk: pass SPDK_GIT_COMMIT to RPM build
Issue: #1660
Pass SPDK git commit hash via build argument. In ceph-nvmeof context SPDK is used as a git submodule and the .git directory is not available in the container build context, automatic detection via
git rev-parsefails. The commit hash is now provided by the parent Makefile as the SPDK_GIT_COMMIT build argument to Dockerfile.spdk.SPDK git commit calculation and build flow:
git rev-parse HEAD:spdk(submodule commit from parent repo)SPDK_GIT_COMMIT=$SPDK_GIT_COMMIT rpmbuild/rpm.shCOMMON_CFLAGS += -DSPDK_GIT_COMMIT=$(SPDK_GIT_COMMIT)