Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: Re: [gentoo-user] local mirrors
Date: Fri, 26 Apr 2019 09:06:44
Message-Id: CAGfcS_kGwLA+0_h655Wp6KqtFMgNAns7jo5Tt=PCv12Ves5jfw@mail.gmail.com
In Reply to: Aw: Re: [gentoo-user] local mirrors by n952162@web.de
1 On Fri, Apr 26, 2019 at 1:42 AM <n952162@×××.de> wrote:
2 >
3 > What I'm hoping for, though, is a configuration flag that causes any of:
4 > - inhibits a theoretical traversal of repos.conf databases (e.g. also /usr/share/porrage/...)
5 > - inhibits trying to upgrade beyond what's already installed in the mirror server
6
7 There is no traversal. The repository is only obtained from a single place.
8
9 It is configured in repos.conf. Whatever that is pointed at is where
10 your repository will come from. If you point that at your mirror,
11 then your host will never go out to the internet to update the
12 repository, and the list of available packages will be whatever is on
13 that mirror. This is the way most people using Gentoo in a datacenter
14 do things, for all the reasons you might think.
15
16 This is distinct from the distfiles, which are the actual source code
17 tarballs used to install packages. That is configured in make.conf
18 using the GENTOO_MIRRORS setting. That IS traversed - portage will
19 start at the first URL and work its way down the list until the file
20 is found, and if all are exhausted then it will go to the original
21 upstream source of the file if there is one. I don't think there is
22 any way to get portage to not traverse this entire list, and the
23 SRC_URI in the ebuilds themselves. Though, I'm not sure why you'd
24 want this process to stop if it can't find something unless you're
25 really concerned with bandwidth - the files are all protected by
26 hashes stored in your repository so no matter where the file comes
27 from it won't be used if it isn't the right file.
28
29 So, to sum up, there are two types of mirrors:
30 Repostory mirror, set in repos.conf sync-uri setting
31 Distfiles mirror(s), set in make.conf GENTOO_MIRRORS setting.
32
33 Note also, all distfiles mirrors are checked for all repositories, if
34 you have more than one.
35
36 > >
37 > > Thank you for the explanation. I wonder what the local mirror page means when it talks about saving bandwidth. What *does* it serve if not the distfiles?
38
39 The repository. IMO the bandwidth savings would be minimal unless you
40 had a lot of hosts, compared to mirroring distfiles, which is
41 problematic as you seem to get.
42
43 > And when /etc/portage/repos.conf points to my local server, why would portage disregard that?
44
45 It doesn't. If you point that at your local server, then that is
46 where the repo will come from, always.
47
48 One little caveat - if you change the setting and use git to sync,
49 then you need to either manually update your git repo settings (in
50 .git or using the command line), or delete the repo and let it resync.
51 Otherwise for some operations git's own saved location of the remote
52 uri will still be used. And of course with git your mirror needs to
53 be a fast-forward of whatever it was syncing before if you don't wipe
54 it. If you use rsync to sync then there is nothing to do here, as
55 rsync doesn't have any internal state like this or any concept of
56 history.
57
58 > >
59 > > The rsync server on the mirror host points to the gentoo portage installation on that local mirror host. How can any metadata there know about anything that's not already resolved there?
60
61 It can't. That is why mirroring distfiles is more complex. You need
62 to either mirror everything in the repo, or have some way to tell your
63 mirror host what all its downstream hosts actually need.
64
65 > > At the very least, I suspect that that local mirror page is wrong and rather refers to something that *could* be implemented (without extra packages being installed, just by configuration), but isn't yet.
66
67 Nope, just that there are two types of mirrors, and it tells you how
68 to do the "easy" one. Distfiles are also easy to mirror but only if
69 you're willing to accept partial coverage. Even partial coverage of
70 distfiles will likely save far more bandwidth than the repo mirror,
71 since the system set alone probably takes up a ton of space.
72
73 --
74 Rich