#1398 kojid: Download only 'origin'
Merged 4 years ago by mikem. Opened 5 years ago by ignatenkobrain.
ignatenkobrain/koji origin-librepo  into  master

file modified
+3
@@ -739,6 +739,9 @@ 

              h.setopt(librepo.LRO_REPOTYPE, librepo.LR_YUMREPO)

              h.setopt(librepo.LRO_URLS, [repo_url])

              h.setopt(librepo.LRO_DESTDIR, tmpdir)

+             # We are using this just to find out location of 'origin',

+             # we don't even need to download it since we use openRemoteFile

+             h.setopt(librepo.LRO_YUMDLIST, [])

              h.perform(r)

              pkgorigins = r.getinfo(librepo.LRR_YUM_REPOMD)['origin']['location_href']

              koji.util.rmtree(tmpdir)

We have pretty slow connection from s390x koji which helped to uncover
this part. Kojid downloads all files from repomd.xml (incl. filelists)
which is really big. What we really want is just 'origin' (used by Koji
only).

Signed-off-by: Igor Gnatenko ignatenkobrain@fedoraproject.org

FTR, I didn't test it since I don't really have place to do so :)

Testing this with some librepo code (outside of koji), patch should be correct. In Fedora it should save around 140M per architecture when repo changes.

            pkgorigins = r.getinfo(librepo.LRR_YUM_REPOMD)['origin']['location_href']                         
            koji.util.rmtree(tmpdir)                                                                          

        relpath = os.path.join(repodir, self.br_arch, pkgorigins)                                             
        with koji.openRemoteFile(relpath, **opts) as fo:                                                      

This looks weird... Did anybody test this part of code ever?

rebased onto 1561150c9cbb6cd913f5cd92c4f9fe36763f0239

5 years ago

Ok, I found out why it works... I have updated patch to be even more effective.

rebased onto a66b4dd

5 years ago

Nice one, I've created #1399 for reference.

:thumbsup:

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

5 years ago

@tkopecek, what is preventing this from being merged?

@mikem is doing the merges. Can you review/merge it, please?

Commit 5d26852 fixes this pull-request

Pull-Request has been merged by mikem

4 years ago