Auto Release - SGLang SageMaker #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto Release - SGLang SageMaker | |
| on: | |
| # schedule run must be on the default branch | |
| schedule: | |
| # Runs at 10:00 AM PST/PDT on Monday and Wednesday | |
| - cron: '00 17 * * 2,4' # Tuesday and Thursday at 10:00 AM PDT / 9:00 AM PST | |
| # # PR triggers for testing | |
| # pull_request: | |
| # paths: | |
| # - "**sglang**" | |
| # - "!docs/**" | |
| # Manual trigger | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| env: | |
| # CI environment configuration | |
| FORCE_COLOR: "1" | |
| # Config file path | |
| CONFIG_FILE: '.github/config/sglang-sagemaker.yml' | |
| jobs: | |
| load-config: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-load-config-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| outputs: | |
| config: ${{ steps.load.outputs.config }} | |
| framework: ${{ steps.parse.outputs.framework }} | |
| framework-version: ${{ steps.parse.outputs.framework-version }} | |
| python-version: ${{ steps.parse.outputs.python-version }} | |
| cuda-version: ${{ steps.parse.outputs.cuda-version }} | |
| os-version: ${{ steps.parse.outputs.os-version }} | |
| container-type: ${{ steps.parse.outputs.container-type }} | |
| device-type: ${{ steps.parse.outputs.device-type }} | |
| arch-type: ${{ steps.parse.outputs.arch-type }} | |
| contributor: ${{ steps.parse.outputs.contributor }} | |
| customer-type: ${{ steps.parse.outputs.customer-type }} | |
| prod-image: ${{ steps.parse.outputs.prod-image }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Load configuration | |
| id: load | |
| uses: ./.github/actions/load-config | |
| with: | |
| config-file: ${{ env.CONFIG_FILE }} | |
| - name: Parse configuration | |
| id: parse | |
| run: | | |
| echo '${{ steps.load.outputs.config }}' > config.json | |
| echo "framework=$(jq -r '.common.framework' config.json)" >> $GITHUB_OUTPUT | |
| echo "framework-version=$(jq -r '.common.framework_version' config.json)" >> $GITHUB_OUTPUT | |
| echo "python-version=$(jq -r '.common.python_version' config.json)" >> $GITHUB_OUTPUT | |
| echo "cuda-version=$(jq -r '.common.cuda_version' config.json)" >> $GITHUB_OUTPUT | |
| echo "os-version=$(jq -r '.common.os_version' config.json)" >> $GITHUB_OUTPUT | |
| echo "container-type=$(jq -r '.common.job_type' config.json)" >> $GITHUB_OUTPUT | |
| echo "device-type=$(jq -r '.common.device_type // "gpu"' config.json)" >> $GITHUB_OUTPUT | |
| echo "arch-type=$(jq -r '.common.arch_type // "x86"' config.json)" >> $GITHUB_OUTPUT | |
| echo "contributor=$(jq -r '.common.contributor // "None"' config.json)" >> $GITHUB_OUTPUT | |
| echo "customer-type=$(jq -r '.common.customer_type // ""' config.json)" >> $GITHUB_OUTPUT | |
| echo "prod-image=$(jq -r '.common.prod_image' config.json)" >> $GITHUB_OUTPUT | |
| build-image: | |
| needs: [load-config] | |
| runs-on: | |
| - codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }} | |
| fleet:x86-build-runner | |
| buildspec-override:true | |
| concurrency: | |
| group: ${{ github.workflow }}-build-image-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| outputs: | |
| ci-image: ${{ steps.build.outputs.image-uri }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Build image | |
| id: build | |
| uses: ./.github/actions/build-image | |
| with: | |
| framework: ${{ needs.load-config.outputs.framework }} | |
| target: sglang-sagemaker | |
| base-image: lmsysorg/sglang:v${{ needs.load-config.outputs.framework-version }}-${{ needs.load-config.outputs.cuda-version }}-amd64 | |
| framework-version: ${{ needs.load-config.outputs.framework-version }} | |
| container-type: ${{ needs.load-config.outputs.container-type }} | |
| aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| tag-pr: ${{ needs.load-config.outputs.framework }}-${{ needs.load-config.outputs.framework-version }}-gpu-${{ needs.load-config.outputs.python-version }}-${{ needs.load-config.outputs.cuda-version }}-${{ needs.load-config.outputs.os-version }}-sagemaker-${{ github.run_id }} | |
| dockerfile-path: docker/${{ needs.load-config.outputs.framework }}/Dockerfile | |
| arch-type: ${{ needs.load-config.outputs.arch-type }} | |
| device-type: ${{ needs.load-config.outputs.device-type }} | |
| cuda-version: ${{ needs.load-config.outputs.cuda-version }} | |
| python-version: ${{ needs.load-config.outputs.python-version }} | |
| os-version: ${{ needs.load-config.outputs.os-version }} | |
| contributor: ${{ needs.load-config.outputs.contributor }} | |
| customer-type: ${{ needs.load-config.outputs.customer-type }} | |
| sanity-test: | |
| needs: [build-image, load-config] | |
| concurrency: | |
| group: ${{ github.workflow }}-sanity-test-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| uses: ./.github/workflows/reusable-sanity-tests.yml | |
| with: | |
| image-uri: ${{ needs.build-image.outputs.ci-image }} | |
| aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| framework: ${{ needs.load-config.outputs.framework }} | |
| framework-version: ${{ needs.load-config.outputs.framework-version }} | |
| python-version: ${{ needs.load-config.outputs.python-version }} | |
| cuda-version: ${{ needs.load-config.outputs.cuda-version }} | |
| os-version: ${{ needs.load-config.outputs.os-version }} | |
| customer-type: ${{ needs.load-config.outputs.customer-type }} | |
| arch-type: ${{ needs.load-config.outputs.arch-type }} | |
| device-type: ${{ needs.load-config.outputs.device-type }} | |
| contributor: ${{ needs.load-config.outputs.contributor }} | |
| container-type: ${{ needs.load-config.outputs.container-type }} | |
| upstream-tests: | |
| needs: [build-image, load-config] | |
| concurrency: | |
| group: ${{ github.workflow }}-upstream-tests-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| uses: ./.github/workflows/reusable-sglang-upstream-tests.yml | |
| with: | |
| image-uri: ${{ needs.build-image.outputs.ci-image }} | |
| aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| framework-version: ${{ needs.load-config.outputs.framework-version }} | |
| benchmark-start-command: >- | |
| docker run -d -it --rm --gpus=all | |
| -v ${HOME}/.cache/huggingface:/root/.cache/huggingface | |
| -v ${TEST_ARTIFACTS_DIRECTORY}/dataset:/dataset | |
| -p 30000:30000 | |
| -e SM_SGLANG_MODEL_PATH=Qwen/Qwen3-0.6B | |
| -e SM_SGLANG_REASONING_PARSER=qwen3 | |
| -e SM_SGLANG_HOST=127.0.0.1 | |
| -e SM_SGLANG_PORT=30000 | |
| -e HF_TOKEN=${HF_TOKEN} | |
| ${IMAGE} | |
| secrets: inherit | |
| endpoint-test: | |
| needs: [build-image] | |
| concurrency: | |
| group: ${{ github.workflow }}-endpoint-test-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: false | |
| uses: ./.github/workflows/reusable-sglang-sagemaker-tests.yml | |
| with: | |
| image-uri: ${{ needs.build-image.outputs.ci-image }} | |
| generate-release-spec: | |
| needs: [load-config, build-image, sanity-test, upstream-tests, endpoint-test] | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-generate-release-spec-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| outputs: | |
| release-spec: ${{ steps.generate.outputs.release-spec }} | |
| should-release: ${{ steps.check-release.outputs.should-release }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Check if release is enabled | |
| id: check-release | |
| run: | | |
| echo '${{ needs.load-config.outputs.config }}' > config.json | |
| RELEASE_ENABLED=$(jq -r '.release.release // false' config.json) | |
| echo "Release enabled: ${RELEASE_ENABLED}" | |
| echo "should-release=${RELEASE_ENABLED}" >> $GITHUB_OUTPUT | |
| - name: Generate release spec | |
| id: generate | |
| if: steps.check-release.outputs.should-release == 'true' | |
| uses: ./.github/actions/generate-release-spec | |
| with: | |
| config-json: ${{ needs.load-config.outputs.config }} | |
| release-image: | |
| needs: [load-config, build-image, generate-release-spec] | |
| if: needs.generate-release-spec.outputs.should-release == 'true' | |
| concurrency: | |
| group: ${{ github.workflow }}-release-image-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: false | |
| uses: ./.github/workflows/reusable-release-image.yml | |
| with: | |
| source-image-uri: ${{ needs.build-image.outputs.ci-image }} | |
| release-spec: ${{ needs.generate-release-spec.outputs.release-spec }} | |
| environment: ${{ github.event_name == 'pull_request' && 'gamma' || fromJson(needs.load-config.outputs.config).release.environment }} | |
| aws-region: ${{ vars.AWS_REGION }} | |
| runner-fleet: default-runner |