Merge lp:~blr/launchpad-buildd/snap_http_proxy into lp:launchpad-buildd
| Status: | Merged |
|---|---|
| Merged at revision: | 190 |
| Proposed branch: | lp:~blr/launchpad-buildd/snap_http_proxy |
| Merge into: | lp:launchpad-buildd |
| Diff against target: |
207 lines (+73/-11) 4 files modified
buildsnap (+54/-6) lpbuildd/slave.py (+8/-4) lpbuildd/snap.py (+10/-0) lpbuildd/tests/test_snap.py (+1/-1) |
| To merge this branch: | bzr merge lp:~blr/launchpad-buildd/snap_http_proxy |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Colin Watson | 2015-10-04 | Approve on 2016-02-04 | |
| William Grant | 2016-02-01 | Pending | |
|
Review via email:
|
|||
Commit Message
Add http_proxy to buildsnap args.
Description of the Change
Add http_proxy environment variable to buildsnap args, providing time limited external access. This branch also factors out buildsnap into distinct repo, pull, build and token revocation phases.
- 175. By Kit Randel on 2015-10-04
-
Add http_proxy to buildsnap args.
| Kit Randel (blr) wrote : | # |
Thanks Colin, I'll catch up with Martin and make those changes.
On Mon, Oct 5, 2015 at 11:50 AM Colin Watson <email address hidden> wrote:
> Review: Approve
>
> It sounds like the direction we're going is indeed going to be to provide
> external access for the whole duration of the build, but could you please
> get in touch with Martin Albisetti to confirm that that's definitely what
> we have to do rather than separating out the pull phase and providing
> external access only to that as we'd previously intended?
>
> Diff comments:
>
> > === modified file 'lpbuildd/snap.py'
> > --- lpbuildd/snap.py 2015-07-31 11:54:07 +0000
> > +++ lpbuildd/snap.py 2015-10-04 22:12:07 +0000
> > @@ -52,6 +56,15 @@
> > "--build-id", self._buildid,
> > "--arch", self.arch_tag,
> > ]
> > + if self.proxy_token:
>
> Maybe worth checking here that all the necessary arguments were passed,
> just in case.
>
> > + proxy_env = (
> > + "http_proxy=http://{username}
> > + "@{host}
> > + username=
> > + password=
> > + host=self.
> > + port=self.
> > + args.insert(0, proxy_env)
>
> Rather than relying on shell parsing of environment variable prefixes to
> the command, could you please instead add an env=None keyword argument to
> runSubProcess, defaulting to os.environ if None, so that you can then do
> something like:
>
> env = dict(os.environ)
> if condition:
> env["http_proxy"] = blah
> ...
> self.runSubProc
>
> > if self.branch is not None:
> > args.extend(
> > if self.git_repository is not None:
>
>
> --
>
> https:/
> You are the owner of lp:~blr/launchpad-buildd/snap_http_proxy.
>
| William Grant (wgrant) wrote : | # |
Rather than encoding in launchpad-buildd the knowledge that the username is the build cookie, I think it would make more sense for buildd-manager to simply pass in the full URL.
- 176. By Kit Randel on 2015-10-05
-
* Pass env to runSubProcess.
* Expect proxy_url in build extra_args, rather than proxy_username, proxy_password, proxy_host and proxy_port. - 177. By Kit Randel on 2015-10-05
-
* Add env (os.environ) kwarg to runSubProcess.
* Fix broken os.environ set.
* Fix associated snap test. - 178. By Kit Randel on 2015-10-08
-
* Pass proxy_url as argument to snapcraft script.
* Add pull phase to snapcraft builder. - 179. By Kit Randel on 2016-01-24
-
Merge devel.
- 180. By Kit Randel on 2016-01-28
-
Correct buildsnap proxy-url option.
- 181. By Kit Randel on 2016-01-29
-
Move repo collect into distinct phase.
- 182. By Kit Randel on 2016-01-29
-
Add doctring for repo.
- 183. By Kit Randel on 2016-01-29
-
Add debugging.
- 184. By Kit Randel on 2016-02-01
-
Add token revocation.
- 185. By Kit Randel on 2016-02-01
-
Reset ssl_verify.
- 186. By Kit Randel on 2016-02-01
-
Remove debugging.
- 187. By Kit Randel on 2016-02-02
-
Move revoke_token to finally block.
| Colin Watson (cjwatson) wrote : | # |
The auth token logging issue mentioned in comments must be fixed, but aside from that it's just minor adjustments and is fine to land. Thanks.
- 188. By Kit Randel on 2016-02-03
-
Remove debugging print statement.
- 189. By Kit Randel on 2016-02-04
-
Sanitize proxy url in snap build logs.
- 190. By Kit Randel on 2016-02-04
-
Set https_proxy envvar.
- 191. By Kit Randel on 2016-02-05
-
Ensure token revocation is conditioned on presense of key in extra_args.

It sounds like the direction we're going is indeed going to be to provide external access for the whole duration of the build, but could you please get in touch with Martin Albisetti to confirm that that's definitely what we have to do rather than separating out the pull phase and providing external access only to that as we'd previously intended?