|
| 1 | +name: obs-hk-load-model-test |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + payload_mb: |
| 7 | + description: Snapshot size per writer in MB |
| 8 | + type: number |
| 9 | + default: 2048 |
| 10 | + writers: |
| 11 | + description: Concurrent multipart snapshot uploads |
| 12 | + type: number |
| 13 | + default: 8 |
| 14 | + readers: |
| 15 | + description: Concurrent snapshot downloads |
| 16 | + type: number |
| 17 | + default: 12 |
| 18 | + downloads_per_reader: |
| 19 | + description: Downloads per reader |
| 20 | + type: number |
| 21 | + default: 2 |
| 22 | + runner_pool: |
| 23 | + description: JSON array of {tag, region, image}, jobs spread round-robin |
| 24 | + type: string |
| 25 | + default: '[{"tag": "linux-amd64-cpu-test-16-hk", "region": "hk", "image": "quay.io/ascend-ci/vllm-ascend:lint"}, {"tag": "linux-amd64-cpu-test-24-hk", "region": "hk", "image": "quay.io/ascend-ci/vllm-ascend:lint"}, {"tag": "linux-aarch64-a3-test-2-cn12-001", "region": "cn12-via-liqo-gy005", "image": "swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:9.0.0-a3-ubuntu22.04-py3.12"}]' |
| 26 | + keep_payload: |
| 27 | + description: Keep test objects in the bucket after the run |
| 28 | + type: boolean |
| 29 | + default: false |
| 30 | + |
| 31 | +concurrency: |
| 32 | + group: obs-hk-load-model-test |
| 33 | + cancel-in-progress: false |
| 34 | + |
| 35 | +env: |
| 36 | + OBS_ENDPOINT: https://obs.ap-southeast-1.myhuaweicloud.com |
| 37 | + OBS_BUCKET: ascend-ci-cache-hk |
| 38 | + OBS_REGION: ap-southeast-1 |
| 39 | + |
| 40 | +jobs: |
| 41 | + setup: |
| 42 | + name: upload snapshot & plan load |
| 43 | + runs-on: linux-amd64-cpu-test-8-hk |
| 44 | + timeout-minutes: 30 |
| 45 | + env: |
| 46 | + HW_OBS_AK: ${{ secrets.HW_OBS_AK_HK }} |
| 47 | + HW_OBS_SK: ${{ secrets.HW_OBS_SK_HK }} |
| 48 | + outputs: |
| 49 | + prefix: ${{ steps.plan.outputs.prefix }} |
| 50 | + snapshot_key: ${{ steps.plan.outputs.snapshot_key }} |
| 51 | + sha256: ${{ steps.plan.outputs.sha256 }} |
| 52 | + setup_mbps: ${{ steps.plan.outputs.setup_mbps }} |
| 53 | + matrix_writers: ${{ steps.plan.outputs.matrix_writers }} |
| 54 | + matrix_readers: ${{ steps.plan.outputs.matrix_readers }} |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v4 |
| 57 | + |
| 58 | + - name: Upload snapshot and build matrices |
| 59 | + id: plan |
| 60 | + run: | |
| 61 | + python3 .github/workflows/scripts/obs_stability/setup_load.py \ |
| 62 | + --endpoint "$OBS_ENDPOINT" \ |
| 63 | + --bucket "$OBS_BUCKET" \ |
| 64 | + --region "$OBS_REGION" \ |
| 65 | + --prefix "load-model/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" \ |
| 66 | + --size-mb "${{ inputs.payload_mb }}" \ |
| 67 | + --writers "${{ inputs.writers }}" \ |
| 68 | + --readers "${{ inputs.readers }}" \ |
| 69 | + --runner-pool '${{ inputs.runner_pool }}' \ |
| 70 | + --output-file "$GITHUB_OUTPUT" |
| 71 | +
|
| 72 | + write: |
| 73 | + name: write-${{ matrix.writer_id }} (${{ matrix.region }}) |
| 74 | + needs: setup |
| 75 | + runs-on: ${{ matrix.runner }} |
| 76 | + timeout-minutes: 45 |
| 77 | + strategy: |
| 78 | + fail-fast: false |
| 79 | + matrix: |
| 80 | + include: ${{ fromJSON(needs.setup.outputs.matrix_writers) }} |
| 81 | + container: |
| 82 | + image: ${{ matrix.image }} |
| 83 | + env: |
| 84 | + HW_OBS_AK: ${{ secrets.HW_OBS_AK_HK }} |
| 85 | + HW_OBS_SK: ${{ secrets.HW_OBS_SK_HK }} |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Multipart snapshot upload |
| 90 | + run: | |
| 91 | + python3 .github/workflows/scripts/obs_stability/write.py \ |
| 92 | + --endpoint "$OBS_ENDPOINT" \ |
| 93 | + --bucket "$OBS_BUCKET" \ |
| 94 | + --region "$OBS_REGION" \ |
| 95 | + --key "${{ matrix.key }}" \ |
| 96 | + --size-mb "${{ inputs.payload_mb }}" \ |
| 97 | + --writer-id "${{ matrix.writer_id }}" \ |
| 98 | + --region-label "${{ matrix.region }}" \ |
| 99 | + --runner-tag "${{ matrix.runner }}" \ |
| 100 | + --out /tmp/obs-test/write.json |
| 101 | +
|
| 102 | + - uses: actions/upload-artifact@v4 |
| 103 | + if: always() |
| 104 | + with: |
| 105 | + name: write-${{ matrix.writer_id }} |
| 106 | + path: /tmp/obs-test/ |
| 107 | + |
| 108 | + read: |
| 109 | + name: read-${{ matrix.reader_id }} (${{ matrix.region }}) |
| 110 | + needs: setup |
| 111 | + runs-on: ${{ matrix.runner }} |
| 112 | + timeout-minutes: 45 |
| 113 | + strategy: |
| 114 | + fail-fast: false |
| 115 | + matrix: |
| 116 | + include: ${{ fromJSON(needs.setup.outputs.matrix_readers) }} |
| 117 | + container: |
| 118 | + image: ${{ matrix.image }} |
| 119 | + env: |
| 120 | + HW_OBS_AK: ${{ secrets.HW_OBS_AK_HK }} |
| 121 | + HW_OBS_SK: ${{ secrets.HW_OBS_SK_HK }} |
| 122 | + steps: |
| 123 | + - uses: actions/checkout@v4 |
| 124 | + |
| 125 | + - name: Download snapshot repeatedly |
| 126 | + run: | |
| 127 | + mkdir -p /tmp/obs-test |
| 128 | + python3 .github/workflows/scripts/obs_stability/read.py \ |
| 129 | + --endpoint "$OBS_ENDPOINT" \ |
| 130 | + --bucket "$OBS_BUCKET" \ |
| 131 | + --region "$OBS_REGION" \ |
| 132 | + --key "${{ needs.setup.outputs.snapshot_key }}" \ |
| 133 | + --sha256 "${{ needs.setup.outputs.sha256 }}" \ |
| 134 | + --downloads "${{ inputs.downloads_per_reader }}" \ |
| 135 | + --region-label "${{ matrix.region }}" \ |
| 136 | + --reader-id "${{ matrix.reader_id }}" \ |
| 137 | + --runner-tag "${{ matrix.runner }}" \ |
| 138 | + --out /tmp/obs-test/result.json |
| 139 | +
|
| 140 | + - uses: actions/upload-artifact@v4 |
| 141 | + if: always() |
| 142 | + with: |
| 143 | + name: result-${{ matrix.reader_id }} |
| 144 | + path: /tmp/obs-test/ |
| 145 | + |
| 146 | + report: |
| 147 | + name: aggregate report |
| 148 | + needs: [setup, write, read] |
| 149 | + if: always() && needs.setup.result == 'success' |
| 150 | + runs-on: linux-amd64-cpu-test-8-hk |
| 151 | + timeout-minutes: 10 |
| 152 | + steps: |
| 153 | + - uses: actions/checkout@v4 |
| 154 | + |
| 155 | + - uses: actions/download-artifact@v4 |
| 156 | + with: |
| 157 | + path: results |
| 158 | + merge-multiple: false |
| 159 | + |
| 160 | + - name: Summary |
| 161 | + run: | |
| 162 | + python3 .github/workflows/scripts/obs_stability/report.py results \ |
| 163 | + "${{ needs.setup.outputs.snapshot_key }}" \ |
| 164 | + "${{ needs.setup.outputs.setup_mbps }}" | tee /tmp/obs-report.md |
| 165 | + cat /tmp/obs-report.md >> "$GITHUB_STEP_SUMMARY" |
| 166 | +
|
| 167 | + cleanup: |
| 168 | + name: delete test objects |
| 169 | + needs: [setup, write, read] |
| 170 | + if: always() && !inputs.keep_payload && needs.setup.result == 'success' |
| 171 | + runs-on: linux-amd64-cpu-test-8-hk |
| 172 | + timeout-minutes: 10 |
| 173 | + env: |
| 174 | + OBS_AK: ${{ secrets.HW_OBS_AK_HK }} |
| 175 | + OBS_SK: ${{ secrets.HW_OBS_SK_HK }} |
| 176 | + steps: |
| 177 | + - uses: actions/checkout@v4 |
| 178 | + |
| 179 | + - name: Delete load-model prefix |
| 180 | + run: | |
| 181 | + python3 .github/workflows/scripts/obs_stability/s3obj.py delete-prefix \ |
| 182 | + --key "${{ needs.setup.outputs.prefix }}/" |
0 commit comments