Skip to content

Commit

Permalink
Issues #562,#561,#560:
Browse files Browse the repository at this point in the history
- No source of entropy in _get_nearest_mirrors_by_network_data()
- _get_nearest_mirrors_by_network_data() fails to exclude near-by private mirrors for extra options.
- Exclude the private mirrors from the mirrors list in the case of fallback behavior

- The Azure mirrors have allowed list of arches
- Decrease level of logging messages in some cases
- Cache subnets of Azure/AWS cloud
  • Loading branch information
soksanichenko committed Jul 1, 2022
1 parent 1f9f85f commit 3a17b0f
Showing 1 changed file with 78 additions and 19 deletions.
97 changes: 78 additions & 19 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,79 @@
WHITELIST_MIRRORS = (
'repo.almalinux.org',
)
WHITELIST_MIRRORS_PER_ARCH = {
'eastus.azure.repo.almalinux.org': [
'x86_64',
'aarch64',
],
'germanywestcentral.azure.repo.almalinux.org': [
'x86_64',
'aarch64',
],
'southeastasia.azure.repo.almalinux.org': [
'x86_64',
'aarch64',
],
'westus2.azure.repo.almalinux.org': [
'x86_64',
'aarch64',
],
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 @@ -397,6 +453,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 @@ -407,8 +466,8 @@ 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 and \
arch not in WHITELIST_MIRRORS_PER_ARCH[mirror_info.name]:
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,
Expand Down

0 comments on commit 3a17b0f

Please sign in to comment.