Skip to content

Add download mirror functionality#362

Draft
ahresse wants to merge 3 commits into
fluendo:masterfrom
ahresse:mirror
Draft

Add download mirror functionality#362
ahresse wants to merge 3 commits into
fluendo:masterfrom
ahresse:mirror

Conversation

@ahresse
Copy link
Copy Markdown

@ahresse ahresse commented May 21, 2026

This pull request adds support for downloading test suite resources from a local HTTP mirror, improving speed and efficiency in CI or multi-machine environments. It introduces a new --mirror option to the download command, updates the documentation, and adds a script to help set up and sync a local mirror directory. The most important changes are:

Local Mirror Support:

  • Added a --mirror option to the fluster.py download command, allowing users to specify a base URL for a local mirror. Fluster will try downloading from the mirror first and fall back to the original source if the mirror fails. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

  • Implemented mirror URL rewriting and robust error handling in the download utility, ensuring proper fallback to the original source if the mirror is unavailable or returns an error. [1] [2]

Documentation Updates:

  • Updated README.md to document the new --mirror option, provide usage examples, and explain how to set up and use a local mirror for test suite resources. [1] [2] [3] [4]

Mirror Sync Script:

  • Added a new script, scripts/mirror_sync.py, which scans all test suite JSON files and downloads every referenced resource into a local directory tree, making it easy to set up a mirror server. The script supports parallel downloads and skipping already-downloaded files.

These changes make it much easier and faster to run fluster in environments where repeated downloads from the internet are undesirable or slow.

ahresse added 3 commits May 21, 2026 13:23
Add -m/--mirror option to the download subcommand that rewrites source URLs to
point to a local HTTP mirror, with automatic fallback to the original internet
source on failure.

The mirror URL is constructed by stripping the scheme from the original URL
and prepending the mirror base URL, e.g.:
  - https://storage.googleapis.com/aom-test-data/file.ivf
  - http://mirror.local:8080/storage.googleapis.com/aom-test-data/file.ivf

Changes:
- Add rewrite_url() and MIRROR_NETWORK_ERRORS to utils.py
- Add mirror parameter with fallback logic to utils.download()
- Add -m/--mirror CLI argument to the download subcommand
- Propagate mirror through fluster.py and test_suite.py call chain
- Add unit and integration tests for mirror URL rewriting and download

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
Add scripts/mirror_sync.py which scans test suite JSON files for source URLs
and downloads them into a directory tree suitable for serving as a local
mirror (e.g. via nginx or python -m http.server). Supports parallel downloads
and configurable retries.

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
Document the --mirror download option and mirror_sync.py script, including how
the mirror URL rewriting works, usage examples, and instructions for setting
up a mirror server.

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
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.

1 participant