Skip to content

Commit c857fa1

Browse files
author
Svetlana Karslioglu
authored
Merge branch 'main' into arrow-key
2 parents afbca41 + 095133a commit c857fa1

File tree

11 files changed

+745
-328
lines changed

11 files changed

+745
-328
lines changed

.circleci/config.yml

Lines changed: 126 additions & 76 deletions
Large diffs are not rendered by default.

.circleci/config.yml.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pytorch_tutorial_build_defaults: &pytorch_tutorial_build_defaults
118118
echo "declare -x COMMIT_SOURCE=${CIRCLE_BRANCH}" >> /home/circleci/project/env
119119
# DANGER! DO NOT REMOVE THE `set +x` SETTING HERE!
120120
set +x
121-
if [[ "$CIRCLE_BRANCH" == master ]]; then
121+
if [[ "$CIRCLE_BRANCH" == master || "$CIRCLE_BRANCH" == main ]]; then
122122
if [ -z "${CIRCLECI_AWS_ACCESS_KEY_FOR_PYTORCH_TUTORIAL_BUILD_MASTER_S3_BUCKET}" ]; then exit 1; fi
123123
if [ -z "${CIRCLECI_AWS_SECRET_KEY_FOR_PYTORCH_TUTORIAL_BUILD_MASTER_S3_BUCKET}" ]; then exit 1; fi
124124
if [ -z "${GITHUB_PYTORCHBOT_USERNAME}" ]; then exit 1; fi
@@ -185,7 +185,7 @@ pytorch_windows_build_worker: &pytorch_windows_build_worker
185185
jobs:
186186
{{ jobs("pr") }}
187187

188-
{{ jobs("master") }}
188+
{{ jobs("trunk") }}
189189

190190
{{ windows_jobs() }}
191191

@@ -194,6 +194,6 @@ workflows:
194194
jobs:
195195
# Build jobs that only run on PR
196196
{{ workflows_jobs("pr") }}
197-
# Build jobs that only run on master
198-
{{ workflows_jobs("master") }}
197+
# Build jobs that only run on trunk
198+
{{ workflows_jobs("trunk") }}
199199
# {{ windows_workflows_jobs() }}

.circleci/regenerate.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
import yaml
1010
from jinja2 import select_autoescape
1111

12-
WORKFLOWS_JOBS_PR = {"filters": {"branches": {"ignore": ["master"]}}}
12+
WORKFLOWS_JOBS_PR = {"filters": {"branches": {"ignore": ["master", "main"]}}}
1313

14-
WORKFLOWS_JOBS_MASTER = {
14+
WORKFLOWS_JOBS_TRUNK = {
1515
"context": "org-member",
16-
"filters": {"branches": {"only": ["master"]}},
16+
"filters": {"branches": {"only": ["master", "main"]}},
1717
}
1818

1919

@@ -23,39 +23,39 @@ def indent(indentation, data_list):
2323
)
2424

2525

26-
def jobs(pr_or_master, num_workers=20, indentation=2):
26+
def jobs(pr_or_trunk, num_workers=20, indentation=2):
2727
jobs = {}
2828

