Skip to content

Commit dd9268e

Browse files
committed
Move installation to Github runner step, simplify command.
1 parent d370d3c commit dd9268e

File tree

4 files changed

+37
-30
lines changed

4 files changed

+37
-30
lines changed

.github/workflows/RunTests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ jobs:
8282
with:
8383
device_type: tpu_pathways
8484
device_name: v4-8
85-
# pytest_marker: 'not gpu_only and not integration_test'
86-
# test_directory: 'tests'
85+
pytest_marker: 'not gpu_only and not integration_test'
86+
test_directory: 'tests'
8787
# xla_python_client_mem_fraction: 0.75
8888
# tf_force_gpu_allow_growth: false
8989
# container_resource_option: "--privileged"

.github/workflows/run_pathways_tests_internal.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,26 @@ on:
2525
device_name:
2626
required: true
2727
type: string
28+
pytest_marker:
29+
required: true
30+
type: string
31+
test_directory:
32+
required: true
33+
type: string
2834

2935
jobs:
3036
start_pathways:
3137
name: Start Pathways tests on (${{ inputs.device_name }})
3238
runs-on: ["self-hosted", "${{ inputs.device_type }}", "${{ inputs.device_name }}"]
3339
steps:
40+
- name: Install prerequisites on the self-hosted runner for Pathways.
41+
run: |
42+
echo "Setting up the prerequisites"
43+
apt-get install docker
44+
apt-get install docker-compose-plugin
45+
docker compose version # To ensure docker compose is installed
46+
gcloud auth configure-docker us-docker.pkg.dev --quiet
3447
- uses: actions/checkout@v4
3548
- name: Start Pathways and Maxtext containers using script
3649
run: |
37-
bash docker_run_pathways_containers.sh maxtext_image=gcr.io/tpu-prod-env-multipod/maxtext_${{ github.run_id }}:tpu
50+
bash docker_run_pathways_containers.sh maxtext_image=gcr.io/tpu-prod-env-multipod/maxtext_${{ github.run_id }}:tpu command="cd MaxText ; python3 -m pytest ${{ inputs.test_directory }} -m '${{ inputs.pytest_marker }}' -s"

docker_run_pathways_containers.sh

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,18 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# Example - # bash docker_run_pathways_containers.sh maxtext_image=<>
18-
19-
# bash docker_run_pathways_containers.sh maxtext_image=us-docker.pkg.dev/cloud-tpu-v2-images-dev/pathways/maxtext_jax_stable:latest
17+
# Example - bash docker_run_pathways_containers.sh maxtext_image=us-docker.pkg.dev/cloud-tpu-v2-images-dev/pathways/maxtext_jax_stable:latest command="cd MaxText ; python3 -m pytest tests -m 'not gpu_only and not integration_test' -s"
2018

2119
# Stop execution if any command exits with error
2220

2321

2422
echo "Running docker_run_pathways_containers.sh"
2523

26-
# Prerequisites on the self-hosted runner
27-
echo "Setting up the prerequisites"
28-
apt-get install docker
29-
apt-get install docker-compose-plugin
30-
docker compose version # To ensure docker compose is installed
31-
gcloud auth configure-docker us-docker.pkg.dev --quiet
32-
3324
set -e
34-
# Default -
35-
maxtext_image=us-docker.pkg.dev/cloud-tpu-v2-images-dev/pathways/maxtext_jax_stable:latest
3625

26+
# Defaults -
27+
maxtext_image=us-docker.pkg.dev/cloud-tpu-v2-images-dev/pathways/maxtext_jax_stable:latest
28+
command="cd MaxText ; python3 -m pytest tests -m 'not gpu_only and not integration_test' -s"
3729

3830
# Parse input variables
3931
for ARGUMENT in "$@"; do
@@ -43,15 +35,8 @@ for ARGUMENT in "$@"; do
4335
done
4436

4537
cd utils_pathways
46-
MAXTEXT_IMAGE=${maxtext_image} docker compose down
38+
MAXTEXT_IMAGE=${maxtext_image} COMMAND=${command} docker compose down
4739
sleep 10
48-
echo "MAXTEXT image ----------------"
49-
echo $MAXTEXT_IMAGE
50-
MAXTEXT_IMAGE=${maxtext_image} docker compose up --exit-code-from maxtext
40+
MAXTEXT_IMAGE=${maxtext_image} COMMAND=${command} docker compose up --exit-code-from maxtext
5141
sleep 10
52-
MAXTEXT_IMAGE=${maxtext_image} docker compose down
53-
# echo "Exit code from Maxtext..."
54-
# echo $?
55-
# sleep 20
56-
# docker compose ps
57-
# MAXTEXT_IMAGE=${maxtext_image} docker compose logs -f maxtext
42+
MAXTEXT_IMAGE=${maxtext_image} COMMAND=${command} docker compose down

utils_pathways/docker-compose.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114

2-
#### LOCAL NETWORK
315
services:
416

517
resource_manager:
@@ -53,7 +65,6 @@ services:
5365

5466
maxtext:
5567
image: ${MAXTEXT_IMAGE}
56-
# us-docker.pkg.dev/cloud-tpu-v2-images-dev/pathways/maxtext_jax_stable:latest
5768
privileged: true
5869
volumes:
5970
- ../:/deps
@@ -62,8 +73,6 @@ services:
6273
- JAX_BACKEND_TARGET=grpc://proxy:29008
6374
entrypoint: ["bash", "-c"]
6475
command:
65-
- cd MaxText ; python3 -m pytest tests -m "not gpu_only and not integration_test" -s
66-
# - "cd MaxText ; python3 -m pytest -m tpu_only tests -s"
67-
# - "cd MaxText ; python3 -m pytest -s tests/train_tests.py -m tpu_only"
76+
- ${COMMAND}
6877
depends_on:
6978
- proxy

0 commit comments

Comments
 (0)