Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues #562,#561,#560: #571

Merged
merged 3 commits into from
Jul 7, 2022
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
82 changes: 82 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,82 @@
WHITELIST_MIRRORS = (
'repo.almalinux.org',
)
# FIXME: Temporary solution
# https://github.com/AlmaLinux/mirrors/issues/572
WHITELIST_MIRRORS_PER_ARCH_REPO = {
'eastus.azure.repo.almalinux.org': {
'arches': [
'x86_64',
'aarch64',
],
'repos': [
'AppStream',
'BaseOS',
'HighAvailability',
'NFV',
'PowerTools',
'RT',
'ResilientStorage',
'devel',
'extras',
'plus',
]
},
'germanywestcentral.azure.repo.almalinux.org': {
'arches': [
'x86_64',
'aarch64',
],
'repos': [
'AppStream',
'BaseOS',
'HighAvailability',
'NFV',
'PowerTools',
'RT',
'ResilientStorage',
'devel',
'extras',
'plus',
]
},
'southeastasia.azure.repo.almalinux.org': {
'arches': [
'x86_64',
'aarch64',
],
'repos': [
'AppStream',
'BaseOS',
'HighAvailability',
'NFV',
'PowerTools',
'RT',
'ResilientStorage',
'devel',
'extras',
'plus',
]
},
'westus2.azure.repo.almalinux.org': {
'arches': [
'x86_64',
'aarch64',
],
'repos': [
'AppStream',
'BaseOS',
'HighAvailability',
'NFV',
'PowerTools',
'RT',
'ResilientStorage',
'devel',
'extras',
'plus',
]
},
}
NUMBER_OF_PROCESSES_FOR_MIRRORS_CHECK = 15
AIOHTTP_TIMEOUT = 30

Expand Down Expand Up @@ -379,6 +455,9 @@ async def mirror_available(
if version in main_config.duplicated_versions:
continue
for repo_data in main_config.repos:
if mirror_info.name in WHITELIST_MIRRORS_PER_ARCH_REPO and \
repo_data.name not in WHITELIST_MIRRORS_PER_ARCH_REPO[mirror_info.name]['repos']:
continue
if repo_data.vault:
continue
arches = _get_arches_for_version(
Expand All @@ -389,6 +468,9 @@ async def mirror_available(
if repo_versions and version not in repo_versions:
continue
for arch in arches:
if mirror_info.name in WHITELIST_MIRRORS_PER_ARCH_REPO and \
arch not in WHITELIST_MIRRORS_PER_ARCH_REPO[mirror_info.name]['arches']:
continue
if not _is_permitted_arch_for_this_version_and_repo(
version=version,
arch=arch,
Expand Down