config.yml.in 20.1 KB
Newer Older
1
2
3
4
version: 2.1

# How to test the Linux jobs:
#   - Install CircleCI local CLI: https://circleci.com/docs/2.0/local-cli/
5
6
#   - circleci config process .circleci/config.yml > gen.yml && circleci local execute -c gen.yml --job binary_linux_wheel_py3.8
#     - Replace binary_linux_wheel_py3.8 with the name of the job you want to test.
Edward Z. Yang's avatar
Edward Z. Yang committed
7
#       Job names are 'name:' key.
8

9
10
11
12
13
14
executors:
  windows-cpu:
    machine:
      resource_class: windows.xlarge
      image: windows-server-2019-vs2019:stable
      shell: bash.exe
peterjc123's avatar
peterjc123 committed
15

16
17
18
  windows-gpu:
    machine:
      resource_class: windows.gpu.nvidia.medium
19
      image: windows-server-2019-nvidia:previous
20
21
      shell: bash.exe

22
commands:
23
24
25
26
27
28
  generate_cache_key:
    description: "Generates a cache key file that changes daily"
    steps:
      - run:
          name: Generate cache key
          command: echo "$(date +"%Y-%m-%d")" > .cachekey
29
30
31
32
33
34
35
36
  designate_upload_channel:
    description: "inserts the correct upload channel into ${BASH_ENV}"
    steps:
      - run:
          name: adding UPLOAD_CHANNEL to BASH_ENV
          command: |
            our_upload_channel=nightly
            # On tags upload to test instead
37
            if [[ -n "${CIRCLE_TAG}" ]] || [[ ${CIRCLE_BRANCH} =~ release/* ]]; then
38
39
40
              our_upload_channel=test
            fi
            echo "export UPLOAD_CHANNEL=${our_upload_channel}" >> ${BASH_ENV}
moto's avatar
moto committed
41
42
  install_build_tools_macos:
    description: "installs tools required to build torchaudio"
moto's avatar
moto committed
43
44
    steps:
      - run:
45
          name: Install build tools
moto's avatar
moto committed
46
          command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config wget
moto's avatar
moto committed
47
          # Disable brew auto update which is very slow
Eli Uriegas's avatar
Eli Uriegas committed
48
49
50
51
52
53
54
  load_conda_channel_flags:
    description: "Determines whether we need extra conda channels"
    steps:
      - run:
          name: Adding CONDA_CHANNEL_FLAGS to BASH_ENV
          command: |
              CONDA_CHANNEL_FLAGS=""
55
              # formerly used to add conda-forge flags for Python 3.9, reserving the mechanism for future python upgrades
56

57
58
binary_common: &binary_common
  parameters:
Edward Z. Yang's avatar
Edward Z. Yang committed
59
    # Edit these defaults to do a release
60
61
62
63
64
65
66
67
68
69
    build_version:
      description: "version number of release binary; by default, build a nightly"
      type: string
      default: ""
    pytorch_version:
      description: "PyTorch version to build against; by default, use a nightly"
      type: string
      default: ""
    # Don't edit these
    python_version:
70
      description: "Python version to build against (e.g., 3.8)"
71
      type: string
Nikita Shulga's avatar
Nikita Shulga committed
72
73
74
75
76
77
78
79
80
81
82
83
    cuda_version:
      description: "CUDA version to build against (e.g., cpu, cu101)"
      type: string
      default: "cpu"
    wheel_docker_image:
      description: "Wheel only: what docker image to use"
      type: string
      default: "pytorch/manylinux-cuda102"
    conda_docker_image:
      description: "Conda only: what docker image to use"
      type: string
      default: "pytorch/conda-builder:cuda102"
84
  environment: &environment
85
86
87
    PYTHON_VERSION: << parameters.python_version >>
    BUILD_VERSION: << parameters.build_version >>
    PYTORCH_VERSION: << parameters.pytorch_version >>
Nikita Shulga's avatar
Nikita Shulga committed
88
    CU_VERSION: << parameters.cuda_version >>
89

Mingbo Wan's avatar
Mingbo Wan committed
90
91
92
smoke_test_common: &smoke_test_common
  <<: *binary_common
  docker:
93
    - image: 308535385114.dkr.ecr.us-east-1.amazonaws.com/torchaudio/smoke_test:56c846a5-acaa-41a7-92f5-46ec66186c61
Mingbo Wan's avatar
Mingbo Wan committed
94
95
96
97
      aws_auth:
        aws_access_key_id: ${ECR_AWS_ACCESS_KEY}
        aws_secret_access_key: ${ECR_AWS_SECRET_ACCESS_KEY}

98
99
100
jobs:
  circleci_consistency:
    docker:
101
      - image: circleci/python:3.8
102
103
104
105
    steps:
      - checkout
      - run:
          command: |
106
            pip install --user --progress-bar off jinja2 pyyaml
107
108
109
            python .circleci/regenerate.py
            git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1)

110
111
  download_third_parties_nix:
    docker:
moto's avatar
moto committed
112
      - image: "pytorch/torchaudio_unittest_base:manylinux"
113
114
115
    resource_class: small
    steps:
      - checkout
116
      - generate_cache_key
117
118
119
      - restore_cache:
          {% raw %}
          keys:
moto's avatar
moto committed
120
            - tp-nix-v2-{{ checksum ".cachekey" }}
121
122
          {% endraw %}
      - run:
moto's avatar
moto committed
123
          command: |
124
125
              mkdir -p third_party/sox/archives/
              wget --no-clobber --directory-prefix=third_party/sox/archives/ $(awk '/URL /{print $2}' third_party/sox/CMakeLists.txt)
126
127
      - save_cache:
          {% raw %}
moto's avatar
moto committed
128
          key: tp-nix-v2-{{ checksum ".cachekey" }}
129
130
          {% endraw %}
          paths:
131
            - third_party/sox/archives
132
133
134
      - persist_to_workspace:
          root: third_party
          paths:
135
            - sox/archives
136

137
138
139
  binary_linux_wheel:
    <<: *binary_common
    docker:
Nikita Shulga's avatar
Nikita Shulga committed
140
      - image: << parameters.wheel_docker_image >>
141
142
143
    resource_class: 2xlarge+
    steps:
      - checkout
144
145
      - attach_workspace:
          at: third_party
146
147
148
      - run: packaging/build_wheel.sh
      - store_artifacts:
          path: dist
Edward Z. Yang's avatar
Edward Z. Yang committed
149
150
151
152
      - persist_to_workspace:
          root: dist
          paths:
            - "*"
153
154
155
156

  binary_linux_conda:
    <<: *binary_common
    docker:
Nikita Shulga's avatar
Nikita Shulga committed
157
      - image: "<< parameters.conda_docker_image >>"
158
159
160
    resource_class: 2xlarge+
    steps:
      - checkout
Eli Uriegas's avatar
Eli Uriegas committed
161
      - load_conda_channel_flags
162
163
      - attach_workspace:
          at: third_party
164
165
166
      - run: packaging/build_conda.sh
      - store_artifacts:
          path: /opt/conda/conda-bld/linux-64
Edward Z. Yang's avatar
Edward Z. Yang committed
167
      - persist_to_workspace:
168
          root: /opt/conda
Edward Z. Yang's avatar
Edward Z. Yang committed
169
          paths:
170
            - "conda-bld/*"
171
172
173
174

  binary_macos_wheel:
    <<: *binary_common
    macos:
175
      xcode: "12.0"
176
177
    steps:
      - checkout
moto's avatar
moto committed
178
      - install_build_tools_macos
Eli Uriegas's avatar
Eli Uriegas committed
179
      - load_conda_channel_flags
180
181
      - attach_workspace:
          at: third_party
182
183
184
185
186
187
188
189
190
191
192
      - run:
          # Cannot easily deduplicate this as source'ing activate
          # will set environment variables which we need to propagate
          # to build_wheel.sh
          command: |
            curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
            sh conda.sh -b
            source $HOME/miniconda3/bin/activate
            packaging/build_wheel.sh
      - store_artifacts:
          path: dist
Edward Z. Yang's avatar
Edward Z. Yang committed
193
194
195
196
      - persist_to_workspace:
          root: dist
          paths:
            - "*"
197
198
199
200

  binary_macos_conda:
    <<: *binary_common
    macos:
201
      xcode: "12.0"
202
203
    steps:
      - checkout
moto's avatar
moto committed
204
      - install_build_tools_macos
Eli Uriegas's avatar
Eli Uriegas committed
205
      - load_conda_channel_flags
206
207
      - attach_workspace:
          at: third_party
208
209
210
211
212
213
214
215
216
      - run:
          command: |
            curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
            sh conda.sh -b
            source $HOME/miniconda3/bin/activate
            conda install -yq conda-build
            packaging/build_conda.sh
      - store_artifacts:
          path: /Users/distiller/miniconda3/conda-bld/osx-64
Edward Z. Yang's avatar
Edward Z. Yang committed
217
      - persist_to_workspace:
218
          root: /Users/distiller/miniconda3
Edward Z. Yang's avatar
Edward Z. Yang committed
219
          paths:
220
            - "conda-bld/*"
221

peterjc123's avatar
peterjc123 committed
222
223
224
225
226
227
  binary_windows_wheel:
    <<: *binary_common
    executor:
      name: windows-cpu
    steps:
      - checkout
Eli Uriegas's avatar
Eli Uriegas committed
228
      - load_conda_channel_flags
peterjc123's avatar
peterjc123 committed
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
      - run:
          name: build
          command: |
            eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
            conda activate base
            bash packaging/build_wheel.sh
      - store_artifacts:
          path: dist
      - persist_to_workspace:
          root: dist
          paths:
            - "*"

  binary_windows_conda:
    <<: *binary_common
    executor:
      name: windows-cpu
    steps:
      - checkout
Eli Uriegas's avatar
Eli Uriegas committed
248
      - load_conda_channel_flags
peterjc123's avatar
peterjc123 committed
249
250
251
252
253
254
255
256
257
258
      - run:
          name: build
          command: |
            eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
            conda activate base
            conda install -yq conda-build "conda-package-handling!=1.5.0"
            bash packaging/build_conda.sh
      - store_artifacts:
          path: C:/tools/miniconda3/conda-bld/win-64
      - persist_to_workspace:
259
          root: C:/tools/miniconda3
peterjc123's avatar
peterjc123 committed
260
          paths:
261
            - "conda-bld/*"
peterjc123's avatar
peterjc123 committed
262

Edward Z. Yang's avatar
Edward Z. Yang committed
263
264
265
266
267
268
269
  # Requires org-member context
  binary_conda_upload:
    docker:
      - image: continuumio/miniconda
    steps:
      - attach_workspace:
          at: ~/workspace
270
      - designate_upload_channel
Edward Z. Yang's avatar
Edward Z. Yang committed
271
272
273
274
275
      - run:
          command: |
            # Prevent credential from leaking
            conda install -yq anaconda-client
            set -x
276
            anaconda -t "${CONDA_PYTORCHBOT_TOKEN}" upload ~/workspace/conda-bld/*/*.tar.bz2 -u "pytorch-${UPLOAD_CHANNEL}" --label main --no-progress --force
Edward Z. Yang's avatar
Edward Z. Yang committed
277
278
279
280

  # Requires org-member context
  binary_wheel_upload:
    docker:
281
      - image: circleci/python:3.8
Edward Z. Yang's avatar
Edward Z. Yang committed
282
283
284
285
    steps:
      - attach_workspace:
          at: ~/workspace
      - checkout
286
      - designate_upload_channel
Edward Z. Yang's avatar
Edward Z. Yang committed
287
288
289
290
291
292
293
294
295
296
      - run:
          command: |
            pip install --user awscli
            export PATH="$HOME/.local/bin:$PATH"
            # Prevent credential from leaking
            set +x
            export AWS_ACCESS_KEY_ID="${PYTORCH_BINARY_AWS_ACCESS_KEY_ID}"
            export AWS_SECRET_ACCESS_KEY="${PYTORCH_BINARY_AWS_SECRET_ACCESS_KEY}"
            set -x
            for pkg in ~/workspace/*.whl; do
297
              aws s3 cp "$pkg" "s3://pytorch/whl/${UPLOAD_CHANNEL}/" --acl public-read
Edward Z. Yang's avatar
Edward Z. Yang committed
298
299
            done

Mingbo Wan's avatar
Mingbo Wan committed
300
301
302
  smoke_test_linux_conda:
    <<: *smoke_test_common
    steps:
Mingbo Wan's avatar
Mingbo Wan committed
303
304
      - attach_workspace:
          at: ~/workspace
305
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
306
      - load_conda_channel_flags
Mingbo Wan's avatar
Mingbo Wan committed
307
      - run:
Mingbo Wan's avatar
Mingbo Wan committed
308
          name: install binaries
Mingbo Wan's avatar
Mingbo Wan committed
309
310
311
          command: |
            set -x
            source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
312
            conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cpuonly
313
            conda install -v -y -c file://$HOME/workspace/conda-bld torchaudio
Mingbo Wan's avatar
Mingbo Wan committed
314
315
316
317
      - run:
          name: smoke test
          command: |
            source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
Mingbo Wan's avatar
Mingbo Wan committed
318
319
320
321
322
            python -c "import torchaudio"

  smoke_test_linux_pip:
    <<: *smoke_test_common
    steps:
Mingbo Wan's avatar
Mingbo Wan committed
323
324
      - attach_workspace:
          at: ~/workspace
325
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
326
      - load_conda_channel_flags
Mingbo Wan's avatar
Mingbo Wan committed
327
      - run:
Mingbo Wan's avatar
Mingbo Wan committed
328
          name: install binaries
Mingbo Wan's avatar
Mingbo Wan committed
329
330
331
          command: |
            set -x
            source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
332
            pip install $(ls ~/workspace/torchaudio*.whl) -f "https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/torch_${UPLOAD_CHANNEL}.html"
Mingbo Wan's avatar
Mingbo Wan committed
333
334
335
336
      - run:
          name: smoke test
          command: |
            source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
Mingbo Wan's avatar
Mingbo Wan committed
337
338
            python -c "import torchaudio"

339
340
341
342
343
344
345
  smoke_test_windows_conda:
    <<: *binary_common
    executor:
      name: windows-cpu
    steps:
      - attach_workspace:
          at: ~/workspace
346
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
347
      - load_conda_channel_flags
348
349
350
351
352
353
354
355
      - run:
          name: install binaries
          command: |
            set -x
            eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
            conda env remove -n python${PYTHON_VERSION} || true
            conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
            conda activate python${PYTHON_VERSION}
356
            conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cpuonly
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
            conda install -v -y $(ls ~/workspace/torchaudio*.tar.bz2)
      - run:
          name: smoke test
          command: |
            eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
            conda activate python${PYTHON_VERSION}
            python -c "import torchaudio"

  smoke_test_windows_pip:
    <<: *binary_common
    executor:
      name: windows-cpu
    steps:
      - attach_workspace:
          at: ~/workspace
372
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
373
      - load_conda_channel_flags
374
375
376
377
378
379
380
381
      - run:
          name: install binaries
          command: |
            set -x
            eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
            conda env remove -n python${PYTHON_VERSION} || true
            conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION}
            conda activate python${PYTHON_VERSION}
382
            pip install $(ls ~/workspace/torchaudio*.whl) -f "https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/torch_${UPLOAD_CHANNEL}.html"
383
384
385
386
387
388
389
      - run:
          name: smoke test
          command: |
            eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')"
            conda activate python${PYTHON_VERSION}
            python -c "import torchaudio"

390
  smoke_test_docker_image_build:
Mingbo Wan's avatar
Mingbo Wan committed
391
392
393
394
395
396
397
398
399
400
401
    machine:
      image: ubuntu-1604:201903-01
    resource_class: large
    environment:
      image_name: torchaudio/smoke_test
    steps:
      - checkout
      - run:
          name: build_docker image
          no_output_timeout: "1h"
          command: |
402
            cd .circleci/smoke_test/docker && docker build . -t ${image_name}:${CIRCLE_WORKFLOW_ID}
Mingbo Wan's avatar
Mingbo Wan committed
403
404
405
406
407
408
409
410
411
412
      - run:
          name: upload docker image
          no_output_timeout: "1h"
          command: |
            set +x
            export AWS_ACCESS_KEY_ID=${ECR_AWS_ACCESS_KEY}
            export AWS_SECRET_ACCESS_KEY=${ECR_AWS_SECRET_ACCESS_KEY}
            eval $(aws ecr get-login --region us-east-1 --no-include-email)
            set -x
            docker tag ${image_name}:${CIRCLE_WORKFLOW_ID} 308535385114.dkr.ecr.us-east-1.amazonaws.com/${image_name}:${CIRCLE_WORKFLOW_ID}
413
            docker tag ${image_name}:${CIRCLE_WORKFLOW_ID} 308535385114.dkr.ecr.us-east-1.amazonaws.com/${image_name}:latest
Mingbo Wan's avatar
Mingbo Wan committed
414
            docker push 308535385114.dkr.ecr.us-east-1.amazonaws.com/${image_name}:${CIRCLE_WORKFLOW_ID}
415
            docker push 308535385114.dkr.ecr.us-east-1.amazonaws.com/${image_name}:latest
Edward Z. Yang's avatar
Edward Z. Yang committed
416

moto's avatar
moto committed
417
  unittest_linux_cpu:
moto's avatar
moto committed
418
419
    <<: *binary_common
    docker:
420
      - image: pytorch/torchaudio_unittest_base:manylinux-20210121
moto's avatar
moto committed
421
422
423
    resource_class: 2xlarge+
    steps:
      - checkout
424
425
      - attach_workspace:
          at: third_party
426
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
427
      - load_conda_channel_flags
428
429
430
431
432
433
434
435
436
437
438
      - run:
          name: Setup
          command: .circleci/unittest/linux/scripts/setup_env.sh
      - run:
          name: Install torchaudio
          command: .circleci/unittest/linux/scripts/install.sh
      - run:
          name: Run tests
          command: .circleci/unittest/linux/scripts/run_test.sh
      - store_test_results:
          path: test-results
439
440
      - store_artifacts:
          path: test/htmlcov
moto's avatar
moto committed
441
442
443
444
445
446
  unittest_linux_gpu:
    <<: *binary_common
    machine:
      image: ubuntu-1604-cuda-10.1:201909-23
    resource_class: gpu.small
    environment:
447
      <<: *environment
moto's avatar
moto committed
448
      image_name: pytorch/torchaudio_unittest_base:manylinux-cuda10.2-cudnn8-20210623
moto's avatar
moto committed
449
450
    steps:
      - checkout
451
452
      - attach_workspace:
          at: third_party
453
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
454
      - load_conda_channel_flags
455
456
457
      - run:
          name: Pull Docker image
          command: docker pull --quiet "${image_name}"
moto's avatar
moto committed
458
459
      - run:
          name: Setup
460
          command: docker run -t --gpus all -e PYTHON_VERSION -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/setup_env.sh
moto's avatar
moto committed
461
462
      - run:
          name: Install torchaudio
Eli Uriegas's avatar
Eli Uriegas committed
463
          command: docker run -t --gpus all -e UPLOAD_CHANNEL -e CONDA_CHANNEL_FLAGS -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/install.sh
moto's avatar
moto committed
464
465
      - run:
          name: Run tests
466
          command: docker run -t --gpus all -v $PWD:$PWD -w $PWD -e "TORCHAUDIO_TEST_FORCE_CUDA=1" "${image_name}" .circleci/unittest/linux/scripts/run_test.sh
moto's avatar
moto committed
467
468
      - store_test_results:
          path: test-results
469
470
      - store_artifacts:
          path: test/htmlcov
moto's avatar
moto committed
471
472

  unittest_windows_cpu:
473
474
475
    <<: *binary_common
    executor:
      name: windows-cpu
476
477
    steps:
      - checkout
478
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
479
      - load_conda_channel_flags
480
481
482
483
484
485
486
487
488
489
490
      - run:
          name: Setup
          command: .circleci/unittest/windows/scripts/setup_env.sh
      - run:
          name: Install torchaudio
          command: .circleci/unittest/windows/scripts/install.sh
      - run:
          name: Run tests
          command: .circleci/unittest/windows/scripts/run_test.sh
      - store_test_results:
          path: test-results
491
492
      - store_artifacts:
          path: test/htmlcov
493
494
495
496
497
498

  unittest_windows_gpu:
    <<: *binary_common
    executor:
      name: windows-gpu
    environment:
499
      <<: *environment
500
      CUDA_VERSION: "10.2"
501
502
    steps:
      - checkout
503
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
504
      - load_conda_channel_flags
moto's avatar
moto committed
505
506
      - run:
          name: Setup
507
          command: .circleci/unittest/windows/scripts/setup_env.sh
moto's avatar
moto committed
508
      - run:
509
          name: Install torchaudio
510
          command: .circleci/unittest/windows/scripts/install.sh
moto's avatar
moto committed
511
      - run:
512
          name: Run tests
513
          command: .circleci/unittest/windows/scripts/run_test.sh
moto's avatar
moto committed
514
515
      - store_test_results:
          path: test-results
516
517
      - store_artifacts:
          path: test/htmlcov
moto's avatar
moto committed
518

moto's avatar
moto committed
519
520
521
  unittest_macos_cpu:
    <<: *binary_common
    macos:
522
      xcode: "12.0"
moto's avatar
moto committed
523
524
525
526
    resource_class: large
    steps:
      - checkout
      - install_build_tools_macos
Eli Uriegas's avatar
Eli Uriegas committed
527
      - load_conda_channel_flags
moto's avatar
moto committed
528
529
      - attach_workspace:
          at: third_party
530
      - designate_upload_channel
moto's avatar
moto committed
531
532
533
534
535
536
537
538
539
540
541
      - run:
          name: Setup
          command: .circleci/unittest/linux/scripts/setup_env.sh
      - run:
          name: Install torchaudio
          command: .circleci/unittest/linux/scripts/install.sh
      - run:
          name: Run tests
          command: .circleci/unittest/linux/scripts/run_test.sh
      - store_test_results:
          path: test-results
542
543
      - store_artifacts:
          path: test/htmlcov
moto's avatar
moto committed
544

545
546
547
548
549
550
551
  stylecheck:
    <<: *binary_common
    docker:
      - image: "pytorch/torchaudio_unittest_base:manylinux"
    resource_class: medium
    steps:
      - checkout
552
      - designate_upload_channel
Eli Uriegas's avatar
Eli Uriegas committed
553
      - load_conda_channel_flags
554
555
556
557
558
559
560
      - run:
          name: Setup
          command: .circleci/unittest/linux/scripts/setup_env.sh
      - run:
          name: Run style check
          command: .circleci/unittest/linux/scripts/run_style_checks.sh

561
562
563
564
565
566
567
568
569
  build_docs:
    <<: *binary_common
    docker:
      - image: "pytorch/manylinux-cuda100"
    resource_class: 2xlarge+
    steps:
      - attach_workspace:
          at: ~/workspace
      - checkout
Eli Uriegas's avatar
Eli Uriegas committed
570
      - load_conda_channel_flags
571
572
573
574
575
576
577
      - run:
          name: Install pytorch-audio
          command: .circleci/build_docs/install_wheels.sh
      - run:
          name: Build docs
          command: .circleci/build_docs/build_docs.sh
      - persist_to_workspace:
578
          root: ./
579
580
          paths:
            - "*"
581
582
583
      - store_artifacts:
          path: ./docs/build/html
          destination: docs
584
585
586
587
588
589
590
591
592

  upload_docs:
    <<: *binary_common
    docker:
      - image: "pytorch/manylinux-cuda100"
    resource_class: 2xlarge+
    steps:
      - attach_workspace:
          at: ~/workspace
593
594
595
596
597
598
599
600
601
602
      - run:
          name: Generate netrc
          command: |
            # set credentials for https pushing
            # requires the org-member context
            cat > ~/.netrc \<<DONE
              machine github.com
              login pytorchbot
              password ${GITHUB_PYTORCHBOT_TOKEN}
            DONE
603
604
605
      - run:
          name: Upload docs
          command: |
606
607
            # Don't use "checkout" step since it uses ssh, which cannot git push
            # https://circleci.com/docs/2.0/configuration-reference/#checkout
608
609
            set -ex
            tag=${CIRCLE_TAG:1:5}
610
            target=${tag:-main}
Matti Picus's avatar
Matti Picus committed
611
            ~/workspace/.circleci/build_docs/commit_docs.sh ~/workspace $target
612

613
614
615
616
617
618
619
620
621
622
623
624
  docstring_parameters_sync:
    <<: *binary_common
    docker:
      - image: circleci/python:3.8
    steps:
      - checkout
      - run:
          name: Check parameters docstring sync
          command: |
            pip install --user pydocstyle
            pydocstyle torchaudio

Edward Z. Yang's avatar
Edward Z. Yang committed
625
626
627
628
workflows:
  build:
    jobs:
      - circleci_consistency
moto's avatar
moto committed
629
630
631
632
      {{ build_workflows() }}
  unittest:
    jobs:
      {{ unittest_workflows() }}
Edward Z. Yang's avatar
Edward Z. Yang committed
633
634
  nightly:
    jobs:
moto's avatar
moto committed
635
636
637
638
      - circleci_consistency:
          filters:
            branches:
              only: nightly
moto's avatar
moto committed
639
      {{ build_workflows(prefix="nightly_", filter_branch="nightly", upload=True) }}
Mingbo Wan's avatar
Mingbo Wan committed
640
641
642
643
644
645
646
  docker_build:
    triggers:
      - schedule:
          cron: "0 10 * * 0"
          filters:
            branches:
              only:
647
                - main
Mingbo Wan's avatar
Mingbo Wan committed
648
    jobs:
649
      - smoke_test_docker_image_build