Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Warewulf 4.6.0 #2077

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 134 additions & 72 deletions components/provisioning/warewulf/SPECS/warewulf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,36 @@
#
#----------------------------------------------------------------------------eh-

## Inserted by OHPC
%include %{_sourcedir}/OHPC_macros

%global debug_package %{nil}

%global api 0

# Base package name
%global pname warewulf

# Group for warewulfd and other WW operations
%global wwgroup warewulf

%if 0%{?fedora}
%define _build_id_links none
%endif

# Service directories (change /var/lib/* default to match WW3 build)
%global tftpdir /srv/tftpboot
%global srvdir /srv
%global statedir /srv

Name: %{pname}%{PROJ_DELIM}
Summary: A provisioning system for large clusters of bare metal and/or virtual systems
Version: 4.5.5
Version: 4.6.0
Release: 1%{?dist}
License: BSD-3-Clause
Group: %{PROJ_NAME}/provisioning
URL: https://github.com/hpcng/warewulf
Source0: https://github.com/hpcng/warewulf/releases/download/v%{version}/warewulf-%{version}.tar.gz
Patch0: warewulf-4.5.x-sle_ipxe.patch
URL: https://github.com/warewulf/warewulf
Source0: https://github.com/warewulf/warewulf/releases/download/v%{version}/warewulf-%{version}.tar.gz

ExclusiveOS: linux

Expand All @@ -42,50 +48,81 @@ Conflicts: warewulf-vnfs
Conflicts: warewulf-provision
Conflicts: warewulf-ipmi

BuildRequires: make
BuildRequires: git
BuildRequires: libassuan-devel
BuildRequires: gpgme-devel
BuildRequires: unzip
Requires: dhcp-server

%if 0%{?suse_version} || 0%{?sle_version}
BuildRequires: distribution-release
BuildRequires: systemd-rpm-macros
BuildRequires: go > 1.20
BuildRequires: firewall-macros
BuildRequires: firewalld
BuildRequires: tftp
BuildRequires: yq
Requires: tftp
Requires: nfs-kernel-server
Requires: firewalld
Requires: ipxe-bootimgs
%else
# Assume Fedora-based OS (>= RHEL 9) if not SUSE-based
# Assume Red Hat/Fedora build
BuildRequires: system-release
BuildRequires: systemd
BuildRequires: gcc
BuildRequires: golang > 1.20
BuildRequires: firewalld-filesystem
Requires: tftp-server
Requires: nfs-utils
%if 0%{?rhel} < 8
Requires: ipxe-bootimgs
%else
Requires: ipxe-bootimgs-x86
Requires: ipxe-bootimgs-aarch64
%endif
%endif

%if 0%{?rhel} >= 8 || 0%{?suse_version} || 0%{?fedora}
Requires: dhcp-server
%else
# rhel < 8
Requires: dhcp
%endif

BuildRequires: git
BuildRequires: make
BuildRequires: gpgme-devel
%if %{api}
BuildRequires: libassuan-devel
%endif

Recommends: logrotate
Recommends: ipmitool

%description
Warewulf is a stateless and diskless container operating system provisioning
Warewulf is a stateless and diskless provisioning
system for large clusters of bare metal and/or virtual systems.

%package dracut
Summary: dracut module for loading a Warewulf image
BuildArch: noarch

%prep
%setup -q -n %{pname}-%{version}
%if 0%{?suse_version} || 0%{?sle_version}
%patch0 -p1
Requires: dracut
%if 0%{?suse_version}
%else
Requires: dracut-network
%endif
Requires: curl
Requires: cpio
Requires: dmidecode

%description dracut
Warewulf is a stateless and diskless provisioning
system for large clusters of bare metal and/or virtual systems.

This subpackage contains a dracut module that can be used to generate
an initramfs that can fetch and boot a Warewulf node image from a
Warewulf server.

%prep
%setup -q -n %{pname}-%{version} -b0 %if %{?with_offline:-a2}

%build
export OFFLINE_BUILD=1
# Install to sharedstatedir by redirecting LOCALSTATEDIR
make defaults \
PREFIX=%{_prefix} \
BINDIR=%{_bindir} \
Expand All @@ -101,26 +138,45 @@ make defaults \
SYSTEMDDIR=%{_unitdir} \
BASHCOMPDIR=/etc/bash_completion.d/ \
FIREWALLDDIR=/usr/lib/firewalld/services \
WWCLIENTDIR=/warewulf
IPXESOURCE=/usr/share/ipxe
make
WWCLIENTDIR=/warewulf \
IPXESOURCE=/usr/share/ipxe \
DRACUTMODDIR=/usr/lib/dracut/modules.d \
CACHEDIR=%{_localstatedir}/cache
make build
%if %{api}
make api
%endif


%install
export NO_BRP_STALE_LINK_ERROR=yes
export OFFLINE_BUILD=1
make install DESTDIR=%{buildroot}
make installapi DESTDIR=%{buildroot}
export NO_BRP_STALE_LINK_ERROR=yes
make install \
DESTDIR=%{buildroot}
%if %{api}
make installapi \
DESTDIR=%{buildroot}
%endif

