|
| 1 | +name: Auto Release - SGLang EC2 |
| 2 | + |
| 3 | +on: |
| 4 | + # schedule run must be on the default branch |
| 5 | + schedule: |
| 6 | + # Runs at 10:00 AM PST/PDT on Monday and Wednesday |
| 7 | + - cron: '00 17 * * 2,4' # Tuesday and Thursday at 10:00 AM PDT / 9:00 AM PST |
| 8 | + |
| 9 | + # # PR triggers for testing |
| 10 | + # pull_request: |
| 11 | + # paths: |
| 12 | + # - "**sglang**" |
| 13 | + # - "!docs/**" |
| 14 | + |
| 15 | + # Manual trigger |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + pull-requests: read |
| 21 | + |
| 22 | +env: |
| 23 | + # CI environment configuration |
| 24 | + FORCE_COLOR: "1" |
| 25 | + |
| 26 | + # Config file path |
| 27 | + CONFIG_FILE: ".github/config/sglang-ec2.yml" |
| 28 | + |
| 29 | +jobs: |
| 30 | + load-config: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + concurrency: |
| 33 | + group: ${{ github.workflow }}-load-config-${{ github.event.pull_request.number || github.run_id }} |
| 34 | + cancel-in-progress: true |
| 35 | + outputs: |
| 36 | + config: ${{ steps.load.outputs.config }} |
| 37 | + framework: ${{ steps.parse.outputs.framework }} |
| 38 | + framework-version: ${{ steps.parse.outputs.framework-version }} |
| 39 | + python-version: ${{ steps.parse.outputs.python-version }} |
| 40 | + cuda-version: ${{ steps.parse.outputs.cuda-version }} |
| 41 | + os-version: ${{ steps.parse.outputs.os-version }} |
| 42 | + container-type: ${{ steps.parse.outputs.container-type }} |
| 43 | + device-type: ${{ steps.parse.outputs.device-type }} |
| 44 | + arch-type: ${{ steps.parse.outputs.arch-type }} |
| 45 | + contributor: ${{ steps.parse.outputs.contributor }} |
| 46 | + customer-type: ${{ steps.parse.outputs.customer-type }} |
| 47 | + prod-image: ${{ steps.parse.outputs.prod-image }} |
| 48 | + steps: |
| 49 | + - name: Checkout code |
| 50 | + uses: actions/checkout@v5 |
| 51 | + |
| 52 | + - name: Load configuration |
| 53 | + id: load |
| 54 | + uses: ./.github/actions/load-config |
| 55 | + with: |
| 56 | + config-file: ${{ env.CONFIG_FILE }} |
| 57 | + |
| 58 | + - name: Parse configuration |
| 59 | + id: parse |
| 60 | + run: | |
| 61 | + echo '${{ steps.load.outputs.config }}' > config.json |
| 62 | + echo "framework=$(jq -r '.common.framework' config.json)" >> $GITHUB_OUTPUT |
| 63 | + echo "framework-version=$(jq -r '.common.framework_version' config.json)" >> $GITHUB_OUTPUT |
| 64 | + echo "python-version=$(jq -r '.common.python_version' config.json)" >> $GITHUB_OUTPUT |
| 65 | + echo "cuda-version=$(jq -r '.common.cuda_version' config.json)" >> $GITHUB_OUTPUT |
| 66 | + echo "os-version=$(jq -r '.common.os_version' config.json)" >> $GITHUB_OUTPUT |
| 67 | + echo "container-type=$(jq -r '.common.job_type' config.json)" >> $GITHUB_OUTPUT |
| 68 | + echo "device-type=$(jq -r '.common.device_type // "gpu"' config.json)" >> $GITHUB_OUTPUT |
| 69 | + echo "arch-type=$(jq -r '.common.arch_type // "x86"' config.json)" >> $GITHUB_OUTPUT |
| 70 | + echo "contributor=$(jq -r '.common.contributor // "None"' config.json)" >> $GITHUB_OUTPUT |
| 71 | + echo "customer-type=$(jq -r '.common.customer_type // ""' config.json)" >> $GITHUB_OUTPUT |
| 72 | + echo "prod-image=$(jq -r '.common.prod_image' config.json)" >> $GITHUB_OUTPUT |
| 73 | +
|
| 74 | + build-image: |
| 75 | + needs: [load-config] |
| 76 | + runs-on: |
| 77 | + - codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }} |
| 78 | + fleet:x86-build-runner |
| 79 | + buildspec-override:true |
| 80 | + concurrency: |
| 81 | + group: ${{ github.workflow }}-build-image-${{ github.event.pull_request.number || github.run_id }} |
| 82 | + cancel-in-progress: true |
| 83 | + outputs: |
| 84 | + ci-image: ${{ steps.build.outputs.image-uri }} |
| 85 | + steps: |
| 86 | + - name: Checkout code |
| 87 | + uses: actions/checkout@v5 |
| 88 | + |
| 89 | + - name: Build image |
| 90 | + id: build |
| 91 | + uses: ./.github/actions/build-image |
| 92 | + with: |
| 93 | + framework: ${{ needs.load-config.outputs.framework }} |
| 94 | + target: sglang-ec2 |
| 95 | + base-image: lmsysorg/sglang:v${{ needs.load-config.outputs.framework-version }}-${{ needs.load-config.outputs.cuda-version }}-amd64 |
| 96 | + framework-version: ${{ needs.load-config.outputs.framework-version }} |
| 97 | + container-type: ${{ needs.load-config.outputs.container-type }} |
| 98 | + aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }} |
| 99 | + aws-region: ${{ vars.AWS_REGION }} |
| 100 | + 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 }}-ec2-${{ github.run_id }} |
| 101 | + dockerfile-path: docker/${{ needs.load-config.outputs.framework }}/Dockerfile |
| 102 | + arch-type: ${{ needs.load-config.outputs.arch-type }} |
| 103 | + device-type: ${{ needs.load-config.outputs.device-type }} |
| 104 | + cuda-version: ${{ needs.load-config.outputs.cuda-version }} |
| 105 | + python-version: ${{ needs.load-config.outputs.python-version }} |
| 106 | + os-version: ${{ needs.load-config.outputs.os-version }} |
| 107 | + contributor: ${{ needs.load-config.outputs.contributor }} |
| 108 | + customer-type: ${{ needs.load-config.outputs.customer-type }} |
| 109 | + |
| 110 | + sanity-test: |
| 111 | + needs: [build-image, load-config] |
| 112 | + concurrency: |
| 113 | + group: ${{ github.workflow }}-sanity-test-${{ github.event.pull_request.number || github.run_id }} |
| 114 | + cancel-in-progress: true |
| 115 | + uses: ./.github/workflows/reusable-sanity-tests.yml |
| 116 | + with: |
| 117 | + image-uri: ${{ needs.build-image.outputs.ci-image }} |
| 118 | + aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }} |
| 119 | + aws-region: ${{ vars.AWS_REGION }} |
| 120 | + framework: ${{ needs.load-config.outputs.framework }} |
| 121 | + framework-version: ${{ needs.load-config.outputs.framework-version }} |
| 122 | + python-version: ${{ needs.load-config.outputs.python-version }} |
| 123 | + cuda-version: ${{ needs.load-config.outputs.cuda-version }} |
| 124 | + os-version: ${{ needs.load-config.outputs.os-version }} |
| 125 | + customer-type: ${{ needs.load-config.outputs.customer-type }} |
| 126 | + arch-type: ${{ needs.load-config.outputs.arch-type }} |
| 127 | + device-type: ${{ needs.load-config.outputs.device-type }} |
| 128 | + contributor: ${{ needs.load-config.outputs.contributor }} |
| 129 | + container-type: ${{ needs.load-config.outputs.container-type }} |
| 130 | + |
| 131 | + upstream-tests: |
| 132 | + needs: [build-image, load-config] |
| 133 | + concurrency: |
| 134 | + group: ${{ github.workflow }}-upstream-tests-${{ github.event.pull_request.number || github.run_id }} |
| 135 | + cancel-in-progress: true |
| 136 | + uses: ./.github/workflows/reusable-sglang-upstream-tests.yml |
| 137 | + with: |
| 138 | + image-uri: ${{ needs.build-image.outputs.ci-image }} |
| 139 | + aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }} |
| 140 | + aws-region: ${{ vars.AWS_REGION }} |
| 141 | + framework-version: ${{ needs.load-config.outputs.framework-version }} |
| 142 | + benchmark-start-command: >- |
| 143 | + docker run -d -it --rm --gpus=all |
| 144 | + -v ${HOME}/.cache/huggingface:/root/.cache/huggingface |
| 145 | + -v ${TEST_ARTIFACTS_DIRECTORY}/dataset:/dataset |
| 146 | + -p 30000:30000 |
| 147 | + -e HF_TOKEN=${HF_TOKEN} |
| 148 | + ${IMAGE} |
| 149 | + --model-path Qwen/Qwen3-0.6B |
| 150 | + --reasoning-parser qwen3 |
| 151 | + --host 127.0.0.1 |
| 152 | + --port 30000 |
| 153 | + secrets: inherit |
| 154 | + |
| 155 | + generate-release-spec: |
| 156 | + needs: [load-config, build-image, sanity-test, upstream-tests] |
| 157 | + runs-on: ubuntu-latest |
| 158 | + concurrency: |
| 159 | + group: ${{ github.workflow }}-generate-release-spec-${{ github.event.pull_request.number || github.run_id }} |
| 160 | + cancel-in-progress: true |
| 161 | + outputs: |
| 162 | + release-spec: ${{ steps.generate.outputs.release-spec }} |
| 163 | + should-release: ${{ steps.check-release.outputs.should-release }} |
| 164 | + steps: |
| 165 | + - name: Checkout code |
| 166 | + uses: actions/checkout@v5 |
| 167 | + |
| 168 | + - name: Check if release is enabled |
| 169 | + id: check-release |
| 170 | + run: | |
| 171 | + echo '${{ needs.load-config.outputs.config }}' > config.json |
| 172 | + RELEASE_ENABLED=$(jq -r '.release.release // false' config.json) |
| 173 | + echo "Release enabled: ${RELEASE_ENABLED}" |
| 174 | + echo "should-release=${RELEASE_ENABLED}" >> $GITHUB_OUTPUT |
| 175 | +
|
| 176 | + - name: Generate release spec |
| 177 | + id: generate |
| 178 | + if: steps.check-release.outputs.should-release == 'true' |
| 179 | + uses: ./.github/actions/generate-release-spec |
| 180 | + with: |
| 181 | + config-json: ${{ needs.load-config.outputs.config }} |
| 182 | + |
| 183 | + release-image: |
| 184 | + needs: [load-config, build-image, generate-release-spec] |
| 185 | + if: needs.generate-release-spec.outputs.should-release == 'true' |
| 186 | + concurrency: |
| 187 | + group: ${{ github.workflow }}-release-image-${{ github.event.pull_request.number || github.run_id }} |
| 188 | + cancel-in-progress: false |
| 189 | + uses: ./.github/workflows/reusable-release-image.yml |
| 190 | + with: |
| 191 | + source-image-uri: ${{ needs.build-image.outputs.ci-image }} |
| 192 | + release-spec: ${{ needs.generate-release-spec.outputs.release-spec }} |
| 193 | + environment: ${{ github.event_name == 'pull_request' && 'gamma' || fromJson(needs.load-config.outputs.config).release.environment }} |
| 194 | + aws-region: ${{ vars.AWS_REGION }} |
| 195 | + runner-fleet: default-runner |
0 commit comments