Commit Graph

10 Commits

Author SHA1 Message Date
Ian Wienand
41aa936fa2
tox jobs: pin to correct nodesets; use host networking for containerfile
These must have broken when we switched the base nodes to Jammy.
Update to use compatible versions of distros.

We need to squish another gate-breaking change in here to update the
containerfile "podman build" calls to use "--network host".  We added
this with Ia885237406bf4c7b9d49b349f374558ae746401f and the only
external user I can find is kayobe, which is setting this anyway.

I honestly haven't 100% root-caused what changed to require this; the
last time our containerfile jobs ran and worked has unfortunately been
purged so I can't compare versions to try and pinpoint something;
i.e. this may be a podman bug or feature.  At first I thought it
related to the networking plugin package from the Depends-On (which is
still useful for the right packages) but that didn't help get the
bridge networking working.

Depends-On: https://review.opendev.org/c/zuul/nodepool/+/867590
Change-Id: I23f091654cb212e8bdd908664b262de9bfe98cef
2022-12-16 09:52:46 +11:00
Ian Wienand
3e51709307 containerfile: warn if we don't have a Dockerfile
Currently if no Dockerfile is specified or found, we exit later with
an obscure error.  Check this after the element search; if we still
don't have something to build then we can't continue.

Change-Id: Ifb17a0995fab0ccfe7ee08363676c1fa57e37592
2022-06-21 12:03:46 +10:00
Ian Wienand
28821fd283 containerfile: update test to jammy
We've not really been using the Focal containerfile, as we move
forward jammy is a better choice for keeping stable as we might find
some new users for it.

Also add binutils to bindep for native bullseye builds (see
Icb0e40827c9f8ac583fa143545e6bed9641bf613)

Change-Id: I22ebe2bbccaec34180e58996b21e47bfc4f36055
2022-04-22 14:48:18 +10:00
Michal Nasiadka
7d782ae1c9 containerfile: Add support for setting network driver
Change-Id: Ia885237406bf4c7b9d49b349f374558ae746401f
2022-03-15 13:18:11 +00:00
Michal Nasiadka
a02cb9ff74 containerfile: add support for Docker
In some build environments Docker is already installed - and adding
podman is not an option.  Add a new variable to toggle this, and
rename the now incorrectly titled DIB_CONTAINERFILE_PODMAN_ROOT to
just ...RUNTIME_ROOT to match.

Change-Id: I677e4f491b40360dceabdf4f2a9e64c7cb493dc7
2022-03-11 14:04:52 +11:00
Ian Wienand
85e20d9852 containerfile: handle errors better
Refactor things to use explicit names, and put in a trap to cleanup
after any errors.

Currently, if the build/run/export steps fail, it leaves behind images
which eventually clog things to the point podman won't run any more
(see also https://github.com/containers/podman/pull/12233 about errors
seen due to this)

Change-Id: Ib328a07ad67e3f71f379fbf34ae7ef74e212ef1c
2021-11-10 11:42:49 +11:00
Ian Wienand
3833c2e59c containerfile: fix tar extraction
Ic68e8c5b839cbc2852326747c68ef89f630f26a3 removed the sudo from the
tar extraction here, meaning that production is failing to create the
chroot.  This is hidden in testing because
DIB_CONTAINERFILE_PODMAN_ROOT is set.  Make the sudo here
unconditional.

Change-Id: I6e36e3fc65981f85fad12ea2cd10780fde9c37da
2021-11-10 11:42:49 +11:00
Ian Wienand
1a5c563920 Run functional tests on Debian Bullseye
We need to update the base reference platform we perform the
functional tests on.  Debian bullseye seems like the best choice -- it
is recent enough to last for a while, and will match the
nodepool-builder container environment.

Depends-On: https://review.opendev.org/c/zuul/zuul-jobs/+/814088
Change-Id: Ic68e8c5b839cbc2852326747c68ef89f630f26a3
2021-10-20 09:39:27 +11:00
Ian Wienand
2a14088eac containerfile: automatically search for distro docker files
This makes the container file element search the active element list
for `containerfiles/${DIB_RELEASE}` for building.  This makes it easy
to write wrappers for ubuntu/fedora/etc. containerfile elements.

Change-Id: I68f1d928e54a70bad76985ddd3e156bb5f978b0d
2021-05-10 15:36:28 +10:00
James E. Blair
edff632186 Add containerfile element
This is a base element which uses a containerfile (Dockerfile) to
build a container image, then the filesystem is extracted from that
image and forms the root of the dib image.

You can add as little or as much to the dockerfile as desired.

Change-Id: I4e821aa2ce7feb8841ef31da56de1a31aa9218b5
2021-05-07 13:54:59 +10:00