-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Mac to S3 non-GPL FFmpeg compile
- Loading branch information
Showing
9 changed files
with
350 additions
and
38 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: MacOS From Source | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
- release/* | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
defaults: | ||
run: | ||
shell: bash -l -eo pipefail {0} | ||
|
||
jobs: | ||
install-and-test: | ||
runs-on: macos-m1-stable | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.9'] | ||
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1'] | ||
if: ${{ always() }} | ||
steps: | ||
- name: Setup conda env | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
miniconda-version: "latest" | ||
activate-environment: test | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
|
||
- name: Install PyTorch | ||
run: | | ||
conda install pytorch-nightly::pytorch torchvision torchaudio -c pytorch-nightly | ||
- name: Install compile from source dependencies | ||
run: | | ||
conda install cmake pkg-config "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge | ||
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install torchcodec from source | ||
run: | | ||
pip install -e ".[dev]" --no-build-isolation -vv | ||
- name: Install test dependencies | ||
run: | | ||
conda install numpy pytest pillow | ||
- name: Smoke test | ||
run: | | ||
python test/decoders/manual_smoke_test.py | ||
- name: Run Python tests | ||
continue-on-error: true | ||
run: | | ||
pytest test --capture=fd -k "test_throws_exception_at_eof" -vvv | ||
- name: Print debug text | ||
run: | | ||
echo "pwd" | ||
pwd | ||
echo "" | ||
echo "ls -lh" | ||
ls -lh | ||
echo "" | ||
echo "cat debug.txt" | ||
cat debug.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Build and test MacOS | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
- release/* | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
defaults: | ||
run: | ||
shell: bash -l -eo pipefail {0} | ||
|
||
jobs: | ||
install-and-test: | ||
runs-on: macos-m1-stable | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.9'] | ||
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1'] | ||
if: ${{ always() }} | ||
steps: | ||
- name: Setup conda env | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
miniconda-version: "latest" | ||
activate-environment: test | ||
python-version: ${{ matrix.python-version }} | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install PyTorch | ||
run: | | ||
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu | ||
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
- name: Install compile from source dependencies | ||
run: | | ||
conda install cmake pkg-config -c conda-forge | ||
- name: Install test dependencies | ||
run: | | ||
python -m pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cpu | ||
# Ideally we would find a way to get those dependencies from pyproject.toml | ||
python -m pip install numpy pytest pillow | ||
- name: Install torchcodec from source, building against non-GPL FFmpeg | ||
run: | | ||
BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 pip install -e ".[dev]" --no-build-isolation | ||
- name: Inspect dir | ||
run: | | ||
echo "pwd" | ||
pwd | ||
echo "" | ||
echo "ls -lh" | ||
ls -lh | ||
echo "" | ||
echo "ls -lh src/torchcodec" | ||
ls -lh src/torchcodec | ||
echo "" | ||
echo "otool -L src/torchcodec/libtorchcodec4.dylib" | ||
otool -L src/torchcodec/libtorchcodec4.dylib | ||
- name: Install ffmpeg, post build | ||
run: | | ||
# Ideally we would have checked for that before installing the wheel, | ||
# but we need to checkout the repo to access this file, and we don't | ||
# want to checkout the repo before installing the wheel to avoid any | ||
# side-effect. It's OK. | ||
source packaging/helpers.sh | ||
assert_ffmpeg_not_installed | ||
conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge | ||
ffmpeg -version | ||
- name: Smoke test | ||
run: | | ||
python test/decoders/manual_smoke_test.py | ||
- name: Run Python tests | ||
run: | | ||
#pytest test -vvv | ||
pytest test -k "not test_throws_exception_" -vvv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.