Add mirror fallback for Debian cloud image downloads#23
Conversation
`cloud.debian.org` has no CDN and causes intermittent download failures in CI. Switch primary mirror to `cdimage.debian.org` and keep `cloud.debian.org` as fallback. `DEBIAN_IMG_URL` now accepts either a string (backwards compatible) or a list of URL templates (priority-ordered mirrors). If the primary mirror exhausts all retries, the next mirror in the list is tried with the same retry logic. Also fixes a pre-existing bug where calling `get_debian_image_url()` with `arch=aarch64` permanently mutated `config_data.DEBIAN_IMG_URL` (replacing `genericcloud` with `generic`), corrupting subsequent x86_64 URL generation within the same process. Assisted-by: Claude Code Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
|
|
||
|
|
||
| def get_debian_image_url(version: str, arch: str) -> str: | ||
| def get_debian_image_url(version: str, arch: str) -> list[str]: |
There was a problem hiding this comment.
Is it worth it to have fallback mechanism though? What exactly is it meant to catch during the fallback, that it the cdn is slow, that it is unreachable?
And on top of that we only treat Debian as such a special snowflake?
There was a problem hiding this comment.
felt like a more safer approach, just in case
There was a problem hiding this comment.
also it might be more sources in the future for images would be needed, so decided to go this way, it is up for dicussion
There was a problem hiding this comment.
also it might be more sources in the future for images would be needed
Would want a clear definition of what issues are being caught for the fallback and a generalization for the others as well.
For example, if a connection is slow but still responsive, then we do not address the original issue for this, we just introduce a more niche way that it could fail that is harder to find out or debug.
cloud.debian.orghas no CDN and causes intermittent download failures in CI. Switch primary mirror tocdimage.debian.organd keepcloud.debian.orgas fallback.DEBIAN_IMG_URLnow accepts either a string (backwards compatible) or a list of URL templates (priority-ordered mirrors). If the primary mirror exhausts all retries, the next mirror in the list is tried with the same retry logic.Also fixes a pre-existing bug where calling
get_debian_image_url()witharch=aarch64permanently mutatedconfig_data.DEBIAN_IMG_URL(replacinggenericcloudwithgeneric), corrupting subsequent x86_64 URL generation within the same process.Assisted-by: Claude Code