[PATCH] Add "rpmbuild_networking" key (False by default) for nspawn backend

Miroslav Suchý msuchy at redhat.com
Tue Jul 28 08:19:00 UTC 2015


Dne 28.7.2015 v 03:41 Colin Walters napsal(a):
> From 1726c9b75abad3361e6207d2ea4a8e8cb78c85c4 Mon Sep 17 00:00:00 2001
> From: Colin Walters <walters at verbum.org>
> Date: Mon, 27 Jul 2015 21:35:20 -0400
> Subject: [PATCH] Add "rpmbuild_networking" key (False by default) for nspawn
>  backend
> 
> Build systems like Koji and many others want to support one aspect of
> reproducible builds by ensuring all input artifacts are cached within
> the organization.  This is the "If Github goes down, you can still
> build" aspect.
> 
> Traditionally, Koji installations implement this via firewalling
> rules on the server.
> 
> However, now with the systemd nspawn backend, we can rely
> on much more robust container features.  In particular, systemd has
> a `--private-network` option which does exactly what we want.
> 
> Teach mock how to use it, and enable this by default if the nspawn
> backend is in use.
> 
> This has the potential to break mock users who were relying on
> networking - but it's easy to turn back on.  But I assert that the
> majority of people using mock are exactly the kind of user who want to
> do full packaging, and it's best if they find out about any network
> issues before they do a Koji/whatever build.


Greate idea. I like it.


>  # The default package manager is Yum
>  # config_opts['package_manager'] = 'yum'
> diff --git a/py/mockbuild/backend.py b/py/mockbuild/backend.py
> index c342573..8a5e644 100644
> --- a/py/mockbuild/backend.py
> +++ b/py/mockbuild/backend.py
> @@ -428,10 +428,12 @@ class Commands(object):
>          command = [rpmbuild_cmd]
>          if not util.USE_NSPAWN:
>              command = ["bash", "--login", "-c"] + command
> +        print "network: %s" % (not self.config['rpmbuild_networking'],)

There is hardly any prints in current mock code. Can you use log() call?
Either self.buildroot.build_log.debug() or
  log = getLog()
  log.debug()
Choose yourself which one fits you better.


-- 
Miroslav Suchy, RHCA
Red Hat, Senior Software Engineer, #brno, #devexp, #fedora-buildsys


More information about the buildsys mailing list