Skip to content

Add timeout and retry for ffmpeg installation in CI workflows#132

Merged
thawn merged 9 commits intomasterfrom
copilot/add-ffmpeg-install-timeout
Jan 3, 2026
Merged

Add timeout and retry for ffmpeg installation in CI workflows#132
thawn merged 9 commits intomasterfrom
copilot/add-ffmpeg-install-timeout

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 3, 2026

Plan: Add timeout and retry to ffmpeg installation

  • Analyze current ffmpeg installation locations in codebase
  • Update setup_e2e_environment.sh to add timeout and retry for apt-get ffmpeg install
  • Update .github/workflows/e2e-tests.yml to add timeout and retry for wget/tar commands
  • Update .github/workflows/copilot-setup-steps.yml to add timeout and retry for wget/tar commands
  • Update .github/workflows/release-executables.yml for Windows ffmpeg download with PowerShell timeout
  • Update .github/workflows/release-executables.yml for macOS ffmpeg download
  • Test the changes manually with bash to ensure timeout and retry work correctly
  • Run unit tests to verify no regressions (144 tests passed)
  • Address all code review feedback and refinements
  • Refactor to eliminate code duplication by extracting installation logic into reusable scripts:
    • Created .github/scripts/install-ffmpeg-linux.sh for Linux static builds
    • Created .github/scripts/install-ffmpeg-macos.sh for macOS downloads
    • Updated workflow files to call scripts instead of duplicating code
    • Reduced 91 lines of duplicated code across workflow files
  • Fix macOS build failure by replacing timeout command (not available on macOS) with Python-based implementation
  • Security improvement: Updated Python timeout implementation to pass arguments properly, avoiding potential command injection
Original prompt

This section details on the original issue you should resolve

<issue_title>sometimes, installing ffmpeg in github workflows stalls indefinitely</issue_title>
<issue_description>we need to add a timeout here (1 min should suffice) after the timeout, try again one more time (with 1 min timeout) if that fails as well, throw an error</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits January 3, 2026 13:39
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Copilot AI changed the title [WIP] Add timeout to ffmpeg installation in workflows Add timeout and retry for ffmpeg installation in CI workflows Jan 3, 2026
Copilot AI requested a review from thawn January 3, 2026 13:47
@thawn
Copy link
Copy Markdown
Owner

thawn commented Jan 3, 2026

@copilot avoid code duplication

Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 3, 2026

@copilot avoid code duplication

Done. I've extracted the duplicated ffmpeg installation code into reusable scripts:

  • .github/scripts/install-ffmpeg-linux.sh - handles Linux static builds with timeout/retry
  • .github/scripts/install-ffmpeg-macos.sh - handles macOS downloads with timeout/retry

This eliminated 91 lines of duplicated code across the workflow files. The scripts are now called directly from the workflows. See commit a7c7683.

@thawn
Copy link
Copy Markdown
Owner

thawn commented Jan 3, 2026

@copilot the MacOS build fails with .github/scripts/install-ffmpeg-macos.sh: line 19: timeout: command not found.
looks like timeout is not installed on the mac runners in the CI maybe you can use a short python -c "your code here" snippet instead?

…tion

Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 3, 2026

@copilot the MacOS build fails with .github/scripts/install-ffmpeg-macos.sh: line 19: timeout: command not found.
looks like timeout is not installed on the mac runners in the CI maybe you can use ...

Fixed in commit 3e79f28. Replaced the timeout command with a Python-based implementation that works on macOS. The new run_with_timeout() function uses Python's subprocess.run() with a timeout parameter, which is available on all platforms. The function maintains the same behavior: returns exit code 124 on timeout, just like the GNU timeout command.

…ction

Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
@thawn thawn marked this pull request as ready for review January 3, 2026 15:02
@thawn thawn merged commit 774e69f into master Jan 3, 2026
13 checks passed
@thawn thawn deleted the copilot/add-ffmpeg-install-timeout branch January 3, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sometimes, installing ffmpeg in github workflows stalls indefinitely

2 participants