[AMD CI] fix sglang version detection in daily docker image release and init container (#16367)
https://github.com/sgl-project/sglang/actions/runs/20711245259/job/59453869006?pr=16367 to be fixed in https://github.com/sgl-project/sglang/pull/15663
This commit is contained in:
@@ -25,11 +25,27 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Required for git describe to find tags
|
||||||
|
|
||||||
- name: "Set Date"
|
- name: "Set Date"
|
||||||
run: |
|
run: |
|
||||||
echo "DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
|
echo "DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get version from latest tag
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
# Get the latest version tag sorted by version number (e.g., v0.5.7 -> 0.5.7)
|
||||||
|
VERSION=$(git tag -l 'v[0-9]*' --sort=-v:refname | head -1 | sed 's/^v//')
|
||||||
|
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "::error::Could not determine version from git tags"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Detected version: ${VERSION}"
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -38,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
run: |
|
run: |
|
||||||
version=$(cat python/sglang/version.py | cut -d'"' -f2)
|
version=${{ steps.version.outputs.version }}
|
||||||
echo "Version: ${version}"
|
echo "Version: ${version}"
|
||||||
|
|
||||||
if [ "${{ matrix.gpu_arch }}" = "gfx942" ]; then
|
if [ "${{ matrix.gpu_arch }}" = "gfx942" ]; then
|
||||||
@@ -70,11 +86,27 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Required for git describe to find tags
|
||||||
|
|
||||||
- name: "Set Date"
|
- name: "Set Date"
|
||||||
run: |
|
run: |
|
||||||
echo "DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
|
echo "DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get version from latest tag
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
# Get the latest version tag sorted by version number (e.g., v0.5.7 -> 0.5.7)
|
||||||
|
VERSION=$(git tag -l 'v[0-9]*' --sort=-v:refname | head -1 | sed 's/^v//')
|
||||||
|
|
||||||
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "::error::Could not determine version from git tags"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Detected version: ${VERSION}"
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -85,7 +117,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
version=$(cat python/sglang/version.py | cut -d'"' -f2)
|
version=${{ steps.version.outputs.version }}
|
||||||
echo "Version: ${version}"
|
echo "Version: ${version}"
|
||||||
|
|
||||||
if [ "${{ matrix.gpu_arch }}" = "gfx942" ]; then
|
if [ "${{ matrix.gpu_arch }}" = "gfx942" ]; then
|
||||||
|
|||||||
@@ -1,27 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Get version from SGLang version.py file
|
# Get version from git tags
|
||||||
SGLANG_VERSION_FILE="$(dirname "$0")/../../python/sglang/version.py"
|
SGLANG_VERSION="v0.5.5" # Default version, will be overridden if git tags are found
|
||||||
SGLANG_VERSION="v0.5.5" # Default version, will be overridden if version.py is found
|
|
||||||
|
|
||||||
TMP_VERSION_FILE=$(mktemp)
|
# Fetch tags from origin to ensure we have the latest
|
||||||
if git fetch --depth=1 origin main; then
|
if git fetch --tags origin; then
|
||||||
if git show origin/main:python/sglang/version.py >"$TMP_VERSION_FILE" 2>/dev/null; then
|
# Get the latest version tag sorted by version number (e.g., v0.5.7)
|
||||||
VERSION_FROM_FILE="v$(cat "$SGLANG_VERSION_FILE" | cut -d'"' -f2)"
|
VERSION_FROM_TAG=$(git tag -l 'v[0-9]*' --sort=-v:refname | head -1)
|
||||||
if [ -n "$VERSION_FROM_FILE" ]; then
|
if [ -n "$VERSION_FROM_TAG" ]; then
|
||||||
SGLANG_VERSION="$VERSION_FROM_FILE"
|
SGLANG_VERSION="$VERSION_FROM_TAG"
|
||||||
echo "Using SGLang version from origin/main: $SGLANG_VERSION"
|
echo "Using SGLang version from git tags: $SGLANG_VERSION"
|
||||||
else
|
else
|
||||||
echo "Warning: Could not parse version from origin/main; using default $SGLANG_VERSION" >&2
|
echo "Warning: No version tags found; using default $SGLANG_VERSION" >&2
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Warning: version.py not found on origin/main; using default $SGLANG_VERSION" >&2
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Warning: failed to fetch origin/main; using default $SGLANG_VERSION" >&2
|
echo "Warning: Failed to fetch tags from origin; using default $SGLANG_VERSION" >&2
|
||||||
fi
|
fi
|
||||||
rm -f "$TMP_VERSION_FILE"
|
|
||||||
|
|
||||||
|
|
||||||
# Default base tags (can be overridden by command line arguments)
|
# Default base tags (can be overridden by command line arguments)
|
||||||
|
|||||||
Reference in New Issue
Block a user