109 lines
3.3 KiB
YAML
109 lines
3.3 KiB
YAML
name: Release Docker Images Nightly Miles ROCm7.2 (AMD)
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 12 * * *"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
publish:
|
|
if: github.repository == 'sgl-project/sglang'
|
|
runs-on: amd-docker-scale
|
|
environment: "prod"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- gpu_arch: gfx950
|
|
rocm_tag: rocm720-mi35x
|
|
sglang_image_tag: v0.5.10-rocm720-mi35x
|
|
steps:
|
|
- name: Checkout miles repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: radixark/miles
|
|
ref: main
|
|
fetch-depth: 0
|
|
|
|
- name: Set date
|
|
run: echo "DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
|
|
|
|
- name: Record miles commit
|
|
id: miles
|
|
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Login to Docker Hub (AMD)
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_AMD_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_AMD_TOKEN }}
|
|
|
|
- name: Build and push miles image to rocm/sgl-dev
|
|
run: |
|
|
base="miles-${{ matrix.rocm_tag }}"
|
|
dated="${base}-${{ env.DATE }}"
|
|
echo "IMAGE_TAG=${dated}" >> $GITHUB_ENV
|
|
echo "Building rocm/sgl-dev:${dated} from miles main @ ${{ steps.miles.outputs.sha }}"
|
|
docker build . \
|
|
-f docker/Dockerfile.rocm \
|
|
--build-arg GPU_ARCH=${{ matrix.gpu_arch }} \
|
|
--build-arg SGLANG_IMAGE_TAG=${{ matrix.sglang_image_tag }} \
|
|
--build-arg MILES_COMMIT=${{ steps.miles.outputs.sha }} \
|
|
-t rocm/sgl-dev:${dated} \
|
|
--no-cache
|
|
docker push rocm/sgl-dev:${dated}
|
|
|
|
- name: Save published image tag
|
|
run: |
|
|
mkdir -p image-tag
|
|
echo "${{ env.IMAGE_TAG }}" > "image-tag/${{ matrix.gpu_arch }}.txt"
|
|
|
|
- name: Upload image tag artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: image-tag-${{ matrix.gpu_arch }}
|
|
path: image-tag/${{ matrix.gpu_arch }}.txt
|
|
retention-days: 1
|
|
|
|
push_local_registry:
|
|
if: ${{ !cancelled() && github.repository == 'sgl-project/sglang' }}
|
|
runs-on: linux-mi300-1gpu-sglang
|
|
environment: "prod"
|
|
needs: publish
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
gpu_arch: ["gfx950"]
|
|
steps:
|
|
- name: Download image tag artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: image-tag-${{ matrix.gpu_arch }}
|
|
|
|
- name: Read image tag
|
|
run: |
|
|
image_tag=$(tr -d "[:space:]" < "${{ matrix.gpu_arch }}.txt")
|
|
if [ -z "${image_tag}" ]; then
|
|
echo "::error::Image tag artifact is empty"
|
|
exit 1
|
|
fi
|
|
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_ENV
|
|
|
|
- name: Login to Docker Hub (AMD)
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_AMD_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_AMD_TOKEN }}
|
|
|
|
- name: Mirror rocm/sgl-dev to local registry
|
|
run: |
|
|
src="rocm/sgl-dev:${{ env.IMAGE_TAG }}"
|
|
dst="10.245.143.50:5000/rocm/sgl-dev:${{ env.IMAGE_TAG }}"
|
|
docker pull "${src}"
|
|
docker tag "${src}" "${dst}"
|
|
docker push "${dst}"
|