yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #69666
[Bug 1736114] Re: metadata_agent.ini cannot be built reproducibly
Reviewed: https://review.openstack.org/525159
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a20845048a87b99e17f3caf204e4b88199442d8d
Submitter: Zuul
Branch: master
commit a20845048a87b99e17f3caf204e4b88199442d8d
Author: Thomas Goirand <zigo@xxxxxxxxxx>
Date: Mon Dec 4 12:28:35 2017 +0100
Build metadata_agent.ini reproducibly
Currently, when metadata_agent.ini is built, the default value for the
directive metadata_workers is the build host's number of CPU. This is
wrong because metadata_agent.ini cannot be built reproducibly, which is
a bug in many distributions.
See for Debian: https://wiki.debian.org/ReproducibleBuilds/About
This patch therefore uses sample_default oslo.config directive to
hardcode a value put in generated configuration file that would not
depend on build environment.
Change-Id: I7292d09b96f90d0477dd4b59766854a733e1da38
Closes-Bug: #1736114
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1736114
Title:
metadata_agent.ini cannot be built reproducibly
Status in neutron:
Fix Released
Bug description:
Hi,
When generating metadata_agent.ini, the metadata_workers directive
default value is filled with the number of CPUs used when building the
file. This makes the whole Neutron package not reproducible.
The config code is like this (from
neutron/conf/agent/metadata/config.py):
cfg.IntOpt('metadata_workers',
default=host.cpu_count() // 2,
help=_('Number of separate worker processes for metadata '
'server (defaults to half of the number of CPUs)')),
Instead of writing this, the default value should be set to None, then
whenever something fetches the metadata_workers value, something like
this should be written (probably, a //2 should be added if we want to
retain the above):
def get_num_metadata_workers():
"""Return the configured number of workers."""
if CONF.metadata_workers is None:
# None implies the number of CPUs
return processutils.get_worker_count()
return CONF.metadata_workers
This way, the value really is taken from runtime, and not build time,
which is probably what the original author wanted to write. Note that
this type of fix has already been written in Glance, and many other
OpenStack packages.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1736114/+subscriptions
References