Skip to content

Commit d81bebc

Browse files
committed
ci: scope initial platform image contracts
1 parent 857b11e commit d81bebc

15 files changed

Lines changed: 71 additions & 267 deletions

File tree

.github/configs/ascend.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ hardware_name: ascend
2020
display_name: "Ascend NPU Tests"
2121

2222
# Docker image for this hardware
23-
ci_image: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-inference
24-
ci_train_image: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-train
25-
ci_inference_image: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-inference
23+
ci_image: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-inference@sha256:e5b8e3b2c37584f980dffa1c08649b44e9edd2415522e123502e8d82a7854ef1
24+
ci_train_image: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-train@sha256:2b6ceb58a1dc345ba89b2f8eb22dcc73aeec2048aa8e141abfaaf80f8635b91c
25+
ci_inference_image: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-inference@sha256:e5b8e3b2c37584f980dffa1c08649b44e9edd2415522e123502e8d82a7854ef1
2626

2727
# Runner labels for this hardware
2828
runner_labels: ["flagscale-ascend-ascend910-gpu2-32c-128g"]

.github/configs/metax.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,4 @@ env_names:
6565
train: "base"
6666
hetero_train: ""
6767
inference: ""
68-
serve: ""
6968
rl: ""

.github/workflows/build_image_ascend.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,11 @@ on:
1616
required: true
1717
type: choice
1818
options: [train, inference]
19-
push:
20-
description: Push the candidate to shared Harbor
21-
required: true
22-
type: boolean
23-
default: true
2419
run_tests:
2520
description: Run the existing Ascend matrix with the candidate
2621
required: true
2722
type: boolean
2823
default: true
29-
tag:
30-
description: Optional tag override
31-
required: false
32-
type: string
3324

3425
permissions:
3526
contents: read
@@ -44,8 +35,8 @@ env:
4435
ASCEND_TE_REF: 94c7007c84107028919b4e52213d1bcb4ca3f7cf
4536
ASCEND_MEGATRON_REF: 409c1ed949675ddf9aa540aaae48652f446351cc
4637
ASCEND_VLLM_PLUGIN_REF: 43edeb601f4b8f616f56109de64836529e758deb
47-
MANUAL_TRAIN_IMAGE: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-train
48-
MANUAL_INFERENCE_IMAGE: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-inference
38+
MANUAL_TRAIN_IMAGE: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-train@sha256:2b6ceb58a1dc345ba89b2f8eb22dcc73aeec2048aa8e141abfaaf80f8635b91c
39+
MANUAL_INFERENCE_IMAGE: harbor.baai.ac.cn/flagos-dev/flagscale:manual-20260812-ascend-dev-inference@sha256:e5b8e3b2c37584f980dffa1c08649b44e9edd2415522e123502e8d82a7854ef1
4940

5041
jobs:
5142
prepare:
@@ -62,11 +53,8 @@ jobs:
6253
run: |
6354
set -euo pipefail
6455
short_sha="${GITHUB_SHA::7}"
65-
tag='${{ inputs.tag }}'
66-
if [ -z "$tag" ]; then
67-
tag="${short_sha}-ascend-dev"
68-
fi
69-
image="${REGISTRY}/${REGISTRY_NAMESPACE}/flagscale-${{ inputs.task }}:${tag}"
56+
tag="${short_sha}-ascend-${{ inputs.task }}-dev"
57+
image="${REGISTRY}/${REGISTRY_NAMESPACE}/flagscale:${tag}"
7058
train_image="$MANUAL_TRAIN_IMAGE"
7159
inference_image="$MANUAL_INFERENCE_IMAGE"
7260
if [ '${{ inputs.task }}' = train ]; then
@@ -93,7 +81,6 @@ jobs:
9381
persist-credentials: false
9482

9583
- name: Log in to shared Harbor
96-
if: inputs.push
9784
shell: bash
9885
run: echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" --username "$REGISTRY_USERNAME" --password-stdin
9986

