Skip to content

Commit

Permalink
Import torchaudio #1942 ab50909
Browse files Browse the repository at this point in the history
Summary: title

Reviewed By: nateanl, mthrok

Differential Revision: D31997978

fbshipit-source-id: cfbfa192780f7d786a658eb84cc0685881a4f398
  • Loading branch information
Caroline Chen authored and facebook-github-bot committed Nov 3, 2021
1 parent b2f91c2 commit 934bf88
Show file tree
Hide file tree
Showing 59 changed files with 1,050 additions and 626 deletions.
92 changes: 37 additions & 55 deletions .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 25 additions & 43 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ binary_common: &binary_common
smoke_test_common: &smoke_test_common
<<: *binary_common
docker:
- image: 308535385114.dkr.ecr.us-east-1.amazonaws.com/torchaudio/smoke_test:56c846a5-acaa-41a7-92f5-46ec66186c61
aws_auth:
aws_access_key_id: ${ECR_AWS_ACCESS_KEY}
aws_secret_access_key: ${ECR_AWS_SECRET_ACCESS_KEY}
- image: pytorch/torchaudio_unittest_base:smoke_test-20211019
resource_class: large

jobs:
circleci_consistency:
Expand Down Expand Up @@ -337,6 +335,26 @@ jobs:
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
python -c "import torchaudio"

smoke_test_linux_conda_gpu:
<<: *smoke_test_common
steps:
- attach_workspace:
at: ~/workspace
- designate_upload_channel
- load_conda_channel_flags
- run:
name: install binaries
command: |
set -x
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge
conda install -v -y -c file://$HOME/workspace/conda-bld torchaudio
- run:
name: smoke test
command: |
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
python -c "import torchaudio"

smoke_test_linux_pip:
<<: *smoke_test_common
steps:
Expand All @@ -349,7 +367,7 @@ jobs:
command: |
set -x
source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION}
pip install $(ls ~/workspace/torchaudio*.whl) -f "https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/torch_${UPLOAD_CHANNEL}.html"
pip install $(ls ~/workspace/torchaudio*.whl) -f "https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/${CU_VERSION}/torch_${UPLOAD_CHANNEL}.html"
- run:
name: smoke test
command: |
Expand Down Expand Up @@ -407,33 +425,6 @@ jobs:
conda activate python${PYTHON_VERSION}
python -c "import torchaudio"

smoke_test_docker_image_build:
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: |
cd .circleci/smoke_test/docker && docker build . -t ${image_name}:${CIRCLE_WORKFLOW_ID}
- 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}
docker tag ${image_name}:${CIRCLE_WORKFLOW_ID} 308535385114.dkr.ecr.us-east-1.amazonaws.com/${image_name}:latest
docker push 308535385114.dkr.ecr.us-east-1.amazonaws.com/${image_name}:${CIRCLE_WORKFLOW_ID}
docker push 308535385114.dkr.ecr.us-east-1.amazonaws.com/${image_name}:latest

unittest_linux_cpu:
<<: *binary_common
docker:
Expand Down Expand Up @@ -633,7 +624,8 @@ jobs:
# Don't use "checkout" step since it uses ssh, which cannot git push
# https://circleci.com/docs/2.0/configuration-reference/#checkout
set -ex
tag=${CIRCLE_TAG:1:5}
# turn v1.12.0rc3 into 1.12.0
tag=$(echo $CIRCLE_TAG | sed -e 's/v*\([0-9.]*\).*/\1/')
target=${tag:-main}
~/workspace/.circleci/build_docs/commit_docs.sh ~/workspace $target

Expand Down Expand Up @@ -664,13 +656,3 @@ workflows:
branches:
only: nightly
{{ build_workflows(prefix="nightly_", filter_branch="nightly", upload=True) }}
docker_build:
triggers:
- schedule:
cron: "0 10 * * 0"
filters:
branches:
only:
- main
jobs:
- smoke_test_docker_image_build
5 changes: 4 additions & 1 deletion .circleci/regenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def generate_smoketest_workflow(pydistro, base_workflow_name, filter_branch, pyt
if filter_branch:
d["filters"] = gen_filter_branch_tree(filter_branch)

return {f"smoke_test_{os_type}_{pydistro}": d}
smoke_name = f"smoke_test_{os_type}_{pydistro}"
if pydistro == "conda" and os_type == "linux" and cu_version != "cpu":
smoke_name += "_gpu"
return {smoke_name: d}


def indent(indentation, data_list):
Expand Down
2 changes: 2 additions & 0 deletions .circleci/smoke_test/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ ENV PATH /opt/conda/bin:$PATH
RUN conda create -y --name python3.6 python=3.6
RUN conda create -y --name python3.7 python=3.7
RUN conda create -y --name python3.8 python=3.8
RUN conda create -y --name python3.9 python=3.9
SHELL [ "/bin/bash", "-c" ]
RUN echo "source /usr/local/etc/profile.d/conda.sh" >> ~/.bashrc
RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.6 && conda install -y -c conda-forge sox && conda install -y numpy
RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.7 && conda install -y -c conda-forge sox && conda install -y numpy
RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.8 && conda install -y -c conda-forge sox && conda install -y numpy
RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.9 && conda install -y -c conda-forge sox && conda install -y numpy
CMD [ "/bin/bash"]
8 changes: 8 additions & 0 deletions .circleci/smoke_test/docker/build_and_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -euo pipefail

datestr="$(date "+%Y%m%d")"
image="pytorch/torchaudio_unittest_base:smoke_test-${datestr}"
docker build -t "${image}" .
docker push "${image}"
Loading

0 comments on commit 934bf88

Please sign in to comment.