Commit cc41178b authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Clean up FFmpeg build scripts (#3470)

Summary: Pull Request resolved: https://github.com/pytorch/audio/pull/3470

Differential Revision: D47374347

Pulled By: mthrok

fbshipit-source-id: 003b83e50a70f6e1d06eb196f0be5dbba1640226
parent 18b20f77
@echo off
if exist "third_party\ffmpeg\" goto end
set PROJ_FOLDER=%cd%
choco install -y --no-progress msys2 --package-parameters "/NoUpdate"
C:\tools\msys64\usr\bin\env MSYSTEM=MINGW64 /bin/bash -l -c "pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain diffutils"
C:\tools\msys64\usr\bin\env MSYSTEM=MINGW64 /bin/bash -l -c "cd ${PROJ_FOLDER} && export FFMPEG_ROOT=${PWD}/third_party/ffmpeg && packaging/vc_env_helper.bat bash ./packaging/ffmpeg/build.sh"
C:\tools\msys64\usr\bin\env MSYSTEM=MINGW64 /bin/bash -l -c "cd ${PROJ_FOLDER} && packaging/vc_env_helper.bat bash .github/scripts/ffmpeg/build.sh"
:end
......@@ -107,14 +107,13 @@ jobs:
# Install torchaudio
# TODO: Enable NVDec/NVEnc
conda install --quiet -y 'ffmpeg>=4.1' pkg-config
conda install --quiet -y pkg-config
pip --quiet install cmake>=3.18.0 ninja
BUILD_VERSION=$( cut -f 1 -d a version.txt )
BUILD_VERSION=$BUILD_VERSION.dev$(date "+%Y%m%d")
export BUILD_VERSION
FFMPEG_ROOT=${CONDA_PREFIX} USE_FFMPEG=1 USE_CUDA=1 pip install --progress-bar off -v -e . --no-use-pep517
FFMPEG_ROOT=${CONDA_PREFIX} USE_CUDA=1 pip install --progress-bar off -v -e . --no-use-pep517
# Install runtime dependencies
pip --quiet install git+https://github.com/kpu/kenlm/ flashlight-text
......
......@@ -25,10 +25,9 @@ jobs:
repository: pytorch/audio
script: |
export FFMPEG_VERSION="${{ matrix.ffmpeg_version }}"
export FFMPEG_ROOT="${PWD}/third_party/ffmpeg"
./packaging/ffmpeg/build.sh
export FFMPEG_ROOT="${PWD}/ffmpeg"
.github/scripts/ffmpeg/build.sh
cd "${FFMPEG_ROOT}/.."
tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/linux_x86_64/"
......@@ -50,10 +49,9 @@ jobs:
docker-image: quay.io/pypa/manylinux2014_aarch64
script: |
export FFMPEG_VERSION="${{ matrix.ffmpeg_version }}"
export FFMPEG_ROOT="${PWD}/third_party/ffmpeg"
./packaging/ffmpeg/build.sh
export FFMPEG_ROOT="${PWD}/ffmpeg"
.github/scripts/ffmpeg/build.sh
cd "${FFMPEG_ROOT}/.."
tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/linux_aarch64/"
......@@ -74,10 +72,9 @@ jobs:
runner: "${{ matrix.runner }}"
script: |
export FFMPEG_VERSION="${{ matrix.ffmpeg_version }}"
export FFMPEG_ROOT="${PWD}/third_party/ffmpeg"
./packaging/ffmpeg/build.sh
export FFMPEG_ROOT="${PWD}/ffmpeg"
.github/scripts/ffmpeg/build.sh
cd "${FFMPEG_ROOT}/.."
tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/macos_$(uname -m)"
......@@ -96,10 +93,9 @@ jobs:
repository: pytorch/audio
script: |
export FFMPEG_VERSION="${{ matrix.ffmpeg_version }}"
export FFMPEG_ROOT="${PWD}/third_party/ffmpeg"
./packaging/ffmpeg/build.bat
export FFMPEG_ROOT="${PWD}/ffmpeg"
.github/scripts/ffmpeg/build.bat
cd "${FFMPEG_ROOT}/.."
tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/bin
artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/windows"
......
......@@ -31,8 +31,6 @@ jobs:
python -m pip install --quiet --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
python -m pip install --quiet pytest requests cmake ninja deep-phonemizer sentencepiece flashlight-text git+https://github.com/kpu/kenlm
python setup.py install
env:
USE_FFMPEG: true
- name: Run integration test
run: |
cd test && pytest integration_tests -v --use-tmp-hub-dir
......@@ -27,7 +27,6 @@ jobs:
# Set up Environment Variables
export PYTHON_VERSION="${{ matrix.python_version }}"
export USE_FFMPEG="1"
export CUDA_TESTS_ONLY="0"
unset CUDA_VERSION
......
......@@ -57,7 +57,7 @@ jobs:
# Install torchaudio
conda install --quiet -y 'ffmpeg>=4.1' pkg-config
python3 -m pip --quiet install cmake>=3.18.0 ninja
USE_FFMPEG=1 python3 -m pip install -v -e . --no-use-pep517
python3 -m pip install -v -e . --no-use-pep517
# Install test tools
conda install -y --quiet -c conda-forge -c numba/label/dev 'librosa==0.10.0' parameterized 'requests>=2.20'
......
......@@ -28,7 +28,6 @@ jobs:
export PYTHON_VERSION="3.8"
export CU_VERSION=""
export CUDATOOLKIT=""
export USE_FFMPEG="1"
export USE_OPENMP="0"
# Set CHANNEL
......
......@@ -22,7 +22,6 @@ jobs:
# Set up Environment Variables
export PYTHON_VERSION="3.8"
export USE_FFMPEG="1"
unset CUDA_VERSION
# Set CHANNEL
......
......@@ -22,7 +22,6 @@ jobs:
# Set up Environment Variables
export PYTHON_VERSION="3.8"
export USE_FFMPEG="1"
export CUDA_VERSION=11.8
# Set CHANNEL
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment