diff --git a/src/bci_build/package/__init__.py b/src/bci_build/package/__init__.py index d65e0b84b..19c729bc9 100644 --- a/src/bci_build/package/__init__.py +++ b/src/bci_build/package/__init__.py @@ -1456,6 +1456,7 @@ def generate_disk_size_constraints(size_gb: int) -> str: from .basecontainers import MINIMAL_CONTAINERS # noqa: E402 from .gcc import GCC_CONTAINERS # noqa: E402 from .golang import GOLANG_CONTAINERS # noqa: E402 +from .kea import KEA_DHCP_CONTAINERS # noqa: E402 from .kiwi import KIWI_CONTAINERS # noqa: E402 from .mariadb import MARIADB_CLIENT_CONTAINERS # noqa: E402 from .mariadb import MARIADB_CONTAINERS # noqa: E402 @@ -1516,6 +1517,7 @@ def generate_disk_size_constraints(size_gb: int) -> str: *TOMCAT_CONTAINERS, *GCC_CONTAINERS, *SPACK_CONTAINERS, + *KEA_DHCP_CONTAINERS, ) } diff --git a/src/bci_build/package/kea.py b/src/bci_build/package/kea.py new file mode 100644 index 000000000..e387dfdf4 --- /dev/null +++ b/src/bci_build/package/kea.py @@ -0,0 +1,38 @@ +"""KEA DHCP Server BCI container""" + +from bci_build.os_version import OsVersion +from bci_build.package import ApplicationStackContainer +from bci_build.package.versions import get_pkg_version + +_BASE_PODMAN_KEA_CMD = "podman run --replace -it --privileged --network=host" +_KEA_DHCP4_CONFIG_PATH = "/etc/kea/kea-dhcp4.conf" +_KEA_DHCP6_CONFIG_PATH = "/etc/kea/kea-dhcp6.conf" + +KEA_DHCP_CONTAINERS = [] +KEA_SUPPORTED_OS_VERSIONS = [ + OsVersion.SP7, + OsVersion.TUMBLEWEED, +] + +for os_version in KEA_SUPPORTED_OS_VERSIONS: + KEA_DHCP_CONTAINERS.append( + ApplicationStackContainer( + name="kea", + os_version=os_version, + version=get_pkg_version("kea", os_version), + license="MPL-2.0", + is_latest=True, + pretty_name="Kea DHCP Server", + package_list=["kea", "util-linux"], + custom_end=""" + RUN mkdir -p /var/run/kea + """, + extra_labels={ + "run": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp4 -v /etc/kea:/etc/kea IMAGE kea-dhcp4 -c {_KEA_DHCP4_CONFIG_PATH}", + "runcwd": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp4 -v .:/etc/kea IMAGE kea-dhcp4 -c {_KEA_DHCP4_CONFIG_PATH}", + "run_dhcp6": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp6 -v /etc/kea:/etc/kea IMAGE kea-dhcp6 -c {_KEA_DHCP6_CONFIG_PATH}", + "runcwd_dhcp6": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp6 -v .:/etc/kea IMAGE kea-dhcp6 -c {_KEA_DHCP6_CONFIG_PATH}", + }, + exposes_ports=["67", "67/udp"], + ) + ) diff --git a/src/bci_build/package/kea/README.md.j2 b/src/bci_build/package/kea/README.md.j2 new file mode 100644 index 000000000..2ba3cb6a6 --- /dev/null +++ b/src/bci_build/package/kea/README.md.j2 @@ -0,0 +1,44 @@ +# {{ image.pretty_name }} Container Image + +{% include 'badges.j2' %} + +Kea is an open-source DHCP server developed by the [Internet Systems +Consortium](https://www.isc.org/) and the successor of the now deprecated +DHCPd. The Kea distribution includes a DHCPv4 server, a DHCPv6 server, and a +Dynamic DNS (DDNS) server. Significant features include: support for IPv6 prefix +delegation, host reservations (which may be optionally stored in a separate back +end database), Preboot Execution Environment (PXE) boot, client classification, +shared networks, and high-availability (failover pairs). Kea can store leases +locally in a memfile, or in a PostgreSQL or MySQL database. Kea has a supported +API for writing optional extensions, using 'hooks'. + +## How to use this Container Image + + +The container image expects configuration file in the directory `/etc/kea`. +Execute the following command to run DHCP using the configuration provided in the directory `/etc/kea`: + +```ShellSession +podman container runlabel run \ + {{ image.pretty_reference }} +``` +To run a DHCP6 server using the configuration file supplied in the directory `/etc/kea`, execute the following command: + +```ShellSession +podman container runlabel run_dhcp6 \ + {{ image.pretty_reference }} +``` + +The Kea configuration file can also be provided in the current working directory. +To run a DHCP or a DHCP6 server using the configuration file in the current working directory, execute the following commands: + +```ShellSession +$ # for DHCP +$ podman container runlabel runcwd \ + {{ image.pretty_reference }} +$ # for DHCP6 +$ podman container runlabel runcwd_dhcp6 \ + {{ image.pretty_reference }} +``` + +{% include 'licensing_and_eula.j2' %} diff --git a/src/bci_build/package/package_versions.json b/src/bci_build/package/package_versions.json index a015bdd93..4600c7c07 100644 --- a/src/bci_build/package/package_versions.json +++ b/src/bci_build/package/package_versions.json @@ -13,6 +13,11 @@ "Tumbleweed": "3.16", "version_format": "minor" }, + "kea": { + "7": "2.6", + "Tumbleweed": "2.6", + "version_format": "minor" + }, "mariadb": { "5": "10.6", "6": "10.11", @@ -28,21 +33,21 @@ "version_format": "minor" }, "pcp": { - "5": "5.2.5", + "5": "6.2.0", "6": "6.2.0", "7": "6.2.0", "Tumbleweed": "6.2.1" }, "python-kiwi": { - "16.0": "10.1.10", + "16.0": "10.1.16", "5": "9.24.43", "6": "9.24.43", "7": "9.24.43", - "Tumbleweed": "10.1.15" + "Tumbleweed": "10.1.18" }, "spack": { - "6": "0.21.2", - "7": "0.21.2", - "Tumbleweed": "0.22.1" + "6": "0.21.3", + "7": "0.21.3", + "Tumbleweed": "0.22.2" } } \ No newline at end of file