Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 41 additions & 20 deletions .github/workflows/build_ffmpeg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# This job does not include the uploading part.
# Upload needs to be done manually, and it should be done only once
# par new major release of FFmepg.
# per new major release of FFmepg.
name: Build non-GPL FFmpeg from source

on:
Expand All @@ -20,26 +20,47 @@ defaults:

jobs:
LGPL-Linux-x86_64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Build FFmpeg
run: |
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
export FFMPEG_ROOT="${PWD}/ffmpeg"

packaging/build_ffmpeg.sh

tar -czf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib

mkdir -p artifact_dir
mv ffmpeg.tar.gz artifact_dir/ffmpeg_"${FFMPEG_VERSION}".tar.gz
- uses: actions/upload-artifact@v4
with:
name: "ffmpeg_${{ matrix.ffmpeg-version }}_linux_x86_64"
path: artifact_dir
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
job-name: Build
upload-artifact: ffmpeg-lgpl
repository: pytorch/torchcodec
script: |
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
export FFMPEG_ROOT="${PWD}/ffmpeg"

packaging/build_ffmpeg.sh

tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib

artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/linux_x86_64"
mkdir -p "${artifact_dir}"
mv ffmpeg.tar.gz "${artifact_dir}/${FFMPEG_VERSION}.tar.gz"

LGPL-macOS:
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
runner: ["macos-m1-stable", "macos-12"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pytorch doesn't support x86 for mac anymore

Suggested change
runner: ["macos-m1-stable", "macos-12"]
runner: ["macos-m1-stable"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. The curious bit here is that my system is an x86 Mac, so if I'm going to do any local testing of Mac wheels, then I'll need to keep this in. I can just use CI for everything instead. Let me know which you think is more important: aligning with general PyTorch, or enabling local testing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to keep this in for local testing. This just instructs the CI to spin x86 instances. This is never executed on your machine. The actual build script should execute just fine for you locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agreed, this never executes on my machine. But I will want to locally define BUILD_AGAINST_ALL_FFMPEG_FROM_S3 and build on my machine to test that flow locally. And if we don't build non-GPL FFmpeg x86 binaries for Mac in this step in CI, then they won't be available to upload to S3, and I won't be able to test that flow locally.

We can remove it after I've gotten everything setup, but I think at least while I'm working on this, it's better that these binaries are available.

uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
job-name: Build
upload-artifact: ffmpeg-lgpl
repository: pytorch/torchcodec
runner: "${{ matrix.runner }}"
script: |
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
export FFMPEG_ROOT="${PWD}/ffmpeg"

packaging/build_ffmpeg.sh

tar -cf ffmpeg.tar.gz ffmpeg/include ffmpeg/lib

artifact_dir="${RUNNER_ARTIFACT_DIR}/$(date +%Y-%m-%d)/macos_$(uname -m)"
mkdir -p "${artifact_dir}"
mv ffmpeg.tar.gz "${artifact_dir}/${FFMPEG_VERSION}.tar.gz"
Loading