@@ -145,7 +132,6 @@ jobs:
145132
'
146133
147134
- name: Push candidate
148-
if: inputs.push
149135
shell: bash
150136
run: docker push '${{ needs.prepare.outputs.image }}'
151137

@@ -157,6 +143,8 @@ jobs:
157143
echo
158144
echo "- Task: \`${{ inputs.task }}\`"
159145
echo "- Image: \`${{ needs.prepare.outputs.image }}\`"
146+
digest="$(docker image inspect '${{ needs.prepare.outputs.image }}' --format '{{range .RepoDigests}}{{println .}}{{end}}' | head -n 1)"
147+
echo "- Digest: \`$digest\`"
160148
echo "- TransformerEngine-FL: \`${ASCEND_TE_REF}\`"
161149
echo "- Megatron-LM-FL: \`${ASCEND_MEGATRON_REF}\`"
162150
echo "- vllm-plugin-FL: \`${ASCEND_VLLM_PLUGIN_REF}\`"
@@ -165,7 +153,7 @@ jobs:
165153
tests:
166154
name: Test Ascend candidate
167155
needs: [prepare, build]
168-
if: inputs.push && inputs.run_tests
156+
if: inputs.run_tests
169157
uses: ./.github/workflows/all_tests_common.yml
170158
secrets: inherit
171159
with:

.github/workflows/build_image_metax.yml

Lines changed: 33 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,8 @@ name: Build Docker Images - MetaX
66
on:
77
workflow_dispatch:
88
inputs:
9-
task:
10-
description: MetaX image to build
11-
required: true
12-
type: choice
13-
options: [train, inference, all]
14-
default: train
15-
push:
16-
description: Push candidate to shared Harbor
17-
required: true
18-
type: boolean
19-
default: true
209
run_tests:
21-
description: Run the current MetaX matrix after build
10+
description: Run the current MetaX train and benchmark matrix after build
2211
required: true
2312
type: boolean
2413
default: true
@@ -27,10 +16,6 @@ on:
2716
required: true
2817
type: boolean
2918
default: false
30-
tag:
31-
description: Optional tag override
32-
required: false
33-
type: string
3419
base_image:
3520
description: Validated MetaX base image (prefer an immutable digest)
3621
required: true
@@ -41,56 +26,37 @@ permissions:
4126
contents: read
4227

4328
concurrency:
44-
group: build-image-metax-${{ github.ref }}-${{ inputs.task }}
29+
group: build-image-metax-${{ github.ref }}
4530
cancel-in-progress: false
4631

4732
env:
4833
REGISTRY: harbor.baai.ac.cn
4934
REGISTRY_NAMESPACE: flagos-dev
5035
METAX_MEGATRON_REF: 409c1ed949675ddf9aa540aaae48652f446351cc
5136
METAX_TE_REF: 94c7007c84107028919b4e52213d1bcb4ca3f7cf
52-
CURRENT_TRAIN_IMAGE: harbor.baai.ac.cn/flagscale/megatron-lm-with-te:202603231839
53-
CURRENT_INFERENCE_IMAGE: harbor.baai.ac.cn/flagscale/megatron-lm-with-te:202603231839
5437