## Inserted by OHPC
# For RH, tftpboot directory is hardcoded
%if 0%{?rhel}
ln -s %{_sharedstatedir}/tftpboot %{buildroot}%{tftpdir}
%endif

%if 0%{?suse_version} || 0%{?sle_version}
yq e '
.tftp.ipxe."00:00" = "undionly.kpxe" |
.tftp.ipxe."00:07" = "ipxe-x86_64.efi" |
.tftp.ipxe."00:09" = "ipxe-x86_64.efi" |
.tftp.ipxe."00:0B" = "snp-arm64.efi" ' \
-i %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
%endif


%pre
getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup}
# use ipxe images from the distribution


%post
Expand All @@ -138,65 +194,71 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup}


%files
%defattr(-, root, %{wwgroup})
%defattr(-, root, root)

%dir %{_sysconfdir}/warewulf
%config(noreplace) %{_sysconfdir}/warewulf/warewulf.conf
%dir %{_sysconfdir}/warewulf/examples
%config(noreplace) %{_sysconfdir}/warewulf/examples/*.ww
%dir %{_sysconfdir}/warewulf/ipxe
%config(noreplace) %{_sysconfdir}/warewulf/ipxe/*.ipxe
%dir %{_sysconfdir}/warewulf/grub
%config(noreplace) %{_sysconfdir}/warewulf/grub/*.ww
%config(noreplace) %attr(0640,-,-) %{_sysconfdir}/warewulf/nodes.conf
%{_sysconfdir}/bash_completion.d/wwctl
%config(noreplace) %attr(0640,-,%{wwgroup}) %{_sysconfdir}/warewulf/nodes.conf
%config(noreplace) %{_sysconfdir}/warewulf/examples
%config(noreplace) %{_sysconfdir}/warewulf/ipxe
%config(noreplace) %{_sysconfdir}/warewulf/grub
%{_sysconfdir}/bash_completion.d
%config(noreplace) %{_sysconfdir}/logrotate.d

%dir %{statedir}/warewulf
%dir %{srvdir}/warewulf
%{statedir}/warewulf/chroots
%dir %{statedir}/warewulf/chroots
%dir %{statedir}/warewulf/overlays
%dir %{statedir}/warewulf/overlays/*
%attr(-, root, root) %{statedir}/warewulf/overlays/*/rootfs

%if 0%{?rhel}
%{tftpdir}
%endif

%attr(-, root, root) %{_bindir}/wwctl
%attr(-, root, root) %{_prefix}/lib/firewalld/services/warewulf.xml
%attr(-, root, root) %{_unitdir}/warewulfd.service
%attr(-, root, root) %{_mandir}/man1/wwctl*
%attr(-, root, root) %{_mandir}/man5/*.5*
%attr(-, root, root) %{_datadir}/warewulf
%dir %{_datadir}/warewulf
%{_datadir}/warewulf/bmc
%dir %{_datadir}/warewulf/overlays
%dir %{_datadir}/warewulf/overlays/*
%dir %{_datadir}/warewulf/overlays/*/rootfs
%{_datadir}/warewulf/overlays/NetworkManager/rootfs/*
%{_datadir}/warewulf/overlays/debian.interfaces/rootfs/*
%{_datadir}/warewulf/overlays/debug/rootfs/*
%{_datadir}/warewulf/overlays/fstab/rootfs/*
%{_datadir}/warewulf/overlays/host/rootfs/*
%{_datadir}/warewulf/overlays/hostname/rootfs/*
%{_datadir}/warewulf/overlays/hosts/rootfs/*
%{_datadir}/warewulf/overlays/ifcfg/rootfs/*
%{_datadir}/warewulf/overlays/ignition/rootfs/*
%{_datadir}/warewulf/overlays/issue/rootfs/*
%{_datadir}/warewulf/overlays/netplan/rootfs/*
%{_datadir}/warewulf/overlays/resolv/rootfs/*
%attr(700, -, -) %{_datadir}/warewulf/overlays/ssh.authorized_keys/rootfs/*
%{_datadir}/warewulf/overlays/ssh.host_keys/rootfs/*
%{_datadir}/warewulf/overlays/syncuser/rootfs/*
%{_datadir}/warewulf/overlays/systemd.netname/rootfs/*
%{_datadir}/warewulf/overlays/udev.netname/rootfs/*
%{_datadir}/warewulf/overlays/wicked/rootfs/*
%{_datadir}/warewulf/overlays/wwclient/rootfs/*
%{_datadir}/warewulf/overlays/wwinit/rootfs/*
%{_datadir}/warewulf/overlays/localtime/rootfs/*

%{_bindir}/wwctl
%{_prefix}/lib/firewalld/services/warewulf.xml
%{_unitdir}/warewulfd.service
%{_mandir}/man1/wwctl*
%{_mandir}/man5/*.5*

%dir %{_docdir}/warewulf
%license %{_docdir}/warewulf/LICENSE.md

%attr(-, root, root) %{_bindir}/wwapi*
%if %{api}
%{_bindir}/wwapi*
%config(noreplace) %{_sysconfdir}/warewulf/wwapi*.conf

# ===========================================================
%define dracut_package %{pname}-dracut%{PROJ_DELIM}

%package -n %{dracut_package}
Summary: A dracut module for loading a Warewulf container image
BuildArch: noarch

Requires: dracut
%if 0%{?suse_version} || 0%{?sle_version}
%else
Requires: dracut-network
%endif

%description -n %{dracut_package}
Warewulf is a stateless and diskless container operating system provisioning
system for large clusters of bare metal and/or virtual systems.

This subpackage contains a dracut module that can be used to generate
an initramfs that can fetch and boot a Warewulf container image from a
Warewulf server.

## Inserted by OHPC
%if 0%{?rhel}
%{tftpdir}
%endif

%files -n %{dracut_package}
%files dracut
%defattr(-, root, root)
%dir %{_prefix}/lib/dracut/modules.d/90wwinit
%{_prefix}/lib/dracut/modules.d/90wwinit/*.sh
%{_prefix}/lib/dracut/modules.d/90wwinit

%changelog
* Mon Mar 03 2025 Timothy Middelkoop <[email protected]>
- Merged/combined spec from 4.6.0
2 changes: 1 addition & 1 deletion docs/recipes/install/common/add_ww4_hosts_intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
% ohpc_validation_comment Add hosts to cluster
\begin{lstlisting}[language=bash,keywords={},upquote=true,basicstyle=\footnotesize\ttfamily,literate={BOSVER}{\baseos{}}1]
[sms](*\#*) for ((i=0; i<$num_computes; i++)) ; do
wwctl node add --container=rocky-9.4 \
wwctl node add --image=rocky-9 --profile=nodes --netname=default \
--ipaddr=${c_ip[$i]} --hwaddr=${c_mac[$i]} ${c_name[i]}
done
\end{lstlisting}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ \subsection{Finalizing provisioning configuration} \label{sec:assemble_bootstrap
This section highlights creation of the node image and overlays, followed by the
registration of desired compute nodes.

\subsubsection{Build container image and overlays}
\subsubsection{Build image image and overlays}

The bootstrap image includes the runtime kernel and associated modules, as well
as some simple scripts to complete the provisioning process.
as some simple scripts to complete the provisioning process. We explicitly rebuild
the image at the end because rebuilding the image is disabled in earlier steps.
It is good practice to rebuild the overlays when after configuration changes.

% begin_ohpc_run
% ohpc_comment_header Assemble bootstrap image \ref{sec:assemble_bootstrap}
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true,literate={BOSVER}{\baseos{}}1]
# Build image
[sms](*\#*) wwctl container build BOSVER
[sms](*\#*) wwctl image build BOSVER
[sms](*\#*) wwctl overlay build
\end{lstlisting}
% end_ohpc_run
Expand Down
12 changes: 7 additions & 5 deletions docs/recipes/install/common/import_ww4_files.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
the provisioning server for distribution to managed hosts through a system
called "overlays". Some files, like \texttt{/etc/passwd}, and \texttt{/etc/hosts}
handled in this way by default. Here we add directories and files to the
\texttt{generic} overlay that is applied to all nodes.
\texttt{nodesconfig} overlay that is applied to all nodes.

% begin_ohpc_run
% ohpc_comment_header Import files \ref{sec:file_import}
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
# Add the following to support unprivileged user namespaces for tools like Apptainer
[sms](*\#*) wwctl overlay import generic /etc/subuid
[sms](*\#*) wwctl overlay import generic /etc/subgid
[sms](*\#*) wwctl overlay import --parents nodeconfig /etc/subuid
[sms](*\#*) wwctl overlay import --parents nodeconfig /etc/subgid

# Identify master host as local NTP server
[sms](*\#*) echo "server ${sms_ip} iburst" | wwctl overlay import generic <(cat) /etc/chrony.conf
# Identify master host as local NTP server, configure it with a template with a Tag
[sms](*\#*) echo 'server {{.Tags.ntpserver}} iburst' | \
wwctl overlay import --parents nodeconfig <(cat) /etc/chrony.conf.ww
[sms](*\#*) wwctl profile set --yes nodes --tagadd ntpserver=${sms_ip}
\end{lstlisting}
% \end_ohpc_run
4 changes: 2 additions & 2 deletions docs/recipes/install/common/import_ww4_files_ib_centos.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
% ohpc_command if [[ ${enable_ipoib} -eq 1 ]];then
% ohpc_indent 5
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
[sms](*\#*) wwctl overlay mkdir generic /etc/sysconfig/network-scripts/
[sms](*\#*) wwctl overlay import generic /opt/ohpc/pub/examples/network/centos/ifcfg-ib0.ww \
# Import the template file for the ib interface
[sms](*\#*) wwctl overlay import --parents nodeconfig /opt/ohpc/pub/examples/network/centos/ifcfg-ib0.ww \
/etc/sysconfig/network-scripts/ifcfg-ib0.ww
\end{lstlisting}
% ohpc_indent 0
Expand Down
Loading
Loading