Merge ~cjwatson/launchpad-buildd:lpci-rename into launchpad-buildd:master
- Git
- lp:~cjwatson/launchpad-buildd
- lpci-rename
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 13dec955eb8750dd1a9fa5c4d0d2ca28f2e8e59e |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad-buildd:lpci-rename |
Merge into: | launchpad-buildd:master |
Diff against target: |
262 lines (+31/-34) 3 files modified
debian/changelog (+1/-0) lpbuildd/target/run_ci.py (+13/-15) lpbuildd/target/tests/test_run_ci.py (+17/-19) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ines Almeida | Approve | ||
Review via email: mp+441328@code.launchpad.net |
Commit message
Use lpci rather than lpcraft, following its rename
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index 43148d0..991207d 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -2,6 +2,7 @@ launchpad-buildd (231) UNRELEASED; urgency=medium |
6 | |
7 | * Only ignore .bzr and .git when building source packages from recipes, |
8 | not all the things that "dpkg-buildpackage -I" ignores. |
9 | + * Use lpci rather than lpcraft, following its rename. |
10 | |
11 | -- Colin Watson <cjwatson@ubuntu.com> Mon, 27 Mar 2023 17:56:08 +0100 |
12 | |
13 | diff --git a/lpbuildd/target/run_ci.py b/lpbuildd/target/run_ci.py |
14 | index 21b8640..54aca19 100644 |
15 | --- a/lpbuildd/target/run_ci.py |
16 | +++ b/lpbuildd/target/run_ci.py |
17 | @@ -66,11 +66,11 @@ class RunCIPrepare( |
18 | if self.backend.supports_snapd: |
19 | self.snap_store_set_proxy() |
20 | for snap_name, channel in sorted(self.args.channels.items()): |
21 | - if snap_name not in ("lxd", "lpcraft"): |
22 | + if snap_name not in ("lxd", "lpci"): |
23 | self.backend.run( |
24 | ["snap", "install", "--channel=%s" % channel, snap_name] |
25 | ) |
26 | - for snap_name, classic in (("lxd", False), ("lpcraft", True)): |
27 | + for snap_name, classic in (("lxd", False), ("lpci", True)): |
28 | cmd = ["snap", "install"] |
29 | if classic: |
30 | cmd.append("--classic") |
31 | @@ -167,7 +167,7 @@ class RunCI(BuilderProxyOperationMixin, Operation): |
32 | ) |
33 | |
34 | def run_build_command(self, args, **kwargs): |
35 | - # Run build commands as the `buildd` user, since `lpcraft` can only |
36 | + # Run build commands as the `buildd` user, since `lpci` can only |
37 | # start containers with `nvidia.runtime=true` if it's run as a |
38 | # non-root user. |
39 | super().run_build_command( |
40 | @@ -182,14 +182,14 @@ class RunCI(BuilderProxyOperationMixin, Operation): |
41 | job_id = f"{self.args.job_name}:{self.args.job_index}" |
42 | logger.info("Running %s" % job_id) |
43 | output_path = os.path.join("/build", "output") |
44 | - # This matches the per-job output path used by lpcraft. |
45 | + # This matches the per-job output path used by lpci. |
46 | job_output_path = os.path.join( |
47 | output_path, self.args.job_name, str(self.args.job_index) |
48 | ) |
49 | self.backend.run(["mkdir", "-p", job_output_path]) |
50 | self.backend.run(["chown", "-R", "buildd:buildd", output_path]) |
51 | - lpcraft_args = [ |
52 | - "lpcraft", |
53 | + lpci_args = [ |
54 | + "lpci", |
55 | "-v", |
56 | "run-one", |
57 | "--output-directory", |
58 | @@ -198,30 +198,28 @@ class RunCI(BuilderProxyOperationMixin, Operation): |
59 | str(self.args.job_index), |
60 | ] |
61 | for repository in self.args.package_repositories: |
62 | - lpcraft_args.extend(["--package-repository", repository]) |
63 | + lpci_args.extend(["--package-repository", repository]) |
64 | |
65 | environment_variables = dict( |
66 | pair.split("=", maxsplit=1) |
67 | for pair in self.args.environment_variables |
68 | ) |
69 | for key, value in environment_variables.items(): |
70 | - lpcraft_args.extend(["--set-env", f"{key}={value}"]) |
71 | + lpci_args.extend(["--set-env", f"{key}={value}"]) |
72 | |
73 | plugin_settings = dict( |
74 | pair.split("=", maxsplit=1) for pair in self.args.plugin_settings |
75 | ) |
76 | for key, value in plugin_settings.items(): |
77 | - lpcraft_args.extend(["--plugin-setting", f"{key}={value}"]) |
78 | + lpci_args.extend(["--plugin-setting", f"{key}={value}"]) |
79 | |
80 | if self.args.secrets: |
81 | - lpcraft_args.extend(["--secrets", self.args.secrets]) |
82 | + lpci_args.extend(["--secrets", self.args.secrets]) |
83 | |
84 | if "gpu-nvidia" in self.backend.constraints: |
85 | - lpcraft_args.append("--gpu-nvidia") |
86 | + lpci_args.append("--gpu-nvidia") |
87 | |
88 | - escaped_lpcraft_args = " ".join( |
89 | - shell_escape(arg) for arg in lpcraft_args |
90 | - ) |
91 | + escaped_lpci_args = " ".join(shell_escape(arg) for arg in lpci_args) |
92 | tee_args = ["tee", os.path.join(job_output_path, "log")] |
93 | escaped_tee_args = " ".join(shell_escape(arg) for arg in tee_args) |
94 | args = [ |
95 | @@ -229,7 +227,7 @@ class RunCI(BuilderProxyOperationMixin, Operation): |
96 | "-o", |
97 | "pipefail", |
98 | "-c", |
99 | - f"{escaped_lpcraft_args} 2>&1 | {escaped_tee_args}", |
100 | + f"{escaped_lpci_args} 2>&1 | {escaped_tee_args}", |
101 | ] |
102 | self.run_build_command(args, env=env) |
103 | |
104 | diff --git a/lpbuildd/target/tests/test_run_ci.py b/lpbuildd/target/tests/test_run_ci.py |
105 | index bf61e99..4f42382 100644 |
106 | --- a/lpbuildd/target/tests/test_run_ci.py |
107 | +++ b/lpbuildd/target/tests/test_run_ci.py |
108 | @@ -57,7 +57,7 @@ class TestRunCIPrepare(TestCase): |
109 | [ |
110 | RanAptGet("install", "git"), |
111 | RanSnap("install", "lxd"), |
112 | - RanSnap("install", "--classic", "lpcraft"), |
113 | + RanSnap("install", "--classic", "lpci"), |
114 | RanCommand(["lxd", "init", "--auto"]), |
115 | ] |
116 | ), |
117 | @@ -104,7 +104,7 @@ class TestRunCIPrepare(TestCase): |
118 | RanSnap("ack", "/dev/stdin", input_text=store_assertion), |
119 | RanSnap("set", "core", "proxy.store=store-id"), |
120 | RanSnap("install", "lxd"), |
121 | - RanSnap("install", "--classic", "lpcraft"), |
122 | + RanSnap("install", "--classic", "lpci"), |
123 | RanCommand(["lxd", "init", "--auto"]), |
124 | ] |
125 | ), |
126 | @@ -136,7 +136,7 @@ class TestRunCIPrepare(TestCase): |
127 | [ |
128 | RanAptGet("install", "python3", "socat", "git"), |
129 | RanSnap("install", "lxd"), |
130 | - RanSnap("install", "--classic", "lpcraft"), |
131 | + RanSnap("install", "--classic", "lpci"), |
132 | RanCommand(["lxd", "init", "--auto"]), |
133 | ] |
134 | ), |
135 | @@ -158,7 +158,7 @@ class TestRunCIPrepare(TestCase): |
136 | "--channel=core=candidate", |
137 | "--channel=core20=beta", |
138 | "--channel=lxd=beta", |
139 | - "--channel=lpcraft=edge", |
140 | + "--channel=lpci=edge", |
141 | "--git-repository", |
142 | "lp:foo", |
143 | ] |
144 | @@ -172,9 +172,7 @@ class TestRunCIPrepare(TestCase): |
145 | RanSnap("install", "--channel=candidate", "core"), |
146 | RanSnap("install", "--channel=beta", "core20"), |
147 | RanSnap("install", "--channel=beta", "lxd"), |
148 | - RanSnap( |
149 | - "install", "--classic", "--channel=edge", "lpcraft" |
150 | - ), |
151 | + RanSnap("install", "--classic", "--channel=edge", "lpci"), |
152 | RanCommand(["lxd", "init", "--auto"]), |
153 | ] |
154 | ), |
155 | @@ -199,7 +197,7 @@ class TestRunCIPrepare(TestCase): |
156 | [ |
157 | RanAptGet("install", "git", "clamav"), |
158 | RanSnap("install", "lxd"), |
159 | - RanSnap("install", "--classic", "lpcraft"), |
160 | + RanSnap("install", "--classic", "lpci"), |
161 | RanCommand(["lxd", "init", "--auto"]), |
162 | RanCommand(["freshclam", "--quiet"]), |
163 | ] |
164 | @@ -239,7 +237,7 @@ class TestRunCIPrepare(TestCase): |
165 | [ |
166 | RanAptGet("install", "python3", "socat", "git", "clamav"), |
167 | RanSnap("install", "lxd"), |
168 | - RanSnap("install", "--classic", "lpcraft"), |
169 | + RanSnap("install", "--classic", "lpci"), |
170 | RanCommand(["lxd", "init", "--auto"]), |
171 | RanCommand(["freshclam", "--quiet"], **env), |
172 | ] |
173 | @@ -270,7 +268,7 @@ class TestRunCIPrepare(TestCase): |
174 | [ |
175 | RanAptGet("install", "git", "clamav"), |
176 | RanSnap("install", "lxd"), |
177 | - RanSnap("install", "--classic", "lpcraft"), |
178 | + RanSnap("install", "--classic", "lpci"), |
179 | RanCommand(["lxd", "init", "--auto"]), |
180 | RanCommand(["freshclam", "--quiet"]), |
181 | ] |
182 | @@ -520,7 +518,7 @@ class TestRunCIPrepare(TestCase): |
183 | self.assertThat( |
184 | run_ci_prepare.backend.run.calls, |
185 | MatchesAll( |
186 | - AnyMatch(RanSnap("install", "--classic", "lpcraft")), |
187 | + AnyMatch(RanSnap("install", "--classic", "lpci")), |
188 | AnyMatch( |
189 | RanBuildCommand( |
190 | ["git", "clone", "-n", "lp:foo", "tree"], cwd="/build" |
191 | @@ -607,7 +605,7 @@ class TestRunCI(TestCase): |
192 | "-o", |
193 | "pipefail", |
194 | "-c", |
195 | - "lpcraft -v run-one --output-directory /build/output test 0 2>&1 " # noqa: E501 |
196 | + "lpci -v run-one --output-directory /build/output test 0 2>&1 " # noqa: E501 |
197 | "| tee /build/output/test/0/log", |
198 | ], |
199 | cwd="/build/tree", |
200 | @@ -658,7 +656,7 @@ class TestRunCI(TestCase): |
201 | "-o", |
202 | "pipefail", |
203 | "-c", |
204 | - "lpcraft -v run-one --output-directory /build/output test 0 2>&1 " # noqa: E501 |
205 | + "lpci -v run-one --output-directory /build/output test 0 2>&1 " # noqa: E501 |
206 | "| tee /build/output/test/0/log", |
207 | ], |
208 | cwd="/build/tree", |
209 | @@ -706,7 +704,7 @@ class TestRunCI(TestCase): |
210 | "-o", |
211 | "pipefail", |
212 | "-c", |
213 | - "lpcraft -v run-one --output-directory " |
214 | + "lpci -v run-one --output-directory " |
215 | "/build/output test 0 " |
216 | "--set-env PIP_INDEX_URL=http://example " |
217 | "--set-env SOME_PATH=/etc/some_path " |
218 | @@ -757,7 +755,7 @@ class TestRunCI(TestCase): |
219 | "-o", |
220 | "pipefail", |
221 | "-c", |
222 | - "lpcraft -v run-one --output-directory " |
223 | + "lpci -v run-one --output-directory " |
224 | "/build/output test 0 " |
225 | "--package-repository 'deb http://archive.ubuntu.com/ubuntu/ focal main restricted' " # noqa: E501 |
226 | "--package-repository 'deb http://archive.ubuntu.com/ubuntu/ focal universe' " # noqa: E501 |
227 | @@ -806,7 +804,7 @@ class TestRunCI(TestCase): |
228 | "-o", |
229 | "pipefail", |
230 | "-c", |
231 | - "lpcraft -v run-one --output-directory " |
232 | + "lpci -v run-one --output-directory " |
233 | "/build/output test 0 " |
234 | "--plugin-setting " |
235 | "miniconda_conda_channel=https://user:pass@canonical.example.com/artifactory/soss-conda-stable-local/ " # noqa: E501 |
236 | @@ -855,7 +853,7 @@ class TestRunCI(TestCase): |
237 | "-o", |
238 | "pipefail", |
239 | "-c", |
240 | - "lpcraft -v run-one --output-directory " |
241 | + "lpci -v run-one --output-directory " |
242 | "/build/output test 0 " |
243 | "--secrets /build/.launchpad-secrets.yaml " |
244 | "2>&1 " |
245 | @@ -902,7 +900,7 @@ class TestRunCI(TestCase): |
246 | "-o", |
247 | "pipefail", |
248 | "-c", |
249 | - "lpcraft -v run-one --output-directory " |
250 | + "lpci -v run-one --output-directory " |
251 | "/build/output test 0 " |
252 | "2>&1 " |
253 | "| tee /build/output/test/0/log", |
254 | @@ -986,7 +984,7 @@ class TestRunCI(TestCase): |
255 | "-o", |
256 | "pipefail", |
257 | "-c", |
258 | - "lpcraft -v run-one --output-directory " |
259 | + "lpci -v run-one --output-directory " |
260 | "/build/output test 0 " |
261 | "--gpu-nvidia " |
262 | "2>&1 " |
LGTM!