Skip to content

Add download mirror functionality#362

Merged
mdimopoulos merged 4 commits into
fluendo:masterfrom
ahresse:mirror
Jul 13, 2026
Merged

Add download mirror functionality#362
mdimopoulos merged 4 commits into
fluendo:masterfrom
ahresse:mirror

Conversation

@ahresse

@ahresse ahresse commented May 21, 2026

Copy link
Copy Markdown
Contributor

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
ahresse marked this pull request as ready for review June 9, 2026 11:44
@ahresse

ahresse commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Unable to launch GitHub Actions jobs. ping: @ylatuya @rsanchez87

@ahresse

ahresse commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @mdimopoulos . Let me know how to proceed further with this PR.

@ahresse

ahresse commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

I was wondering if there is no license restriction to host such test suites in other places than the origin. Any though?

@mdimopoulos

Copy link
Copy Markdown
Contributor

I was wondering if there is no license restriction to host such test suites in other places than the origin. Any though?

I can only refer you to the terms and conditions of ISO that apply for most of the test suites of fluster. https://www.iso.org/terms-conditions-licence-agreement.html#Customer-Licence
I cannot see any explicit mention to hosting but don't take my word for it please.

@ylatuya

ylatuya commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

I was wondering if there is no license restriction to host such test suites in other places than the origin. Any though?

I can only refer you to the terms and conditions of ISO that apply for most of the test suites of fluster. https://www.iso.org/terms-conditions-licence-agreement.html#Customer-Licence I cannot see any explicit mention to hosting but don't take my word for it please.

In that regard, 9d22655 which is part of #324 now ask users to accept the license before downloading resources.

@mdimopoulos is there anything else blocking this PR?

@ahresse

ahresse commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

We have to take care this will be integrated cleanly with the logic of: #338

ahresse added 3 commits July 10, 2026 11:34
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>

@mdimopoulos mdimopoulos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just an optional but advisable action point. PR can merged without though.
@ahresse feel free to decide on the action point

Comment thread scripts/mirror_sync.py Outdated
Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
@mdimopoulos
mdimopoulos merged commit 0cd92eb into fluendo:master Jul 13, 2026
5 checks passed
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.

3 participants