Skip to content

Conversation

laanwj
Copy link
Member

@laanwj laanwj commented Nov 19, 2015

These are changes I needed to get gitian building to work with a fresh Debian 8.2 VM, which is the version we tell to use.

  • Set up NAT and forwarding, so that LXC container can access network beyond host
  • Remove explicit cgroup setup - these are mounted automatically now

Also needed a change to gitian: devrandom/gitian-builder#105
[skip ci]

@fanquake
Copy link
Member

utACK

@laanwj
Copy link
Member Author

laanwj commented Nov 19, 2015

It also looks like we now need ca-certificates and python as dependencies in the descriptors for LXC gitian builds. Apparently for KVM they are added to the base image, but not for LXC.

@laanwj
Copy link
Member Author

laanwj commented Nov 19, 2015

Can you also give this a try @theuni? Want to make sure that I'm not crazy (or somehow have a subtly different environment) that I need these changes.

@laanwj laanwj changed the title doc: Make networking work inside builder in gitian-building.md doc: Make networking work inside LXC builder in gitian-building.md Nov 19, 2015
@theuni
Copy link
Member

theuni commented Nov 19, 2015

@laanwj I can't try until tomorrow, but I believe i've ended up doing similar things to get it somewhat working in the past. I never got it reproducibly working 100% though, so if this does the trick, that's great!

@laanwj
Copy link
Member Author

laanwj commented Nov 20, 2015

There were three major issues in my case:

  • LXC container couldn't reach the internet (solved by setting up masquerading/forwarding, as well as the gitian change to set 'auto' gateway)
  • TLS certificates couldn't be verified (solved by adding ca-certificates package)
  • Python missing error (I think during MacOsX build, adding python package)

We need gitian-building instructions that work. If this too doesn't solve it reproducibly, then switching the VM image to Ubuntu may be the best plan (though it's nice if Gitian works from Debian as well). I'm not actually sure that these problems don't exist with an Ubuntu VM.

@laanwj laanwj changed the title doc: Make networking work inside LXC builder in gitian-building.md build: Make networking work inside LXC builder in gitian-building.md Nov 20, 2015
@maflcko
Copy link
Member

maflcko commented Nov 20, 2015

switching the VM image to Ubuntu

Ideally this should work on any linux with the right hardware?

@laanwj
Copy link
Member Author

laanwj commented Nov 24, 2015

Ideally this should work on any linux with the right hardware?

For gitian itself you're right.

Though with all the possible things that may be different between setups, a single "follow these steps" plan cannot work on any linux. To make sure it is actually tested and reproducible (which even now is lacking!) I'm just targeting one distro with this guide.
(same answer to questions like "why not KVM" etc - this is not meant to be a comprehensive book on all the capabilities of gitian, just one tested way to get from a VM to built executables)

@TheBlueMatt
Copy link
Contributor

We really need to be going the opposite direction here. gitian build environments should be banned from accessing the network at all, both because they shouldn't need it and its good hygene to not allow it and because we really should be supporting building on airgapped machines and always denying network access is a good way to ensure we continue to do that.

@laanwj
Copy link
Member Author

laanwj commented Nov 26, 2015

My goal was just to get the guide working as it is specified now.
I agree with you long term @TheBlueMatt but right now, having a broken guide is more harmful than one that isn't perfect.

Feel free to write it as you think is better.

But if it isn't fixed before 0.12, I'd rather just remove it than leave it in a broken state. I mean, people follow these steps exactly and it doesn't work, can you think of anything more frustrating?

@maflcko
Copy link
Member

maflcko commented Nov 26, 2015

Agree with @laanwj

just remove it than leave it in a broken state

Or mark it [outdated]?

@TheBlueMatt
Copy link
Contributor

Is it no longer possible to build without network access? If so, can we just change the documentation to disallow network access instead of allow it? If not, when did we merge something with such a huge regression? Would it be easy to fix?

@laanwj
Copy link
Member Author

laanwj commented Nov 27, 2015

Or mark it [outdated]?

If someone wants to resurrect it it's in git history.

Is it no longer possible to build without network access?

It is possible, to be precise it's even mentioned in the guide in a separate section: https://github.com/bitcoin/bitcoin/blob/master/doc/gitian-building.md#building-fully-offline

However it requires extra steps, building with network access in the container is easier.

@laanwj
Copy link
Member Author

laanwj commented Dec 1, 2015

@theuni Can you go through this one time to test it please? Would be nice to have this up-to-date before we start building 0.12 RCs.

@@ -262,12 +262,12 @@ Then set up LXC and the rest with the following, which is a complex jumble of se
# the version of lxc-start in Debian 7.4 needs to run as root, so make sure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we address the comment about Debian 7.4 also, given that we've moved to 8.2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh definitely. Removed the version here completely, leaves one less version number to update every time.

@theuni
Copy link
Member

theuni commented Dec 3, 2015

@laanwj Yep, will do in a few hours.

@laanwj laanwj force-pushed the 2015_11_gitian_building branch from 272ebbc to d3e8927 Compare December 3, 2015 10:07
@theuni
Copy link
Member

theuni commented Dec 4, 2015

Sadly I didn't make it to this today. I'll revisit asap after the conference.

@theuni
Copy link
Member

theuni commented Dec 17, 2015

@laanwj Just stepped through a 0.12 build for win32/linux and hit no snags. I haven't tried osx or the offline path (followed the guide from top to bottom, whoops). I'll get those going in the background next.

@laanwj
Copy link
Member Author

laanwj commented Dec 17, 2015

From top to bottom makes a lot of sense :)

@laanwj laanwj closed this Jan 18, 2016
@laanwj laanwj reopened this Jan 18, 2016
These are changes I needed to get gitian building to work with Debian
8.2, which is the version we tell to use.

- Set up NAT, so that container can access network beyond host
- Remove explicit cgroup setup - these are mounted automatically now
@fanquake
Copy link
Member

ACK

@Michagogo
Copy link
Contributor

Tested ACK regarding adding the python package to the OS X descriptor. That let it work for me when it failed before (building in LXC on Ubuntu Trusty). I don't know if adding it is necessary for the non-OS X builds, and I haven't tried any of the network changes. In response to @TheBlueMatt, I don't think it's actually needed. I don't actually know if my container can access the Internet, but afaik it only needs it to download the depends files, and we have a step in release-process.md that downloads the files and seeds them into the gitian cache.

@laanwj laanwj merged commit 3b468a0 into bitcoin:master Jan 20, 2016
laanwj added a commit that referenced this pull request Jan 20, 2016
…-building.md

3b468a0 gitian: Need `ca-certificates` and `python` for LXC builds (Wladimir J. van der Laan)
99fda26 doc: Make networking work inside builder in gitian-building.md (Wladimir J. van der Laan)
laanwj added a commit that referenced this pull request Jan 20, 2016
These are changes I needed to get gitian building to work with Debian
8.2, which is the version we tell to use.

- Set up NAT, so that container can access network beyond host
- Remove explicit cgroup setup - these are mounted automatically now
- gitian: Need `ca-certificates` and `python` for LXC builds

Github-Pull: #7060
Rebased-From: 99fda26 3b468a0
zkbot pushed a commit to zcash/zcash that referenced this pull request Oct 17, 2016
Upstream gitian updates

This PR pulls in all gitian-related PRs that have been merged upstream since 0.11.2. The only ones I left out were documentation-only PRs, because we removed `doc/gitian-building.md` at some point. Here are the commits applied here, in the order shown in `git log` (ie. last to first):

- bitcoin/bitcoin#7283
  - fa42a67
  - fa58c76
- bitcoin/bitcoin#8175
  - 74c1347
- bitcoin/bitcoin#8167
  - 7e7eb27
  - ad38204
  - b676f38
- bitcoin/bitcoin#7776
  - f063863
- bitcoin/bitcoin#7424
  - a81c87f ~ we already partly applied
  - a8ce872
  - f3d3eaf ~ we already partly applied
  - 475813b
  - ~~cd27bf5~~ X we already applied
- bitcoin/bitcoin#7060
  - 3b468a0 ~ we removed doc/gitian-building.md
  - ~~99fda26~~ X we removed doc/gitian-building.md
- bitcoin/bitcoin#7251
  - fa09562
- bitcoin/bitcoin#6900
  - ~~2cecb24~~ X we removed doc/gitian-building.md
  - 957c0fd
  - 2e31d74
  - ~~0b416c6~~ X we removed QT
  - 9f251b7
- bitcoin/bitcoin#6854
  - 579b863 ~ we already partly applied

Part of #540
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants