metal3-io / ironic-image

Container image to run OpenStack Ironic as part of Metal³
Apache License 2.0
56 stars 116 forks source link

Metal3 Ironic Container

This repo contains the files needed to build the Ironic images used by Metal3.

Build Status

CLOMonitor OpenSSF Scorecard Ubuntu daily main build status CentOS daily main build status

Description

When updated, builds are automatically triggered on https://quay.io/repository/metal3-io/ironic/

This repo supports the creation of multiple containers needed when provisioning baremetal nodes with Ironic. Eventually there will be separate images for each container, but currently separate containers can share this same image with specific entry points.

The following entry points are provided:

All of the containers must share a common mount point or data store. Ironic requires files for both the TFTP server and HTTP server to be stored in the same partition. This common store must include, in <shared store>/html/images, the following images:

The following environment variables can be passed in to customize run-time functionality:

The ironic configuration can be overridden by various environment variables. The following can serve as an example:

Build Ironic Image from RPMs

The ironic image is built using RPMs for system software and source code for ironic specific software and libraries. It is possible to build it using RPMs from RDO project code setting the INSTALL_TYPE argument to rpm at build time; for example:

podman build -t ironic-image -f Dockerfile --build-arg INSTALL_TYPE=rpm

Custom source for ironic software

When building the ironic image from source, it is also possible to specify a different source for ironic, ironic-lib or the sushy library using the build arguments IRONIC_SOURCE, IRONIC_LIB_SOURCE, and SUSHY_SOURCE. The accepted formats are gerrit refs, like refs/changes/89/860689/2, commit hashes, like a1fe6cb41e6f0a1ed0a43ba5e17745714f206f1f, repo tags or branches, or a local directory that needs to be under the sources/ directory in the container context. An example of a full command installing ironic from a gerrit patch is:

podman build -t ironic-image -f Dockerfile --build-arg INSTALL_TYPE=source \
    --build-arg IRONIC_SOURCE="refs/changes/89/860689/2"

An example using the local directory sources/ironic:

podman build -t ironic-image -f Dockerfile --build-arg INSTALL_TYPE=source \
    --build-arg IRONIC_SOURCE="ironic"

It is also possible to specify an upper-constraints file using the UPPER_CONSTRAINTS_FILE argument. By default this is the upper-constraints.txt file found in the container context; the content of the file can be modified keeping the default name or it's possible to specify an entire different filename as far as it's in the container context.

Apply project patches to the images during build

When building the image, it is possible to specify a patch of one or more upstream projects to apply to the image using the PATCH_LIST argument in the cli command, for example:

podman build -t ironic-image -f Dockerfile --build-arg \
    PATCH_LIST=my-patch-list

The PATCH_LIST argument is a path to a file under the image context. Its format is a simple text file that contains references to upstream patches for the ironic projects. Each line of the file is in the form: project_dir refspec (git_host) where: