pytorch/.github/workflows
Jane Xu 6385621003 Use JOB_BASE_NAME throughout code--consolidate CIRCLE_JOB (#60425)
Summary:
This PR is a first step in unifying our environment variables across CI (so that we don't have `CIRCLE_BLAH` in our GHA workflows, for example), though I'd like for this PR to be more for discussion about how best to consolidate these variables.

This small change only changes most CIRCLE_JOB references in our code to be JOB_BASE_NAME, as that seems the closest GHA (and ROCm) equivalent. Currently, JOB_BASE_NAME is defined as:
- in Circle: CIRCLE_JOB (name of the job, like `pytorch_linux_bionic_py3_8_gcc9_coverage_test1`)
- in GHA: the build_environment with a `-build` or `-test` tacked to the end , e.g., `pytorch-linux-xenial-cuda10.2-cudnn7-py3.6-gcc7-test`
- in ROCm: I don't actually know, but it's important for ROCm test sharding as shown in https://github.com/pytorch/pytorch/pull/60409

I am not sure if this is the intention for JOB_BASE_NAME so it is open to discussion what variable we should use if not JOB_BASE_NAME. I also don't know if it's worth the effort consolidating all these variables, so discussion is also highly encouraged there!

Next steps:
- Consolidate more CIRCLE_* references, maybe into CI_* equivalents?
- We use BUILD_ENVIRONMENT everywhere in Circle though the variable is inconsistent across binary vs CI jobs and across platforms. For example, for linux tests and builds, BUILD_ENVIRONMENT contains the `_test` and `_build` suffixes, but the windows jobs don't. In GHA, BUILD_ENVIRONMENT is similar to how it's defined in windows jobs on Circle. This inconsistency is confusing, and we can probably do something about it. I'm thinking of switching out BUILD_ENVIRONMENT for JOB_BASE_NAME in our test scripts where we actually mean JOB_BASE_NAME.
- We should probably document the meaning of the variables we consolidate somewhere, preferably in a README in some unified `ci/` folder. For example, it seems BUILD_ENVIRONMENT is supposed to capture the build environment, whereas JOB_BASE_NAME is supposed to capture the environment _and_ whether we're building or testing.

Notes:
- I did not replace CIRCLE_JOB references in third_party directories
- Previously, print_test_stats reported CIRCLE_JOB as only the build environment for GHA workflows, and I think tacking on the `build` or `test` will not harm anything, though I may be wrong.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/60425

Reviewed By: seemethere, samestep

Differential Revision: D29333882

Pulled By: janeyx99

fbshipit-source-id: a82080e6205a03a1183035011ce59698eca06748
2021-06-23 11:11:21 -07:00
..
add_annotations.yml Put env before run or with in GHA workflows (#56268) 2021-04-16 11:06:39 -07:00
auto_label.yml Upgrade ShellCheck to v0.7.2 (#56445) 2021-04-20 07:58:22 -07:00
build_linux_conda.yml fix workflow id usage in GHA (#60376) 2021-06-21 14:54:49 -07:00
build_linux_libtorch.yml fix workflow id usage in GHA (#60376) 2021-06-21 14:54:49 -07:00
build_linux_wheels.yml fix workflow id usage in GHA (#60376) 2021-06-21 14:54:49 -07:00
clang_format.yml Add script to cancel workflows (#59019) 2021-05-27 12:32:15 -07:00
jit_triage.yml replacing ubuntu-latest with ubuntu-18.04 (#51744) 2021-02-04 14:17:06 -08:00
lint.yml Fix lint (#60472) 2021-06-22 14:48:07 -07:00
push_nightly_docker_ghcr.yml Use self-hosted runner for nightly docker build CI. (#52148) 2021-02-11 13:14:01 -08:00
pytorch-linux-xenial-cuda10.2-cudnn7-py3.6-gcc7.yml Use JOB_BASE_NAME throughout code--consolidate CIRCLE_JOB (#60425) 2021-06-23 11:11:21 -07:00
pytorch-linux-xenial-cuda11.1-cudnn8-py3.6-gcc7.yml Use JOB_BASE_NAME throughout code--consolidate CIRCLE_JOB (#60425) 2021-06-23 11:11:21 -07:00
pytorch-linux-xenial-py3.6-gcc5.4.yml Use JOB_BASE_NAME throughout code--consolidate CIRCLE_JOB (#60425) 2021-06-23 11:11:21 -07:00
pytorch-win-vs2019-cpu-py3.yml Use JOB_BASE_NAME throughout code--consolidate CIRCLE_JOB (#60425) 2021-06-23 11:11:21 -07:00
pytorch-win-vs2019-cuda10-cudnn7-py3.yml Use JOB_BASE_NAME throughout code--consolidate CIRCLE_JOB (#60425) 2021-06-23 11:11:21 -07:00
pytorch-win-vs2019-cuda11-cudnn8-py3.yml Use JOB_BASE_NAME throughout code--consolidate CIRCLE_JOB (#60425) 2021-06-23 11:11:21 -07:00
quantization_triage.yml replacing ubuntu-latest with ubuntu-18.04 (#51744) 2021-02-04 14:17:06 -08:00
run_torchbench.yml Add script to cancel workflows (#59019) 2021-05-27 12:32:15 -07:00
stale_pull_requests.yml replacing ubuntu-latest with ubuntu-18.04 (#51744) 2021-02-04 14:17:06 -08:00
test_tools.yml Add script to cancel workflows (#59019) 2021-05-27 12:32:15 -07:00
update_s3_htmls.yml replacing ubuntu-latest with ubuntu-18.04 (#51744) 2021-02-04 14:17:06 -08:00