Skip to content

Commit cd0b3c6

Browse files
committed
Trigger unit tests for docker images upload
1 parent c32eb92 commit cd0b3c6

5 files changed

Lines changed: 272 additions & 145 deletions

File tree

.github/workflows/UploadDockerImages.yml

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

.github/workflows/build_and_test_maxtext.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
device_type: cpu
5757
device_name: X64
5858
cloud_runner: linux-x86-n2-16
59-
image_type: ${{ matrix.image_type }}
59+
image_name_and_tag: maxtext-unit-test-tpu:${{ matrix.image_type }}
6060
pytest_marker: 'cpu_only'
6161
xla_python_client_mem_fraction: 0.75
6262
tf_force_gpu_allow_growth: false
@@ -75,7 +75,7 @@ jobs:
7575
with:
7676
device_type: tpu
7777
device_name: v6e-4
78-
image_type: ${{ matrix.image_type }}
78+
image_name_and_tag: maxtext-unit-test-tpu:${{ matrix.image_type }}
7979
cloud_runner: linux-x86-ct6e-180-4tpu
8080
pytest_marker: 'not cpu_only and not gpu_only and not integration_test'
8181
xla_python_client_mem_fraction: 0.75
@@ -93,7 +93,7 @@ jobs:
9393
with:
9494
device_type: tpu
9595
device_name: v6e-4
96-
image_type: ${{ matrix.image_type }}
96+
image_name_and_tag: maxtext-unit-test-tpu:${{ matrix.image_type }}
9797
cloud_runner: linux-x86-ct6e-180-4tpu
9898
pytest_marker: 'not cpu_only and not gpu_only and integration_test'
9999
xla_python_client_mem_fraction: 0.75
@@ -111,7 +111,7 @@ jobs:
111111
with:
112112
device_type: tpu
113113
device_name: v6e-4
114-
image_type: ${{ matrix.image_type }}
114+
image_name_and_tag: maxtext-unit-test-tpu:${{ matrix.image_type }}
115115
cloud_runner: linux-x86-ct6e-180-4tpu
116116
pytest_marker: 'not cpu_only and not gpu_only and not integration_test'
117117
xla_python_client_mem_fraction: 0.75
@@ -129,7 +129,7 @@ jobs:
129129
with:
130130
device_type: tpu
131131
device_name: v6e-4
132-
image_type: ${{ matrix.image_type }}
132+
image_name_and_tag: maxtext-unit-test-tpu:${{ matrix.image_type }}
133133
cloud_runner: linux-x86-ct6e-180-4tpu
134134
pytest_marker: 'not cpu_only and not gpu_only and integration_test'
135135
xla_python_client_mem_fraction: 0.75
@@ -148,7 +148,7 @@ jobs:
148148
with:
149149
device_type: ${{ matrix.cuda }}
150150
device_name: a100-40gb-4
151-
image_type: ${{ matrix.image_type }}
151+
image_name_and_tag: maxtext-unit-test-${{ metrix.cuda }}:${{ matrix.image_type }}
152152
cloud_runner: linux-x86-a2-48-a100-4gpu
153153
pytest_marker: 'not cpu_only and not tpu_only and not integration_test'
154154
pytest_addopts: '--ignore=tests/sft_hooks_test.py'
@@ -168,7 +168,7 @@ jobs:
168168
with:
169169
device_type: ${{ matrix.cuda }}
170170
device_name: a100-40gb-4
171-
image_type: ${{ matrix.image_type }}
171+
image_name_and_tag: maxtext-unit-test-${{ metrix.cuda }}:${{ matrix.image_type }}
172172
cloud_runner: linux-x86-a2-48-a100-4gpu
173173
pytest_marker: 'not cpu_only and not tpu_only and integration_test'
174174
pytest_addopts: '--ignore=tests/sft_hooks_test.py'

