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

Add predownload plugin #581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrii-suse
Copy link
Contributor

Purpose:

  • get faster downloads utilizing concurrent downloads with sypplite utility
  • let others experiment with custom implementation of download (e.g. to deal with their specific limitations)

Implementation algorithm:

  • check if any plugin present;
  • create list of Transaction Steps which require download;
  • for each repository involved in future downloads: send to plugin a string where first word is baseurl and the tail is list of files required for download from that repo. (command PREDOWNLOAD_FROM_REPO);
  • if any of plugins is still present: pick the first one and ask him to do actual download (command PREDOWNLOAD_START);
  • check plugin for progress every second (command PLUGIN_PROGRESS);
  • All packages are expected to be in the cache with a suffix ".unverified" now;
  • The fetcher code now is aware of ".unverified" suffix and tries to look up and verify such files;

Implementation details:

  • a new method progress() was added to PluginScript, which defines how plugins will report progress;
  • the current implementation of the plugin sypplite.sh will create request files for sypplite utility in /var/cache/zypp/packages/ .

Testing with prebuilt libzypp (Tumbleweed only so far):

zypper ar -f http://download.opensuse.org/repositories/home:andriinikitin:sypper/openSUSE_Tumbleweed home:andriinikitin:sypper
zypper --gpg-auto-import-keys  ref
zypper -n in --from home:andriinikitin:sypper sypplite libzypp
cp /usr/share/sypper/predownload/sypplite.sh /usr/lib/zypp/plugins/predownload/

Current experimented results for performance gain on 200 - 3000 packages is 40% - 200%

@lkocman
Copy link

lkocman commented Oct 7, 2024

40% is super impressive!

@lkocman
Copy link

lkocman commented Oct 7, 2024

I'm not sure what's the teams capacity, but using a plugin and over the time merge functionality into the base libs could be a good short term solution. This woud allow us to aim at 16.0 Beta and similar.

rhabacker added a commit to rhabacker/libzypp that referenced this pull request Dec 17, 2024
Nowadays, network bandwidth is no longer so much of an issue,
so changing the default setting can save memory and CPU time
when downloading.

See openSUSE#581
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.

2 participants