diff --git a/.github/workflows/release-docker-amd-nightly.yml b/.github/workflows/release-docker-amd-nightly.yml index ea9949238..74827c28d 100644 --- a/.github/workflows/release-docker-amd-nightly.yml +++ b/.github/workflows/release-docker-amd-nightly.yml @@ -43,8 +43,16 @@ jobs: exit 1 fi + # Get short commit hash of current HEAD + COMMIT_HASH=$(git rev-parse --short HEAD) + + # Compose pretend version for setuptools_scm: e.g., 0.5.8.dev20260129+g1a2b3c4 + PRETEND_VERSION="${VERSION}.dev${{ env.DATE }}+g${COMMIT_HASH}" + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "pretend_version=${PRETEND_VERSION}" >> $GITHUB_OUTPUT echo "Detected version: ${VERSION}" + echo "Pretend version for pip: ${PRETEND_VERSION}" - name: Login to Docker Hub uses: docker/login-action@v2 @@ -55,7 +63,9 @@ jobs: - name: Build and Push run: | version=${{ steps.version.outputs.version }} + pretend_version=${{ steps.version.outputs.pretend_version }} echo "Version: ${version}" + echo "Pretend version: ${pretend_version}" if [ "${{ matrix.gpu_arch }}" = "gfx942" ]; then rocm_tag="rocm700-mi30x" @@ -68,7 +78,7 @@ jobs: tag=v${version}-${rocm_tag} - docker build . -f docker/rocm.Dockerfile --build-arg BUILD_TYPE=${{ matrix.build_type }} --build-arg GPU_ARCH=${{ matrix.gpu_arch }} -t rocm/sgl-dev:${tag}-${{ env.DATE }} --no-cache + docker build . -f docker/rocm.Dockerfile --build-arg BUILD_TYPE=${{ matrix.build_type }} --build-arg GPU_ARCH=${{ matrix.gpu_arch }} --build-arg SETUPTOOLS_SCM_PRETEND_VERSION=${pretend_version} -t rocm/sgl-dev:${tag}-${{ env.DATE }} --no-cache docker push rocm/sgl-dev:${tag}-${{ env.DATE }} # Temporarily disable docker cache seeding until performant storage is in place diff --git a/docker/rocm.Dockerfile b/docker/rocm.Dockerfile index ab2c23040..adb39f190 100644 --- a/docker/rocm.Dockerfile +++ b/docker/rocm.Dockerfile @@ -41,6 +41,9 @@ ARG SGL_REPO="https://github.com/sgl-project/sglang.git" ARG SGL_DEFAULT="main" ARG SGL_BRANCH=${SGL_DEFAULT} +# Version override for setuptools_scm (used in nightly builds) +ARG SETUPTOOLS_SCM_PRETEND_VERSION="" + ARG TRITON_REPO="https://github.com/ROCm/triton.git" ARG TRITON_COMMIT="improve_fa_decode_3.0.0" @@ -158,6 +161,10 @@ RUN if [ "$BUILD_MOONCAKE" = "1" ]; then \ # Build SGLang ARG BUILD_TYPE=all +# Set version for setuptools_scm if provided (for nightly builds) +ARG SETUPTOOLS_SCM_PRETEND_VERSION +ENV SETUPTOOLS_SCM_PRETEND_VERSION=${SETUPTOOLS_SCM_PRETEND_VERSION} + RUN pip install IPython \ && pip install orjson \ && pip install python-multipart \