5538
jobs:
5639
prepare:
57-
name: Prepare MetaX candidate
40+
name: Prepare MetaX train candidate
5841
runs-on: ubuntu-latest
5942
outputs:
60-
matrix: ${{ steps.params.outputs.matrix }}
6143
candidate: ${{ steps.params.outputs.candidate }}
62-
train_image: ${{ steps.params.outputs.train_image }}
63-
inference_image: ${{ steps.params.outputs.inference_image }}
6444
steps:
6545
- name: Resolve build parameters
6646
id: params
6747
shell: bash
6848
run: |
6949
set -euo pipefail
7050
short_sha="${GITHUB_SHA::7}"
71-
tag='${{ inputs.tag }}'
72-
if [ -z "$tag" ]; then
73-
tag="${short_sha}-metax-dev"
74-
fi
75-
candidate="${REGISTRY}/${REGISTRY_NAMESPACE}/flagscale-${{ inputs.task }}:${tag}"
76-
train_image="$CURRENT_TRAIN_IMAGE"
77-
inference_image="$CURRENT_INFERENCE_IMAGE"
78-
case '${{ inputs.task }}' in
79-
train) train_image="$candidate" ;;
80-
inference) inference_image="$candidate" ;;
81-
all) train_image="$candidate"; inference_image="$candidate" ;;
82-
esac
83-
echo 'matrix={"task":["${{ inputs.task }}"]}' >> "$GITHUB_OUTPUT"
51+
candidate="${REGISTRY}/${REGISTRY_NAMESPACE}/flagscale:${short_sha}-metax-train-dev"
8452
echo "candidate=$candidate" >> "$GITHUB_OUTPUT"
85-
echo "train_image=$train_image" >> "$GITHUB_OUTPUT"
86-
echo "inference_image=$inference_image" >> "$GITHUB_OUTPUT"
8753
8854
runtime_contract:
8955
name: Validate MetaX base runtime
9056
needs: prepare
9157
runs-on: flagscale-metax-c550-gpu2-8c-256g
9258
steps:
93-
- name: Validate devices and collective
59+
- name: Validate eight devices and TP2 collective
9460
shell: bash
9561
run: |
9662
set -euo pipefail
@@ -126,36 +92,22 @@ jobs:
12692
torchrun --standalone --nnodes=1 --nproc-per-node=2 /tmp/metax_collective.py
12793
'
12894
129-
- name: Validate MetaX vLLM contract
130-
if: inputs.task == 'inference' || inputs.task == 'all'
131-
shell: bash
132-
run: |
133-
set -euo pipefail
134-
base_image='${{ inputs.base_image }}'
135-
docker run --rm \
136-
--ipc=host --group-add video \
137-
--device=/dev/dri --device=/dev/mxcd \
138-
--entrypoint python "$base_image" -c '
139-
import importlib.metadata as metadata
140-
import vllm
141-
print("vllm:", metadata.version("vllm"))
142-
print("module:", vllm.__file__)
143-
'
144-
14595
build:
146-
name: Build MetaX candidate
96+
name: Build and push MetaX train candidate
14797
needs: [prepare, runtime_contract]
14898
uses: ./.github/workflows/build_image_common.yml
14999
secrets: inherit
150100
with:
151101
platform: metax
152102
runs_on: '["flagscale-metax-c550-gpu2-8c-256g"]'
153-
matrix: ${{ needs.prepare.outputs.matrix }}
103+
matrix: '{"task":["train"]}'
154104
target: dev
155105
build_images: true
156106
no_cache: ${{ inputs.no_cache }}
157-
push: ${{ inputs.push }}
107+
push: true
158108
registry: harbor.baai.ac.cn
109+
# The common builder requires all three inputs; this train-only matrix
110+
# reads only train_image.
159111
train_image: ${{ needs.prepare.outputs.candidate }}
160112
inference_image: ${{ needs.prepare.outputs.candidate }}
161113
all_image: ${{ needs.prepare.outputs.candidate }}
@@ -166,12 +118,11 @@ jobs:
166118
FLAGSCALE_TE_REF=94c7007c84107028919b4e52213d1bcb4ca3f7cf
167119
168120
candidate_contract:
169-
name: Validate MetaX candidate runtime
121+
name: Validate MetaX train candidate
170122
needs: [prepare, build]
171123
runs-on: flagscale-metax-c550-gpu2-8c-256g
172124
steps:
173-
- name: Validate pinned training framework imports
174-
if: inputs.task == 'train' || inputs.task == 'all'
125+
- name: Validate pinned training stack on C550
175126
shell: bash
176127
run: |
177128
set -euo pipefail
@@ -183,36 +134,40 @@ jobs:
183134
--entrypoint python "$image" -c '
184135
import torch
185136
import transformer_engine
137+
from transformer_engine.pytorch import DotProductAttention, LayerNormLinear
138+
from megatron.core.extensions.transformer_engine import HAVE_TE
139+
from megatron.core.extensions.transformer_engine_spec_provider import TESpecProvider
186140
from megatron.core.models.gpt import GPTModel
187-
print("devices:", torch.cuda.device_count())
141+
142+
assert torch.cuda.device_count() == 8
143+
assert HAVE_TE
144+
assert TESpecProvider is not None
188145
print("transformer_engine:", transformer_engine.__file__)
146+
print("TE modules:", DotProductAttention, LayerNormLinear)
189147
print("megatron GPTModel:", GPTModel)
190148
'
191149
192-
- name: Validate MetaX vLLM import
193-
if: inputs.task == 'inference' || inputs.task == 'all'
150+
- name: Record Harbor digest
194151
shell: bash
195152
run: |
196153
set -euo pipefail
197154
image='${{ needs.prepare.outputs.candidate }}'
198-
docker pull "$image"
199-
docker run --rm \
200-
--ipc=host --group-add video \
201-
--device=/dev/dri --device=/dev/mxcd \
202-
--entrypoint python "$image" -c '
203-
import importlib.metadata as metadata
204-
import vllm
205-
print("vllm:", metadata.version("vllm"))
206-
print("module:", vllm.__file__)
207-
'
155+
digest="$(docker image inspect "$image" --format '{{range .RepoDigests}}{{println .}}{{end}}' | head -n 1)"
156+
{
157+
echo '### MetaX train candidate'
158+
echo
159+
echo "- Image: \`$image\`"
160+
echo "- Digest: \`$digest\`"
161+
echo "- Megatron-LM-FL: \`${METAX_MEGATRON_REF}\`"
162+
echo "- TransformerEngine-FL: \`${METAX_TE_REF}\`"
163+
} >> "$GITHUB_STEP_SUMMARY"
208164
209165
tests:
210-
name: Test MetaX candidate
166+
name: Test MetaX train candidate
211167
needs: [prepare, build, candidate_contract]
212-
if: inputs.push && inputs.run_tests
168+
if: inputs.run_tests
213169
uses: ./.github/workflows/all_tests_common.yml
214170
secrets: inherit
215171
with:
216172
platform: metax
217-
ci_train_image: ${{ needs.prepare.outputs.train_image }}
218-
ci_inference_image: ${{ needs.prepare.outputs.inference_image }}
173+
ci_train_image: ${{ needs.prepare.outputs.candidate }}

docker/ascend/Dockerfile.train

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
6060
/workspace/tools/install/utils/*.sh \
6161
/workspace/tools/install/ascend/*.sh && \
6262
./tools/install/install.sh --platform ascend --task train \
63-
--pkg-mgr ${PKG_MGR} --no-system --force-build && \
63+
--pkg-mgr ${PKG_MGR} --no-system --no-base --force-build && \
6464
rm -rf /workspace/*
6565

6666
FROM deps AS dev
@@ -93,7 +93,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
9393
/workspace/tools/install/utils/*.sh \
9494
/workspace/tools/install/ascend/*.sh && \
9595
./tools/install/install.sh --platform ascend --task train \
96-
--pkg-mgr ${PKG_MGR} --no-system --no-dev --force-build && \
96+
--pkg-mgr ${PKG_MGR} --no-system --no-dev --no-base --force-build && \
9797
rm -rf /workspace/*
9898

9999
CMD ["/bin/bash"]

docker/metax/Dockerfile.all

Lines changed: 0 additions & 30 deletions
This file was deleted.

docker/metax/Dockerfile.inference

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)