2020-07-23 16:13:10 +00:00
# Python CircleCI 2.1 configuration file.
version : 2.1
orbs :
2022-07-11 17:25:32 +00:00
gcp-gke : circleci/gcp-gke@1.4.0
go : circleci/go@1.7.1
2020-07-23 16:13:10 +00:00
codecov : codecov/codecov@1.1.0
2020-07-14 18:04:04 +00:00
2021-12-05 06:55:47 +00:00
trigger :
tags :
include :
- '*'
branches :
include :
- "master"
- "release/*"
- "refs/tags/*"
Add `lightning_app` docs (#13656)
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* update
* update
* update
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update latest docs
* remove image
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* ci
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* make
* Update .gitignore
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Update .github/workflows/docs-deploy.yml
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* update
* update
* update
* update
* Update docs/source-app/_templates/theme_variables.jinja
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/api_reference/api_references.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/api_reference/api_references.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/api_reference/api_references.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/code_samples/convert_pl_to_app/train.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/core_api/lightning_app/communication_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/model_server_app/model_server_app_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/get_started/training_with_apps.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/get_started/training_with_apps.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/get_started/training_with_apps.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/hpo/hpo.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/core_api/lightning_app/communication_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/core_api/lightning_app/communication_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/model_server_app/model_server.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* update
* Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/app.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source-app/examples/github_repo_runner/app.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* update
* update
* update
* update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
* update
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jirka <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
2021-12-05 06:55:47 +00:00
pr :
- "master"
- "release/*"
2021-07-19 14:13:21 +00:00
# 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
2020-07-14 18:04:04 +00:00
references :
2020-07-23 16:13:10 +00:00
make_docs : &make_docs
2020-07-14 18:04:04 +00:00
run :
2020-07-23 16:13:10 +00:00
name : Make Documentation
2020-07-14 18:04:04 +00:00
command : |
2021-12-21 17:06:15 +00:00
# the image uses python 2.7 by default, force a different version
2020-07-23 16:13:10 +00:00
pyenv global 3.7.3
python --version
2022-06-21 15:11:33 +00:00
pip install -e . -r requirements/pytorch/docs.txt
2021-01-26 09:44:54 +00:00
pip list
cd docs
make clean
make html --jobs 2 SPHINXOPTS="-W"
2020-07-14 18:04:04 +00:00
2020-07-23 16:13:10 +00:00
checkout_ml_testing : &checkout_ml_testing
2020-07-14 18:04:04 +00:00
run :
2020-07-23 16:13:10 +00:00
name : Checkout ml-testing-accelerators
2020-07-14 18:04:04 +00:00
command : |
2020-07-23 16:13:10 +00:00
git clone https://github.com/GoogleCloudPlatform/ml-testing-accelerators.git
cd ml-testing-accelerators
git fetch origin 5e88ac24f631c27045e62f0e8d5dfcf34e425e25:stable
git checkout stable
cd ..
2020-07-14 18:04:04 +00:00
2021-07-19 14:13:21 +00:00
install_jsonnet : &install_jsonnet
run :
name : Install jsonnet
command : |
2022-07-11 17:25:32 +00:00
go install github.com/google/go-jsonnet/cmd/jsonnet@latest
2021-07-19 14:13:21 +00:00
update_jsonnet : &update_jsonnet
2020-07-23 16:13:10 +00:00
run :
2021-07-19 14:13:21 +00:00
name : Update jsonnet
2020-07-23 16:13:10 +00:00
command : |
2021-07-19 14:13:21 +00:00
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
2020-07-23 16:13:10 +00:00
deploy_cluster : &deploy_cluster
2020-07-14 18:04:04 +00:00
run :
2020-07-23 16:13:10 +00:00
name : Deploy the job on the kubernetes cluster
2020-07-14 18:04:04 +00:00
command : |
2020-07-23 16:13:10 +00:00
export PATH=$PATH:$HOME/go/bin
2021-07-19 14:13:21 +00:00
job_name=$(jsonnet -J ml-testing-accelerators/ dockers/tpu-tests/tpu_test_cases.jsonnet | kubectl create -f -) && \
2020-07-23 16:13:10 +00:00
job_name=${job_name#job.batch/}
job_name=${job_name% created}
2022-07-27 15:40:40 +00:00
pod_name=$(kubectl get po -l controller-uid=`kubectl get job $job_name -o "jsonpath={.metadata.labels.controller-uid}"` | awk 'match($0,!/NAME/) {print $1}')
echo "GKE pod name: $pod_name"
2020-07-23 16:13:10 +00:00
echo "Waiting on kubernetes job: $job_name"
i=0 && \
# N checks spaced 30s apart = 900s total.
status_code=2 && \
# Check on the job periodically. Set the status code depending on what
# happened to the job in Kubernetes. If we try MAX_CHECKS times and
# still the job hasn't finished, give up and return the starting
# non-zero status code.
2020-07-27 23:07:09 +00:00
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 && \
2020-07-23 16:13:10 +00:00
echo "Done waiting. Job status code: $status_code" && \
2020-08-11 23:30:56 +00:00
kubectl logs -f $pod_name --container=train > /tmp/full_output.txt
2020-07-23 16:13:10 +00:00
if grep -q '<?xml version="1.0" ?>' /tmp/full_output.txt ; then csplit /tmp/full_output.txt '/<?xml version="1.0" ?>/'; else mv /tmp/full_output.txt xx00; fi && \
# First portion is the test logs. Print these to Github Action stdout.
cat xx00 && \
echo "Done with log retrieval attempt." && \
exit $status_code
stats : &stats
run :
name : Statistics
command : |
mv ./xx01 coverage.xml
2020-07-14 18:04:04 +00:00
jobs :
2020-07-23 16:13:10 +00:00
TPU-tests :
docker :
- image : circleci/python:3.7
environment :
2022-03-23 06:05:38 +00:00
- XLA_VER : 1.9
2021-07-19 14:13:21 +00:00
- PYTHON_VER : 3.7
2022-07-27 15:40:40 +00:00
- MAX_CHECKS : 1000
2020-07-27 23:07:09 +00:00
- CHECK_SPEEP : 5
2020-07-23 16:13:10 +00:00
steps :
- checkout
- go/install
- *checkout_ml_testing
- gcp-gke/install
- gcp-gke/update-kubeconfig-with-credentials :
cluster : $GKE_CLUSTER
perform-login : true
2021-07-19 14:13:21 +00:00
- *install_jsonnet
- *update_jsonnet
2020-07-23 16:13:10 +00:00
- *deploy_cluster
- *stats
- codecov/upload :
file : coverage.xml
flags : tpu,pytest
upload_name : TPU-coverage
- store_artifacts :
path : coverage.xml
build-Docs :
2020-07-14 18:04:04 +00:00
docker :
- image : readthedocs/build:latest
steps :
- checkout
2021-06-08 16:30:13 +00:00
- run :
command : |
git submodule update --init --recursive
name : Init git submodule
2020-07-14 18:04:04 +00:00
- *make_docs
- store_artifacts :
# allows us to preview the generated html pages
path : docs/build/html/
destination : html
workflows :
version : 2
2022-07-15 17:19:18 +00:00
#build-docs: # FixMe
# jobs:
# - build-Docs
2022-04-04 13:08:14 +00:00
test-on-tpus :
jobs :
2021-02-16 16:19:41 +00:00
- TPU-tests