Skip to content

Commit 0ed03b5

Browse files
author
Vincent Li
committed
updates
1 parent 046d1f6 commit 0ed03b5

4 files changed

Lines changed: 62 additions & 85 deletions

File tree

.ci

.github/workflows/ci_child.yml.1 renamed to .github/workflows/ci_child_for_smoketest.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,38 +57,44 @@ jobs:
5757
f.write("\n```\n\n")
5858
PY
5959
60-
- name: Trigger ${{ matrix.platform }} GPU Smoke Test job
60+
- name: Trigger ${{ matrix.platform }} GPU Smoke Test task
6161
env: ${{ matrix.job_env }}
6262
run: |
63+
set -e
6364
echo "Smoke Test Starting..."
6465
echo "MODEL_LIST = ${{ matrix.job_env.MODEL_LIST }}"
6566
echo "Version = ${{ matrix.job_env.IMAGE }}"
6667
set -m
68+
6769
cd /home/zkjh
68-
if [ ! -d "${{ matrix.platform }}_test" ]; then
69-
mkdir -p "${{ matrix.platform }}_test"
70+
if [ ! -d "CI_${{ matrix.platform }}_test" ]; then
71+
mkdir -p "CI_${{ matrix.platform }}_test"
7072
fi
71-
cd ${{ matrix.platform }}_test
72-
mkdir -p ${{ matrix.platform }}_${{ github.run_id }}_${{ matrix.id }}
73-
cd ${{ matrix.platform }}_${{ github.run_id }}_${{ matrix.id }}
73+
cd CI_${{ matrix.platform }}_test
74+
mkdir -p ${{ github.run_id }}_${{ matrix.id }}
75+
cd ${{ github.run_id }}_${{ matrix.id }}
76+
7477
git init
7578
git remote add origin git@github.com:Vincent777/ci_autotest.git
7679
git fetch --depth=1 origin main
7780
git show origin/main:ascend_test_suite/daemon.sh > daemon.sh
7881
chmod a+x daemon.sh
82+
7983
DOCKER_ARGS="${{ join(matrix.docker_args, ' ') }}"
8084
VOLUME_ARGS=$(printf " -v %s" ${{ join(matrix.volumes, ' ') }})
8185
SHM_SIZE="--shm-size=${{ matrix.shm_size }}"
82-
echo "DOCKER_ARGS=$DOCKER_ARGS"
83-
echo "VOLUME_ARGS=$VOLUME_ARGS"
84-
echo "SHM_SIZE=$SHM_SIZE"
8586
PLATFORM=${{ matrix.platform }}
86-
./daemon.sh \
87-
"${PLATFORM^}" \
88-
Smoke \
89-
${{ matrix.job_env.ENGINE }} \
90-
"${{ matrix.job_env.MODEL_LIST }}:${{ matrix.ngpus }}" \
91-
"${DOCKER_ARGS} ${VOLUME_ARGS} ${SHM_SIZE}" \
92-
${{ github.run_id }} \
93-
${{ matrix.job_env.IMAGE }}
94-
87+
88+
# echo "DOCKER_ARGS=$DOCKER_ARGS"
89+
# echo "VOLUME_ARGS=$VOLUME_ARGS"
90+
# echo "SHM_SIZE=$SHM_SIZE"
91+
92+
echo "************************************************************************"
93+
echo "PLATFORM=${PLATFORM^}"
94+
echo "Smoke"
95+
echo "${{ matrix.job_env.ENGINE }}"
96+
echo "${{ matrix.job_env.MODEL_LIST }}:${{ matrix.ngpus }}"
97+
echo "${DOCKER_ARGS} ${VOLUME_ARGS} ${SHM_SIZE}"
98+
echo "${{ github.run_id }}"
99+
echo "${{ matrix.job_env.IMAGE }}"
100+
echo "************************************************************************"

.github/workflows/ci_child.yml renamed to .github/workflows/ci_child_for_unittest.yml