2929
# all tutorials that need gpu.nvidia.small.multi machines will be routed
3030
# by get_files_to_run.py to 0th worker
3131
needs_gpu_nvidia_small_multi = [0]
32-
jobs[f"pytorch_tutorial_{pr_or_master}_build_manager"] = {
32+
jobs[f"pytorch_tutorial_{pr_or_trunk}_build_manager"] = {
3333
"<<": "*pytorch_tutorial_build_manager_defaults"
3434
}
3535
for i in range(num_workers):
3636
job_info = {"<<": "*pytorch_tutorial_build_worker_defaults"}
3737
if i in needs_gpu_nvidia_small_multi:
3838
job_info["resource_class"] = "gpu.nvidia.small.multi"
39-
jobs[f"pytorch_tutorial_{pr_or_master}_build_worker_{i}"] = job_info
39+
jobs[f"pytorch_tutorial_{pr_or_trunk}_build_worker_{i}"] = job_info
4040

4141
return indent(indentation, jobs).replace("'", "")
4242

4343

44-
def workflows_jobs(pr_or_master, indentation=6, num_workers=20):
44+
def workflows_jobs(pr_or_trunk, indentation=6, num_workers=20):
4545
jobs = []
4646
job_info = deepcopy(
47-
WORKFLOWS_JOBS_PR if pr_or_master == "pr" else WORKFLOWS_JOBS_MASTER
47+
WORKFLOWS_JOBS_PR if pr_or_trunk == "pr" else WORKFLOWS_JOBS_TRUNK
4848
)
4949

5050
for i in range(num_workers):
5151
jobs.append(
52-
{f"pytorch_tutorial_{pr_or_master}_build_worker_{i}": deepcopy(job_info)}
52+
{f"pytorch_tutorial_{pr_or_trunk}_build_worker_{i}": deepcopy(job_info)}
5353
)
5454

5555
job_info["requires"] = [
56-
f"pytorch_tutorial_{pr_or_master}_build_worker_{i}" for i in range(num_workers)
56+
f"pytorch_tutorial_{pr_or_trunk}_build_worker_{i}" for i in range(num_workers)
5757
]
58-
jobs.append({f"pytorch_tutorial_{pr_or_master}_build_manager": deepcopy(job_info)})
58+
jobs.append({f"pytorch_tutorial_{pr_or_trunk}_build_manager": deepcopy(job_info)})
5959
return indent(indentation, jobs)
6060

6161

@@ -65,7 +65,7 @@ def windows_jobs(indentation=2, num_workers=4):
6565
jobs[f"pytorch_tutorial_windows_pr_build_worker_{i}"] = {
6666
"<<": "*pytorch_windows_build_worker"
6767
}
68-
jobs[f"pytorch_tutorial_windows_master_build_worker_{i}"] = {
68+
jobs[f"pytorch_tutorial_windows_trunk_build_worker_{i}"] = {
6969
"<<": "*pytorch_windows_build_worker"
7070
}
7171
return indent(indentation, jobs).replace("'", "")
@@ -79,10 +79,10 @@ def windows_workflows_jobs(indentation=6, num_workers=4):
7979
{f"pytorch_tutorial_windows_pr_build_worker_{i}": deepcopy(job_info)}
8080
)
8181

82-
job_info = WORKFLOWS_JOBS_MASTER
82+
job_info = WORKFLOWS_JOBS_TRUNK
8383
for i in range(num_workers):
8484
jobs.append(
85-
{f"pytorch_tutorial_windows_master_build_worker_{i}": deepcopy(job_info)}
85+
{f"pytorch_tutorial_windows_trunk_build_worker_{i}": deepcopy(job_info)}
8686
)
8787

8888
return ("\n#").join(indent(indentation, jobs).splitlines())

.jenkins/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set -ex
22

3-
if [[ "$COMMIT_SOURCE" == master ]]; then
3+
if [[ "$COMMIT_SOURCE" == master || "$COMMIT_SOURCE" == main ]]; then
44
export BUCKET_NAME=pytorch-tutorial-build-master
55
else
66
export BUCKET_NAME=pytorch-tutorial-build-pull-request
@@ -153,7 +153,7 @@ elif [[ "${JOB_BASE_NAME}" == *manager ]]; then
153153
awsv2 s3 cp manager.7z s3://${BUCKET_NAME}/${COMMIT_ID}/manager.7z --acl public-read
154154

155155
# Step 7: push new HTML files and static files to gh-pages
156-
if [[ "$COMMIT_SOURCE" == master ]]; then
156+
if [[ "$COMMIT_SOURCE" == master || "$COMMIT_SOURCE" == main ]]; then
157157
git clone https://github.com/pytorch/tutorials.git -b gh-pages gh-pages
158158
cp -r docs/* gh-pages/
159159
pushd gh-pages

.jenkins/validate_tutorials_built.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"hyperparameter_tuning_tutorial",
5353
"flask_rest_api_tutorial",
5454
"text_to_speech_with_torchaudio",
55-
"ax_multiobjective_nas_tutorial"
5655
]
5756

5857

0 commit comments

Comments
 (0)