.github/workflows/run_pathways_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
device_name:
2626
required: true
2727
type: string
28-
image_type:
29-
required: false
28+
image_name_and_tag:
29+
required: true
3030
type: string
3131
pytest_marker:
3232
required: true
@@ -58,7 +58,7 @@ jobs:
5858
run:
5959
runs-on: ${{ inputs.cloud_runner != '' && inputs.cloud_runner || fromJson(format('["self-hosted", "{0}", "{1}"]', inputs.device_type, inputs.device_name)) }}
6060
container:
61-
image: gcr.io/tpu-prod-env-multipod/maxtext-unit-test-tpu:${{ inputs.image_type != '' && inputs.image_type }}
61+
image: gcr.io/tpu-prod-env-multipod/${{ inputs.image_name_and_tag }}
6262
env:
6363
XLA_PYTHON_CLIENT_MEM_FRACTION: ${{ inputs.xla_python_client_mem_fraction }}
6464
TF_FORCE_GPU_ALLOW_GROWTH: ${{ inputs.tf_force_gpu_allow_growth }}

.github/workflows/run_tests_against_package.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
device_name:
2626
required: true
2727
type: string
28-
image_type:
29-
required: false
28+
image_name_and_tag:
29+
required: true
3030
type: string
3131
pytest_marker:
3232
required: true
@@ -58,14 +58,19 @@ on:
5858
required: false
5959
type: number
6060
default: 1
61+
# Flag to skip source checkout and wheel installation
62+
maxtext_installed:
63+
required: false
64+
type: boolean
65+
default: false
6166

6267
permissions:
6368
contents: read
6469
jobs:
6570
run:
6671
runs-on: ${{ inputs.cloud_runner != '' && inputs.cloud_runner || fromJson(format('["self-hosted", "{0}", "{1}"]', inputs.device_type, inputs.device_name)) }}
6772
container:
68-
image: gcr.io/tpu-prod-env-multipod/maxtext-unit-test-${{ inputs.device_type == 'cpu' && 'tpu' || inputs.device_type }}:${{ inputs.image_type != '' && inputs.image_type }}
73+
image: gcr.io/tpu-prod-env-multipod/${{ inputs.image_name_and_tag }}
6974
env:
7075
XLA_PYTHON_CLIENT_MEM_FRACTION: ${{ inputs.xla_python_client_mem_fraction }}
7176
TF_FORCE_GPU_ALLOW_GROWTH: ${{ inputs.tf_force_gpu_allow_growth }}
@@ -75,11 +80,14 @@ jobs:
7580
options: ${{ inputs.container_resource_option }}
7681
steps:
7782
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83+
if: ${{ !inputs.maxtext_installed }}
7884
- name: Download the maxtext wheel
85+
if: ${{ !inputs.maxtext_installed }}
7986
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
8087
with:
8188
name: maxtext-wheel
8289
- name: Install the maxtext wheel
90+
if: ${{ !inputs.maxtext_installed }}
8391
shell: bash
8492
run: |
8593
python3 -m uv venv --seed
@@ -91,10 +99,17 @@ jobs:
9199
python3 -m pip freeze
92100
uv pip install pytest-cov
93101
- name: Copy test assets files
102+
if: ${{ !inputs.maxtext_installed }}
94103
run : gcloud storage cp gs://maxtext-test-assets/* src/MaxText/test_assets
95104
- name: Run Tests
96105
shell: bash
97106
run: |
107+
if [ "${{ inputs.maxtext_installed }}" == "true" ]; then
108+
PYTHON_EXE="python3"
109+
else
110+
PYTHON_EXE=".venv/bin/python3"
111+
fi
112+
98113
if [ "${{ inputs.is_scheduled_run }}" == "true" ]; then
99114
FINAL_PYTEST_MARKER="${{ inputs.pytest_marker }}"
100115
else
@@ -110,13 +125,13 @@ jobs:
110125
export LIBTPU_INIT_ARGS='--xla_tpu_scoped_vmem_limit_kib=65536'
111126
fi
112127
if [ "${{ inputs.total_workers }}" -gt 1 ]; then
113-
.venv/bin/python3 -m pip install --quiet pytest-split pytest-xdist
128+
$PYTHON_EXE -m pip install --quiet pytest-split pytest-xdist
114129
SPLIT_ARGS="--splits ${{ inputs.total_workers }} --group ${{ inputs.worker_group }} -n auto"
115130
else
116131
SPLIT_ARGS=""
117132
fi
118133
# TODO: Fix the skipped tests and remove the deselect flags
119-
.venv/bin/python3 -m pytest ${{ inputs.pytest_addopts }} \
134+
$PYTHON_EXE -m pytest ${{ inputs.pytest_addopts }} \
120135
-v \
121136
-m "${FINAL_PYTEST_MARKER}" \
122137
--durations=0 \

0 commit comments

Comments
 (0)