Commit Graph

5 Commits

Author SHA1 Message Date
Julia Kreger 6df7921cb7 Remove cloud-init when using simple-init
When using simple-init, we are making an explicit choice
along the lines of "I want the simple tool to do the simple needful"
which works well, except when cloud-init tries to run because it
is already baked into the source image diskimage-builder started
with.

So what would happen is Glean would execute from simple-init,
and then cloud-init would get launched by default, and cloud-init
in some cases everything is DHCP, so suddenly any static
configuration, such as what might be in an attached configuration
drive, is stomped upon resulting in an unreachable instance if
DHCP is just not available.

If DHCP is available, generally this is not an issue and goes
un-noticed, yet can add a substantial amount of time to the
boot sequence "waiting" for meta-data endpoints which may
not exist.

Change-Id: I380b9638cd28f5771530089c558ef5ab638c0173
2023-11-01 09:41:44 -07:00
Dmitry Tantsur fe89856d7d simple-init: allow disabling DHCP fallback
In some cases this is not desired (see the dependecy for details).

Change-Id: Ie549d0c9769a2b6c58de9e61cb621ca96c1cd886
Depends-On: https://review.opendev.org/c/opendev/glean/+/781500
2021-03-19 12:57:50 +01:00
melissaml a6322c6ed0 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I03e9162d5a59a2aa1631a9ecf6f6833bb7ac6050
2019-05-16 14:45:52 +08:00
Ian Wienand 8ec3750dda simple-init: allow for NetworkManager support
This plumbs through an "--use-nm" flag to glean which instructs it to
setup interface bringup with NetworkManager rather than legacy network
enablement scripts.

In this case, install the NetworkManager package.  In the non-nm case,
also install the network-scripts for Fedora 29 -- this has stopped
being installed by default (it's been deprecated since forever).

As noted in the docs, this is currently really only relevant on the
supported rpm distros which are using the ifcfg-rh NetworkManager
plugin to effectively re-use old config files.  However,
NetworkManager has similar plugins for other platforms, so support can
be expanded if changes are proposed.

Depends-On: https://review.openstack.org/618964
Change-Id: I4d76e88ce25e5675fd5ef48924acd09915a62a4b
2018-11-30 10:02:47 +11:00
Ian Wienand 97c01e48ed Move elements & lib relative to diskimage_builder package
Currently we have all our elements and library files in a top-level
directory and install them into
<root>/share/diskimage-builder/[elements|lib] (where root is either /
or the root of a virtualenv).

The problem with this is that editable/development installs (pip -e)
do *not* install data_files.  Thus we have no canonical location to
look for elements -- leading to the various odd things we do such as a
whole bunch of guessing at the top of disk-image-create and having a
special test-loader in tests/test_elements.py so we can run python
unit tests on those elements that have it.

data_files is really the wrong thing to use for what are essentially
assets of the program.  data_files install works well for things like
config-files, init.d files or dropping documentation files.

By moving the elements under the diskimage_builder package, we always
know where they are relative to where we import from.  In fact,
pkg_resources has an api for this which we wrap in the new
diskimage_builder/paths.py helper [1].

We use this helper to find the correct path in the couple of places we
need to find the base-elements dir, and for the paths to import the
library shell functions.

Elements such as svc-map and pkg-map include python unit-tests, which
we do not need tests/test_elements.py to special-case load any more.
They just get found automatically by the normal subunit loader.

I have a follow-on change (I69ca3d26fede0506a6353c077c69f735c8d84d28)
to move disk-image-create to a regular python entry-point.

Unfortunately, this has to move to work with setuptools.  You'd think
a symlink under diskimage_builder/[elements|lib] would work, but it
doesn't.

[1] this API handles stuff like getting files out of .zip archive
modules, which we don't do.  Essentially for us it's returning
__file__.

Change-Id: I5e3e3c97f385b1a4ff2031a161a55b231895df5b
2016-11-01 17:27:41 -07:00