🏃 Enable fastestmirror in dnf-json
The time it takes to depsolve a blueprint varies widely depending on where the job is running and which mirrors are randomly chosen based on the data returned in the metalink XML. Use dnf's fastestmirror plugin to choose the fastest mirror for downloading metadata. This returns consistent results in PSI + AWS and every depsolve completed in under 60 seconds after 25 tests in each cloud. Fixes #845. Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
parent
d02e77de06
commit
acf91a4e54
1 changed files with 12 additions and 0 deletions
12
dnf-json
12
dnf-json
|
|
@ -52,6 +52,18 @@ def dnfrepo(desc, parent_conf=None):
|
|||
|
||||
def create_base(repos, module_platform_id, persistdir, cachedir, arch):
|
||||
base = dnf.Base()
|
||||
|
||||
# Enable fastestmirror to ensure we choose the fastest mirrors for
|
||||
# downloading metadata (when depsolving) and downloading packages.
|
||||
base.conf.fastestmirror = True
|
||||
|
||||
# Initialize all plugins (including fastestmirror).
|
||||
base.init_plugins()
|
||||
|
||||
# Try another mirror if it takes longer than 5 seconds to connect.
|
||||
base.conf.timeout = 5
|
||||
|
||||
# Set the rest of the dnf configuration.
|
||||
base.conf.module_platform_id = module_platform_id
|
||||
base.conf.config_file_path = "/dev/null"
|
||||
base.conf.persistdir = persistdir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue