Gentoo Archives: gentoo-portage-dev

From: Sergei Trofimovich <slyfox@g.o>
To: Zac Medico <zmedico@g.o>
Cc: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] repoman: add --include-profiles=PROFILES
Date: Tue, 19 Nov 2019 07:41:25
Message-Id: 20191119074119.5213b237@sf
In Reply to: Re: [gentoo-portage-dev] [PATCH] repoman: add --include-profiles=PROFILES by Zac Medico
1 On Mon, 18 Nov 2019 16:45:58 -0800
2 Zac Medico <zmedico@g.o> wrote:
3
4 > On 11/18/19 4:21 PM, Sergei Trofimovich wrote:
5 > > repoman slows down ~linearly with amount of profiles being scanned.
6 > > In case of amd64 we have 28 stable profiles.
7 > >
8 > > To speed up processing and fit into time budged of various CIs we can
9 > > split the work across different processes that handle different profiles.
10 > >
11 > > Example benchmark on ::haskell overlay:
12 > > $ ./repoman full --include-arches=amd64
13 > > ~65 minutes
14 > > $ ./repoman full --include-profiles=default/linux/amd64/17.0
15 > > ~4 minutes
16 > > This allows for a crude sharding of work across processes and allows for
17 > > cheap tree-wide scans for early failures.
18 > >
19 > > Bug: https://bugs.gentoo.org/700456
20 > > Signed-off-by: Sergei Trofimovich <slyfox@g.o>
21 > > ---
22 > > repoman/lib/repoman/actions.py | 4 ++++
23 > > repoman/lib/repoman/argparser.py | 7 +++++++
24 > > repoman/lib/repoman/modules/scan/depend/__init__.py | 3 ++-
25 > > repoman/lib/repoman/modules/scan/depend/profile.py | 9 +++++++--
26 > > repoman/lib/repoman/scanner.py | 5 +++++
27 > > repoman/man/repoman.1 | 4 ++++
28 > > 6 files changed, 29 insertions(+), 3 deletions(-)
29 > >
30 > > diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
31 > > index 1c9989a72..92d4d4e94 100644
32 > > --- a/repoman/lib/repoman/actions.py
33 > > +++ b/repoman/lib/repoman/actions.py
34 > > @@ -412,6 +412,10 @@ the whole commit message to abort.
35 > > report_options.append(
36 > > "--include-arches=\"%s\"" %
37 > > " ".join(sorted(self.scanner.include_arches)))
38 > > + if self.scanner.include_profiles is not None:
39 > > + report_options.append(
40 > > + "--include-profiles=\"%s\"" %
41 > > + " ".join(sorted(self.scanner.include_profiles)))
42 > >
43 > > if portage_version is None:
44 > > sys.stderr.write("Failed to insert portage version in message!\n")
45 > > diff --git a/repoman/lib/repoman/argparser.py b/repoman/lib/repoman/argparser.py
46 > > index fa0e6ff90..670a0e91d 100644
47 > > --- a/repoman/lib/repoman/argparser.py
48 > > +++ b/repoman/lib/repoman/argparser.py
49 > > @@ -164,6 +164,13 @@ def parse_args(argv, repoman_default_opts):
50 > > 'A space separated list of arches used to '
51 > > 'filter the selection of profiles for dependency checks'))
52 > >
53 > > + parser.add_argument(
54 > > + '--include-profiles',
55 > > + dest='include_profiles', metavar='PROFILES', action='append',
56 > > + help=(
57 > > + 'A space separated list of profiles used to '
58 > > + 'define the selection of profiles for dependency checks'))
59 > > +
60 > > parser.add_argument(
61 > > '-d', '--include-dev', dest='include_dev', action='store_true',
62 > > default=False,
63 > > diff --git a/repoman/lib/repoman/modules/scan/depend/__init__.py b/repoman/lib/repoman/modules/scan/depend/__init__.py
64 > > index c3cc0ddeb..9068760bb 100644
65 > > --- a/repoman/lib/repoman/modules/scan/depend/__init__.py
66 > > +++ b/repoman/lib/repoman/modules/scan/depend/__init__.py
67 > > @@ -19,7 +19,8 @@ module_spec = {
68 > > 'func_desc': {
69 > > },
70 > > 'mod_kwargs': ['qatracker', 'portdb', 'profiles', 'options',
71 > > - 'repo_metadata', 'repo_settings', 'include_arches', 'caches',
72 > > + 'repo_metadata', 'repo_settings', 'include_arches',
73 > > + 'include_profiles', 'caches',
74 > > 'repoman_incrementals', 'env', 'have', 'dev_keywords'
75 > > ],
76 > > 'func_kwargs': {
77 > > diff --git a/repoman/lib/repoman/modules/scan/depend/profile.py b/repoman/lib/repoman/modules/scan/depend/profile.py
78 > > index d980f4eca..0b1d74483 100644
79 > > --- a/repoman/lib/repoman/modules/scan/depend/profile.py
80 > > +++ b/repoman/lib/repoman/modules/scan/depend/profile.py
81 > > @@ -33,6 +33,7 @@ class ProfileDependsChecks(ScanBase):
82 > > @param options: cli options
83 > > @param repo_settings: repository settings instance
84 > > @param include_arches: set
85 > > + @param include_profiles: set
86 > > @param caches: dictionary of our caches
87 > > @param repoman_incrementals: tuple
88 > > @param env: the environment
89 > > @@ -46,6 +47,7 @@ class ProfileDependsChecks(ScanBase):
90 > > self.options = kwargs.get('options')
91 > > self.repo_settings = kwargs.get('repo_settings')
92 > > self.include_arches = kwargs.get('include_arches')
93 > > + self.include_profiles = kwargs.get('include_profiles')
94 > > self.caches = kwargs.get('caches')
95 > > self.repoman_incrementals = kwargs.get('repoman_incrementals')
96 > > self.env = kwargs.get('env')
97 > > @@ -81,8 +83,11 @@ class ProfileDependsChecks(ScanBase):
98 > > if arch not in self.include_arches:
99 > > continue
100 > >
101 > > - relevant_profiles.extend(
102 > > - (keyword, groups, prof) for prof in self.profiles[arch])
103 > > + for prof in self.profiles[arch]:
104 > > + if self.include_profiles is not None:
105 > > + if prof not in self.include_profiles:
106 > > + continue
107 > > + relevant_profiles.append((keyword, groups, prof))
108 > >
109 > > relevant_profiles.sort(key=sort_key)
110 > >
111 > > diff --git a/repoman/lib/repoman/scanner.py b/repoman/lib/repoman/scanner.py
112 > > index 1b3242a51..06234b0ad 100644
113 > > --- a/repoman/lib/repoman/scanner.py
114 > > +++ b/repoman/lib/repoman/scanner.py
115 > > @@ -164,6 +164,10 @@ class Scanner(object):
116 > > if self.options.include_arches:
117 > > self.include_arches = set()
118 > > self.include_arches.update(*[x.split() for x in self.options.include_arches])
119 > > + self.include_profiles = None
120 > > + if self.options.include_profiles:
121 > > + self.include_profiles = set()
122 > > + self.include_profiles.update(*[x.split() for x in self.options.include_profiles])
123 > >
124 > > # Disable the "self.modules['Ebuild'].notadded" check when not in commit mode and
125 > > # running `svn status` in every package dir will be too expensive.
126 > > @@ -190,6 +194,7 @@ class Scanner(object):
127 > > "repo_metadata": self.repo_metadata,
128 > > "profiles": profiles,
129 > > "include_arches": self.include_arches,
130 > > + "include_profiles": self.include_profiles,
131 > > "caches": self.caches,
132 > > "repoman_incrementals": self.repoman_incrementals,
133 > > "env": self.env,
134 > > diff --git a/repoman/man/repoman.1 b/repoman/man/repoman.1
135 > > index 766146f57..f33fb6098 100644
136 > > --- a/repoman/man/repoman.1
137 > > +++ b/repoman/man/repoman.1
138 > > @@ -120,6 +120,10 @@ Ignore masked packages (not allowed with commit mode)
139 > > A space separated list of arches used to filter the selection of
140 > > profiles for dependency checks.
141 > > .TP
142 > > +.BR "\-\-include\-profiles " PROFILES
143 > > +A space separated list of profiles used to
144 > > +define the selection of profiles for dependency checks.
145 > > +.TP
146 > > \fB\-d\fR, \fB\-\-include\-dev\fR
147 > > Include dev profiles in dependency checks.
148 > > .TP
149 > >
150 >
151 > Looks good. Please merge.
152 > --
153 > Thanks,
154 > Zac
155 >
156
157 Thank you!
158
159 Does not look like I have permissions to do it:
160
161 """
162 $ cat .git/config
163 [core]
164 repositoryformatversion = 0
165 filemode = true
166 bare = false
167 logallrefupdates = true
168 [remote "origin"]
169 url = git+ssh://git@××××××××××.org/proj/portage.git
170 fetch = +refs/heads/*:refs/remotes/origin/*
171 [branch "master"]
172 remote = origin
173 merge = refs/heads/master
174 $ LANG=C git push origin master
175
176 FATAL -- ACCESS DENIED
177 Repo proj/portage
178 User slyfox@g.o
179 Stage Before git was called
180 Operation Repo write
181
182 FATAL: W any proj/portage slyfox@g.o DENIED by fallthru
183 (or you mis-spelled the reponame)
184 fatal: Could not read from remote repository.
185
186 Please make sure you have the correct access rights
187 and the repository exists.
188 """
189
190 --
191
192 Sergei

Replies