From 46519e2fc770f3393c7f5e72e6f36a01a15efb27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Wed, 7 Sep 2022 15:55:45 +0200 Subject: [PATCH] Add path filters to the TPU job (#14543) --- .circleci/config.yml | 44 ++++++++++--------------------- .github/workflows/ci-circleci.yml | 28 ++++++++++++++++++++ 2 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/ci-circleci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c314d4e6e..57d318bc24 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,33 +4,16 @@ orbs: gcp-gke: circleci/gcp-gke@1.4.0 go: circleci/go@1.7.1 codecov: codecov/codecov@1.1.0 - -trigger: - tags: - include: - - '*' - branches: - include: - - "master" - - "release/*" - - "refs/tags/*" - -pr: - - "master" - - "release/*" - -# 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 +parameters: + GHA_Actor: + type: string + default: "" + GHA_Action: + type: string + default: "" + GHA_Event: + type: string + default: "" references: @@ -92,7 +75,7 @@ references: # still the job hasn't finished, give up and return the starting # non-zero status code. printf "Waiting for job to finish: " && \ - while [ $i -lt $MAX_CHECKS ]; do ((i++)); if kubectl get jobs $job_name -o jsonpath='Failed:{.status.failed}' | grep "Failed:1"; then status_code=1 && break; elif kubectl get jobs $job_name -o jsonpath='Succeeded:{.status.succeeded}' | grep "Succeeded:1" ; then status_code=0 && break; else printf "."; fi; sleep $CHECK_SPEEP; done && \ + while [ $i -lt $MAX_CHECKS ]; do ((i++)); if kubectl get jobs $job_name -o jsonpath='Failed:{.status.failed}' | grep "Failed:1"; then status_code=1 && break; elif kubectl get jobs $job_name -o jsonpath='Succeeded:{.status.succeeded}' | grep "Succeeded:1" ; then status_code=0 && break; else printf "."; fi; sleep $CHECK_SLEEP; done && \ echo "Done waiting. Job status code: $status_code" && \ kubectl logs -f $pod_name --container=train > /tmp/full_output.txt if grep -q '' /tmp/full_output.txt ; then csplit /tmp/full_output.txt '//'; else mv /tmp/full_output.txt xx00; fi && \ @@ -116,7 +99,7 @@ jobs: - XLA_VER: 1.12 - PYTHON_VER: 3.7 - MAX_CHECKS: 1000 - - CHECK_SPEEP: 5 + - CHECK_SLEEP: 5 steps: - checkout - go/install @@ -153,10 +136,11 @@ jobs: destination: html workflows: - version: 2 #build-docs: # FixMe + # when: << pipeline.parameters.GHA_Action >> # jobs: # - build-Docs test-on-tpus: + when: << pipeline.parameters.GHA_Action >> jobs: - TPU-tests diff --git a/.github/workflows/ci-circleci.yml b/.github/workflows/ci-circleci.yml new file mode 100644 index 0000000000..697fa444f3 --- /dev/null +++ b/.github/workflows/ci-circleci.yml @@ -0,0 +1,28 @@ +on: + push: + branches: [master, "release/*"] + paths: + - ".github/workflows/ci-circleci.yml" + - ".circleci/config.yml" + - "requirements/pytorch/**" + - "src/pytorch_lightning/**" + - "tests/tests_pytorch/**" + - "setup.cfg" # includes pytest config + pull_request: + branches: [master, "release/*"] + paths: + - ".github/workflows/ci-circleci.yml" + - ".circleci/config.yml" + - "requirements/pytorch/**" + - "src/pytorch_lightning/**" + - "tests/tests_pytorch/**" + - "setup.cfg" # includes pytest config + +jobs: + # https://github.com/marketplace/actions/trigger-circleci-pipeline + trigger-circleci: + runs-on: ubuntu-latest + steps: + - uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5 + env: + CCI_TOKEN: ${{ secrets.CCI_TOKEN }}