contrib: Add lxc network setup for Bionic host #13714

pull ken2812221 wants to merge 1 commits into bitcoin:master from ken2812221:gitian-build-auto-install changing 1 files +18 −1
  1. ken2812221 commented at 9:48 AM on July 19, 2018: contributor

    No description provided.

  2. fanquake added the label Scripts and tools on Jul 19, 2018
  3. ken2812221 renamed this:
    [gitian-build] Add automatical lxc network setup for Bionic
    [gitian-build] Add lxc network setup for Bionic
    on Jul 19, 2018
  4. ken2812221 renamed this:
    [gitian-build] Add lxc network setup for Bionic
    [gitian-build] Add lxc network setup for Bionic host
    on Jul 19, 2018
  5. in contrib/gitian-build.py:178 in ed764c1469 outdated
     166 | @@ -161,6 +167,9 @@ def main():
     167 |          os.environ['USE_DOCKER'] = '1'
     168 |      elif not args.kvm:
     169 |          os.environ['USE_LXC'] = '1'
     170 | +        if args.is_bionic:
     171 | +            os.environ['GITIAN_HOST_IP'] = '10.0.3.1'
    


    MarcoFalke commented at 11:00 AM on July 19, 2018:

    Any reason why the IP is slightly different than the one mentioned in the instructions in the docs repo?

    https://github.com/bitcoin-core/docs/blame/fb356d71c1cb24da7560e19fa655f1022f7b7543/gitian-building/gitian-building-setup-gitian-debian.md#L39


    ken2812221 commented at 11:09 AM on July 19, 2018:

    The default setting in /etc/default/lxc-net is 10.0.3.1


    ken2812221 commented at 4:01 PM on July 19, 2018:

    Or should make it as same as IP in document?


    Sjors commented at 4:11 PM on July 19, 2018:

    I would stick to the default, unless there was a technical problem with it. The less customization the better. This part of the manual can be removed if this is merged. Maybe make sure that if GITIAN_HOST_IP is already set, you don't override it? (or do, I don't know if there's any harm)


    MarcoFalke commented at 4:41 PM on July 19, 2018:

    Agree with @Sjors


    ken2812221 commented at 7:03 AM on July 20, 2018:

    OK, I'll keep it default.

  6. Sjors commented at 1:21 PM on July 19, 2018: member

    Concept ACK, this would help us make Gitian instructions shorter.

    Nit: "automatical" -> "automatic", or: "automate setup for Ubuntu Bionic"

  7. ken2812221 force-pushed on Jul 19, 2018
  8. ken2812221 force-pushed on Jul 19, 2018
  9. ken2812221 commented at 7:07 AM on July 20, 2018: contributor

    Update: Don't change GITIAN_HOST_IP and LXC_GUEST_IP if they exist in enviroment variable.

  10. in contrib/gitian-build.py:17 in 6371a36c69 outdated
      10 | @@ -11,10 +11,10 @@ def setup():
      11 |      if args.kvm:
      12 |          programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils']
      13 |      elif args.docker:
      14 | -        programs += ['docker.io']
      15 | +        programs += ['docker.io', 'docker-ce']
      16 |      else:
      17 |          programs += ['lxc', 'debootstrap']
      18 | -    subprocess.check_call(['sudo', 'apt-get', 'install', '-qq'] + programs)
      19 | +    subprocess.check_call(['sudo', 'apt-get', 'install', '-qq', '--ignore-missing'] + programs)
    


    MarcoFalke commented at 12:58 PM on July 20, 2018:

    Looks like the --ignore-missing is not doing anything for me on bionic:

    # apt install git docker-ce --ignore-missing
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Package docker-ce is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    
    E: Package 'docker-ce' has no installation candidate
    # echo $?
    100
    

    ken2812221 commented at 1:54 PM on July 20, 2018:

    Check if the OS is Bionic instead

  11. in contrib/gitian-build.py:44 in 6371a36c69 outdated
      30 | @@ -31,6 +31,10 @@ def setup():
      31 |          make_image_prog += ['--lxc']
      32 |      subprocess.check_call(make_image_prog)
      33 |      os.chdir(workdir)
      34 | +    if args.is_bionic:
      35 | +        subprocess.check_call(['sudo', 'sed', '-i', 's/lxcbr0/br0/', '/etc/default/lxc-net'])
      36 | +        print('Reboot is required')
      37 | +        exit(0)
    


    MarcoFalke commented at 12:58 PM on July 20, 2018:

    Shouldn't this be only executed for lxc (and not docker/kvm)?


    ken2812221 commented at 1:55 PM on July 20, 2018:

    Yes.

  12. ken2812221 force-pushed on Jul 20, 2018
  13. in contrib/gitian-build.py:14 in 8d0afb5eff outdated
      10 | @@ -11,7 +11,7 @@ def setup():
      11 |      if args.kvm:
      12 |          programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils']
      13 |      elif args.docker:
      14 | -        programs += ['docker.io']
      15 | +        programs += ['docker.io' if args.is_bionic else 'docker-ce']
    


    MarcoFalke commented at 4:07 PM on July 20, 2018:

    Sorry for nit-picking this so much, but the package is also named docker.io in xenial: https://packages.ubuntu.com/xenial/docker.io

    And debian has neither docker.io, nor docker-ce, so I don't really see why this change is here?


    ken2812221 commented at 10:05 PM on July 20, 2018:

    Add an error message if no docker found

  14. in contrib/gitian-build.py:181 in 8d0afb5eff outdated
     166 | @@ -161,6 +167,11 @@ def main():
     167 |          os.environ['USE_DOCKER'] = '1'
     168 |      elif not args.kvm:
     169 |          os.environ['USE_LXC'] = '1'
     170 | +        if args.is_bionic:
     171 | +            if not 'GITIAN_HOST_IP' in os.environ.keys():
     172 | +                os.environ['GITIAN_HOST_IP'] = '10.0.3.1'
     173 | +            if not 'LXC_GUEST_IP' in os.environ.keys():
     174 | +                os.environ['LXC_GUEST_IP'] = '10.0.3.5'
    


    MarcoFalke commented at 4:09 PM on July 20, 2018:

    These should also be exported on cosmic and later (and maybe debian?)

    So no need to guard by is_bionic?


    ken2812221 commented at 10:06 PM on July 20, 2018:

    Fixed

  15. ken2812221 force-pushed on Jul 20, 2018
  16. ken2812221 force-pushed on Jul 20, 2018
  17. [contrib] Add automatic setup for Ubuntu Bionic 60c3c23a63
  18. ken2812221 force-pushed on Jul 20, 2018
  19. MarcoFalke commented at 12:57 AM on July 21, 2018: member

    utACK 60c3c23a63bd7f681e0db86251ae0a372cb6b279

  20. ken2812221 renamed this:
    [gitian-build] Add lxc network setup for Bionic host
    [contrib] Add lxc network setup for Bionic host
    on Jul 25, 2018
  21. fanquake renamed this:
    [contrib] Add lxc network setup for Bionic host
    contrib: Add lxc network setup for Bionic host
    on Jul 25, 2018
  22. fanquake commented at 1:35 PM on July 25, 2018: member

    utACK 60c3c23

  23. in contrib/gitian-build.py:16 in 60c3c23a63
      10 | @@ -11,7 +11,14 @@ def setup():
      11 |      if args.kvm:
      12 |          programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils']
      13 |      elif args.docker:
      14 | -        programs += ['docker.io']
      15 | +        dockers = ['docker.io', 'docker-ce']
      16 | +        for i in dockers:
      17 | +            return_code = subprocess.call(['sudo', 'apt-get', 'install', '-qq', i])
    


    fanquake commented at 1:38 PM on July 25, 2018:

    Had to lookup -qq

    Quiet. Produces output suitable for logging, omitting progress indicators. More q's will produce more quiet up to a maximum of two.

  24. fanquake added this to the "Mergeable" column in a project

  25. MarcoFalke merged this on Jul 25, 2018
  26. MarcoFalke closed this on Jul 25, 2018

  27. MarcoFalke referenced this in commit 29b4ee6469 on Jul 25, 2018
  28. MarcoFalke commented at 2:01 PM on July 25, 2018: member

    Could someone please update the recommended *_IP constants in https://github.com/bitcoin-core/docs as well?

  29. fanquake removed this from the "Mergeable" column in a project

  30. ken2812221 deleted the branch on Jul 26, 2018
  31. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-20 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me