Lines changed: 9 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ jobs:
7979
RESULT_DIR: None
8080
TEST: None
8181
LOCAL: None
82-
DRY_RUN: None
8382
run: |
8483
PYTHONPATH=.ci python3 - <<'PY'
8584
import os
@@ -96,12 +95,10 @@ jobs:
9695
)
9796
from utils import get_git_commit, load_config
9897
99-
10098
def env_opt(key):
10199
v = os.environ.get(key, "")
102100
return None if not v or v == "None" else v
103101
104-
105102
config = load_config(Path(os.environ["CONFIG"]))
106103
repo = config.get("repo", {})
107104
repo_url = repo.get("url", "https://github.com/InfiniTensor/InfiniOps.git")
@@ -172,11 +169,6 @@ jobs:
172169
local_path=local_path,
173170
)
174171
175-
dry = os.environ.get("DRY_RUN", "")
176-
if dry and dry != "None":
177-
print(shlex.join(docker_args))
178-
raise SystemExit(0)
179-
180172
github_env = os.environ.get("GITHUB_ENV")
181173
if not github_env:
182174
print("error: GITHUB_ENV is not set", file=sys.stderr)
@@ -201,7 +193,7 @@ jobs:
201193
f.write(f"IMAGE_TAG={image_ref}\n")
202194
PY
203195
204-
- name: Trigger ${{ matrix.platform }} XPU Smoke Test job
196+
- name: Trigger ${{ matrix.platform }} XPU Unit Test Task
205197
env:
206198
${{ matrix.job_env }}
207199
run: |
@@ -212,63 +204,26 @@ jobs:
212204
mkdir -p "${RESULT_DIR}"
213205
fi
214206
215-
if [ -n "${ENGINE:-}" ] && [ "${ENGINE}" != "None" ]; then
216-
ENGINE_ARGS="${ENGINE}"
217-
else
218-
ENGINE_ARGS="InfiniTensor"
219-
fi
220-
221-
if [ -n "${MODEL_LIST:-}" ] && [ "${MODEL_LIST}" != "None" ]; then
222-
MODEL_LIST_ARGS="${MODEL_LIST}"
223-
else
224-
MODEL_LIST_ARGS="None"
225-
fi
226-
227-
if [ -n "${IMAGE:-}" ] && [ "${IMAGE}" != "None" ]; then
228-
IMAGE_TAG_ARGS="${IMAGE}"
229-
else
230-
IMAGE_TAG_ARGS="${IMAGE_TAG}"
231-
fi
232-
233207
set -m
234208
cd /home/zkjh
235-
if [ ! -d "${{ matrix.platform }}_test" ]; then
236-
mkdir -p "${{ matrix.platform }}_test"
209+
if [ ! -d "CI_${{ matrix.platform }}_test" ]; then
210+
mkdir -p "CI_${{ matrix.platform }}_test"
237211
fi
238-
cd ${{ matrix.platform }}_test
239-
mkdir -p ${{ matrix.platform }}_${{ github.run_id }}_${{ matrix.id }}
240-
cd ${{ matrix.platform }}_${{ github.run_id }}_${{ matrix.id }}
212+
cd CI_${{ matrix.platform }}_test
213+
mkdir -p ${{ github.run_id }}_${{ matrix.id }}
214+
cd ${{ github.run_id }}_${{ matrix.id }}
241215
242216
git init
243217
git remote add origin git@github.com:Vincent777/ci_autotest.git
244218
git fetch --depth=1 origin main
245219
git show origin/main:ascend_test_suite/daemon.sh > daemon.sh
246220
chmod a+x daemon.sh
247221
248-
DOCKER_ARGS_MATRIX="${{ join(matrix.docker_args, ' ') }}"
249-
if [ -z "${DOCKER_ARGS:-}" ]; then
250-
DOCKER_ARGS="${DOCKER_ARGS_MATRIX}"
251-
fi
252-
253-
VOLUME_ARGS=""
254-
if [ -n "${{ join(matrix.volumes, ' ') }}" ]; then
255-
VOLUME_ARGS=$(printf ' -v %s' ${{ join(matrix.volumes, ' ') }})
256-
fi
257-
258-
SHM_SIZE="--shm-size=${{ matrix.shm_size }}"
259-
260-
echo "DOCKER_ARGS=$DOCKER_ARGS"
261-
echo "VOLUME_ARGS=$VOLUME_ARGS"
262-
echo "SHM_SIZE=$SHM_SIZE"
263-
264-
PLATFORM=${{ matrix.platform }}
265-
266222
echo "**************************************************************************************"
267-
echo "${PLATFORM}"
268-
echo "${ENGINE_ARGS}"
269-
echo "${MODEL_LIST_ARGS}"
223+
echo "Unit"
224+
echo "InfiniTensor"
270225
echo "${DOCKER_ARGS}"
271226
echo "${{ github.run_id }}"
272-
echo "${IMAGE_TAG_ARGS}"
227+
echo "${IMAGE_TAG}"
273228
echo "**************************************************************************************"
274229

.github/workflows/ci_test.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ on:
66
pull_request:
77
branches: ["ci_test"]
88
workflow_dispatch:
9+
inputs:
10+
run_smoketest:
11+
description: "Run smoketest child pipeline (self-hosted)"
12+
type: boolean
13+
default: false
914

1015
jobs:
1116
prepare:
1217
name: Generate matrix from config
1318
runs-on: ubuntu-latest
1419
outputs:
15-
matrix_json: ${{ steps.generate.outputs.matrix_json }}
20+
matrix_json_for_unittest: ${{ steps.generate.outputs.matrix_json_for_unittest }}
21+
matrix_json_for_smoketest: ${{ steps.generate.outputs.matrix_json_for_smoketest }}
22+
job_types_with_jobs: ${{ steps.generate.outputs.job_types_with_jobs }}
1623
steps:
1724
- name: Checkout
1825
uses: actions/checkout@v4
@@ -27,20 +34,29 @@ jobs:
2734
- name: Install converter dependency
2835
run: pip install pyyaml
2936

30-
- name: Convert .ci/config.yaml to matrix JSON
37+
- name: Convert .ci/config.yaml to matrix JSON (by job type)
3138
id: generate
39+
run: python .ci/scripts/config_to_matrix.py --config .ci/config.yaml --write-github-outputs
40+
41+
- name: Show generated job types
3242
run: |
33-
matrix_json="$(python .ci/scripts/config_to_matrix.py --config .ci/config.yaml)"
34-
echo "matrix_json<<EOF" >> "$GITHUB_OUTPUT"
35-
echo "$matrix_json" >> "$GITHUB_OUTPUT"
36-
echo "EOF" >> "$GITHUB_OUTPUT"
43+
echo "job_types_with_jobs=${{ steps.generate.outputs.job_types_with_jobs }}"
3744
38-
- name: Show generated matrix
39-
run: echo '${{ steps.generate.outputs.matrix_json }}'
45+
run-child-unittest:
46+
name: Execute unittest child pipeline
47+
needs: prepare
48+
if: contains(fromJSON(needs.prepare.outputs.job_types_with_jobs), 'unittest')
49+
uses: ./.github/workflows/ci_child_for_unittest.yml
50+
with:
51+
matrix_json: ${{ needs.prepare.outputs.matrix_json_for_unittest }}
4052

41-
run-child:
42-
name: Execute child pipeline
53+
run-child-smoketest:
54+
name: Execute smoketest child pipeline (manual)
4355
needs: prepare
44-
uses: ./.github/workflows/ci_child.yml
56+
if: |
57+
github.event_name == 'workflow_dispatch' &&
58+
inputs.run_smoketest &&
59+
contains(fromJSON(needs.prepare.outputs.job_types_with_jobs), 'smoketest')
60+
uses: ./.github/workflows/ci_child_for_smoketest.yml
4561
with:
46-
matrix_json: ${{ needs.prepare.outputs.matrix_json }}
62+
matrix_json: ${{ needs.prepare.outputs.matrix_json_for_smoketest }}

0 commit comments

Comments
 (0)