diff --git a/docker/cloudbuild.yaml b/docker/cloudbuild.yaml index 7d49ca4051bb..14bfc44c3ec8 100644 --- a/docker/cloudbuild.yaml +++ b/docker/cloudbuild.yaml @@ -1,6 +1,6 @@ # Cloud Build Configuration which: -# (1) Builds and pushes gcr.io/tpu-pytorch/xla image -# (2) Builds and stores torch and torch_xla wheels +# (1) Builds, tests, and pushes gcr.io/tpu-pytorch/xla image +# (2) Collects and stores torch and torch_xla wheels steps: - name: 'gcr.io/cloud-builders/docker' args: [ @@ -14,6 +14,9 @@ steps: - name: 'gcr.io/cloud-builders/docker' entrypoint: bash args: ['-c', 'docker tag gcr.io/tpu-pytorch/xla:nightly gcr.io/tpu-pytorch/xla:$(date -u +nightly_%Y%m%d)'] +- name: 'gcr.io/cloud-builders/docker' + entrypoint: 'bash' + args: ['-c', 'docker run gcr.io/tpu-pytorch/xla:nightly /bin/bash pytorch/xla/docker/run_deployment_tests.sh'] - name: 'gcr.io/cloud-builders/docker' args: ['push', 'gcr.io/tpu-pytorch/xla'] timeout: 1200s diff --git a/docker/run_deployment_tests.sh b/docker/run_deployment_tests.sh new file mode 100644 index 000000000000..f7f665298939 --- /dev/null +++ b/docker/run_deployment_tests.sh @@ -0,0 +1,7 @@ +#!/bin/bash +export XRT_DEVICE_MAP="CPU:0;/job:localservice/replica:0/task:0/device:XLA_CPU:0" +export XRT_WORKERS="localservice:0;grpc://localhost:40934" + +time python pytorch/xla/test/test_train_mnist.py +time bash pytorch/xla/test/run_tests.sh +time bash pytorch/xla/test/cpp/run_tests.sh