-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * i * update * update ci * i * i * i * i
- Loading branch information
Showing
2 changed files
with
44 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,19 @@ orbs: | |
go: circleci/[email protected] | ||
codecov: codecov/[email protected] | ||
|
||
# Workflow Steps: | ||
# 1. Checkout | ||
# 2. Install GO | ||
# 3. Checkout ml-testing-accelerators | ||
# 4. GCP GKE install | ||
# 5. Update Kubeconfig with credintials | ||
# 6. Install jsonnet | ||
# 7. Update jsonnet | ||
# 8. Deploy the job on the kubernetes cluster | ||
# 9. Statistics | ||
# 10. Upload coverage results | ||
# 11. Upload coverage to Codecov | ||
|
||
references: | ||
|
||
make_docs: &make_docs | ||
|
@@ -33,25 +46,28 @@ references: | |
git checkout stable | ||
cd .. | ||
build_push_docker: &build_push_docker | ||
install_jsonnet: &install_jsonnet | ||
run: | ||
name: Install jsonnet | ||
command: | | ||
go get github.com/google/go-jsonnet/cmd/jsonnet | ||
update_jsonnet: &update_jsonnet | ||
run: | ||
name: Build and push Docker image | ||
environment: | ||
- PYTHON_VER: 3.7 | ||
name: Update jsonnet | ||
command: | | ||
gcloud --quiet auth configure-docker | ||
#cd dockers/tpu-tests | ||
docker build --tag "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" -f ./dockers/tpu-tests/Dockerfile --build-arg "PYTHON_VERSION=$PYTHON_VER" --build-arg "PYTORCH_VERSION=$XLA_VER" . | ||
docker push "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" | ||
export PR_NUMBER=$(git ls-remote origin "pull/*/head" | grep -F -f <(git rev-parse HEAD) | awk -F'/' '{print $3}') | ||
export SHA=$(git rev-parse --short HEAD) | ||
python -c "fname = 'dockers/tpu-tests/tpu_test_cases.jsonnet' ; data = open(fname).read().replace('{PYTORCH_VERSION}', '$XLA_VER') | ||
data = data.replace('{PYTHON_VERSION}', '$PYTHON_VER').replace('{PR_NUMBER}', '$PR_NUMBER').replace('{SHA}', '$SHA') ; open(fname, 'w').write(data)" | ||
cat dockers/tpu-tests/tpu_test_cases.jsonnet | ||
deploy_cluster: &deploy_cluster | ||
run: | ||
name: Deploy the job on the kubernetes cluster | ||
command: | | ||
go get github.com/google/go-jsonnet/cmd/jsonnet | ||
export PATH=$PATH:$HOME/go/bin | ||
python -c "fname = 'dockers/tpu-tests/tpu_test_cases.jsonnet' ; fff = open(fname).read().replace('pytorch-VERSION', 'pytorch-$XLA_VER') ; open(fname, 'w').write(fff)" | ||
job_name=$(jsonnet -J ml-testing-accelerators/ dockers/tpu-tests/tpu_test_cases.jsonnet --ext-str image=$GCR_IMAGE_PATH --ext-str image-tag=$CIRCLE_WORKFLOW_JOB_ID | kubectl create -f -) | ||
job_name=$(jsonnet -J ml-testing-accelerators/ dockers/tpu-tests/tpu_test_cases.jsonnet | kubectl create -f -) && \ | ||
job_name=${job_name#job.batch/} | ||
job_name=${job_name% created} | ||
echo "Waiting on kubernetes job: $job_name" | ||
|
@@ -72,7 +88,6 @@ references: | |
# First portion is the test logs. Print these to Github Action stdout. | ||
cat xx00 && \ | ||
echo "Done with log retrieval attempt." && \ | ||
gcloud container images delete "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" --force-delete-tags && \ | ||
exit $status_code | ||
stats: &stats | ||
|
@@ -92,6 +107,7 @@ jobs: | |
- image: circleci/python:3.7 | ||
environment: | ||
- XLA_VER: 1.8 | ||
- PYTHON_VER: 3.7 | ||
- MAX_CHECKS: 240 | ||
- CHECK_SPEEP: 5 | ||
steps: | ||
|
@@ -102,8 +118,8 @@ jobs: | |
- gcp-gke/update-kubeconfig-with-credentials: | ||
cluster: $GKE_CLUSTER | ||
perform-login: true | ||
- setup_remote_docker | ||
- *build_push_docker | ||
- *install_jsonnet | ||
- *update_jsonnet | ||
- *deploy_cluster | ||
- *stats | ||
- codecov/upload: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters