Skip to content

Commit

Permalink
Upgrade Warewulf 4 documentation to 4.6.x
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Middelkoop <[email protected]>
  • Loading branch information
MiddelkoopT committed Mar 3, 2025
1 parent d684bd5 commit 1f6d224
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 56 deletions.
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
19 changes: 11 additions & 8 deletions docs/recipes/install/common/import_ww4_files_slurm.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@

% begin_ohpc_run
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
# Configure Slurm server in the overlay (using "configless" option)
[sms](*\#*) wwctl overlay mkdir generic /etc/sysconfig/
[sms](*\#*) wwctl overlay import generic <(echo SLURMD_OPTIONS="--conf-server ${sms_ip}") /etc/sysconfig/slurmd

# Configure Slurm server in the overlay (using "configless" option) using a tag in a template file (slurmd.ww)
[sms](*\#*) echo SLURMD_OPTIONS='--conf-server {{.Tags.slurmctld}}' | \
wwctl overlay import --parents nodeconfig <(cat) /etc/sysconfig/slurmd.ww

# Set the value of the slurmctld tag to the $sms_ip for the nodes profile.
[sms](*\#*) wwctl profile set --yes nodes --tagadd slurmctld=${sms_ip}

# Configure munge
[sms](*\#*) wwctl overlay mkdir generic --mode 0700 /etc/munge
[sms](*\#*) wwctl overlay import generic /etc/munge/munge.key
[sms](*\#*) wwctl overlay chown generic /etc/munge/munge.key $(id -u munge) $(id -g munge)
[sms](*\#*) wwctl overlay chown generic /etc/munge $(id -u munge) $(id -g munge)
[sms](*\#*) wwctl overlay import --parents nodeconfig /etc/munge/munge.key
[sms](*\#*) wwctl overlay chown nodeconfig /etc/munge/munge.key $(id -u munge) $(id -g munge)
[sms](*\#*) wwctl overlay chown nodeconfig /etc/munge $(id -u munge) $(id -g munge)
[sms](*\#*) wwctl overlay chmod nodeconfig /etc/munge 0700
\end{lstlisting}
% \end_ohpc_run
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
%\nottoggle{isCentOS}{\clearpage}

% begin_ohpc_run
% ohpc_comment_header Add baseline OpenHPC and provisioning services \ref{sec:add_provisioning}
% ohpc_comment_header Add baseline OpenHPC\ref{sec:add_provisioning}
\begin{lstlisting}[language=bash,keywords={}]
# Install base packages
[sms](*\#*) (*\install*) ohpc-base warewulf-ohpc hwloc-ohpc
[sms](*\#*) (*\install*) ohpc-base

# Install Warewulf
[sms](*\#*) (*\install*) warewulf-ohpc hwloc-ohpc
\end{lstlisting}
% end_ohpc_run


Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
to include resource management client services, NTP support, and
other additional packages to support the default \OHPC{} environment. This
process modifies the base provisioning image and will access the BOS and \OHPC{}
repositories to resolve package install requests. We begin by installing a few
repositories to resolve package install requests.

The instructions below are designed to be copied and pasted all at once into
a terminal. Alternatively you can run `wwctl image shell rocky-9'
to "run" the node image interactively and run the commands one at a time, this
method is recommended.

We begin by installing a few
common base packages:

% begin_ohpc_run
% ohpc_comment_header Add OpenHPC base components to compute image \ref{sec:add_components}
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true,literate={BOSVER}{\baseos{}}1]
# Install compute node base meta-package
[sms](*\#*) wwctl container exec rocky-9.4 /bin/bash <<- EOF
[sms](*\#*) wwctl image exec --build=false rocky-9 /bin/bash <<- EOF
dnf -y install ohpc-base-compute
EOF
\end{lstlisting}
Expand All @@ -19,6 +26,6 @@
\noindent Now, we can include additional required components to the compute
instance including resource manager client, NTP, and development environment modules support.

Adding packages can be done by entering the image with \texttt{wwctl container shell},
\texttt{wwctl container exec}, or using a CHROOT.
Adding packages can be done by entering the image with \texttt{wwctl image shell},
\texttt{wwctl image exec}, or using a CHROOT.

2 changes: 1 addition & 1 deletion docs/recipes/install/common/warewulf4_kargs_post.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
% ohpc_command if [[ ${enable_kargs} -eq 1 ]]; then
\begin{lstlisting}[language=bash,keywords={},upquote=true,basicstyle=\footnotesize\ttfamily]
# Set optional compute node kernel command line arguments.
[sms](*\#*) wwctl node set --yes --kernelargs="${kargs}" "${compute_regex}"
[sms](*\#*) wwctl profile set --yes nodes --kernelargs="${kargs}"
\end{lstlisting}
% ohpc_command fi
% end_ohpc_run
16 changes: 8 additions & 8 deletions docs/recipes/install/common/warewulf4_mkchroot_rocky.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@
{\em compute} nodes. The following subsections highlight this process.

\subsubsection{Build initial BOS image} \label{sec:assemble_bos}
\Warewulf{} 4 supports using container images as the base file system for
\Warewulf{} 4 supports using image images as the base file system for
provisioning, and it can import these images directly from an OCI registry like
Docker Hub. Container images must be created especially for use with \Warewulf{}
since they need to include things like a kernel and an init system. In this
example we will import our base image from a set maintained by the \Warewulf{}
community on the GitHub container registry.

The \texttt{wwctl container exec} command runs the commands below it, these commands
also be run interactively one a time with the command \texttt{wwctl container
The \texttt{wwctl image exec} command runs the commands below it, these commands
also be run interactively one a time with the command \texttt{wwctl image
shell \baseos{}}. You can add \texttt{/bin/false} as the last command to prevent
the image from rebuilding (it will show an error) and rebuild later with the
`wwctl container build` command.
`wwctl image build` command.

% begin_ohpc_run
% ohpc_comment_header Create compute image for Warewulf \ref{sec:assemble_bos}
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true,keepspaces,literate={BOSVER}{\baseos{}}1]
# Import the base image from ghcr
[sms](*\#*) wwctl container import docker://ghcr.io/warewulf/warewulf-rockylinux:9 BOSVER --syncuser
[sms](*\#*) wwctl image import docker://ghcr.io/warewulf/warewulf-rockylinux:9 BOSVER --syncuser

# Enable OpenHPC inside image and update container
[sms](*\#*) wwctl container exec rocky-9.4 /bin/bash <<- EOF
# Enable OpenHPC inside image and update image. Disable autorebuild.
[sms](*\#*) wwctl image exec --build=false rocky-9 /bin/bash <<- EOF
dnf -y install http://repos.openhpc.community/OpenHPC/3/EL_9/x86_64/ohpc-release-3-1.el9.x86_64.rpm
dnf -y update
EOF

# Define chroot location
# Define chroot location
[sms](*\#*) export CHROOT=/srv/warewulf/chroots/BOSVER/rootfs
\end{lstlisting}
% end_ohpc_run
28 changes: 12 additions & 16 deletions docs/recipes/install/common/warewulf4_setup_centos.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@
[sms](*\#*) perl -pi -e 's/template:.*/template: static/' /etc/warewulf/warewulf.conf
[sms](*\#*) perl -pi -e "s/range start:.*/range start: ${c_ip[0]}/" /etc/warewulf/warewulf.conf
[sms](*\#*) perl -pi -e "s/range end:.*/range end: ${c_ip[$((num_computes-1))]}/" /etc/warewulf/warewulf.conf
[sms](*\#*) perl -pi -e "s/mount: false/mount: true/" /etc/warewulf/warewulf.conf

# Set default network configuration
[sms](*\#*) wwctl profile set -y default --netmask=${internal_netmask}
[sms](*\#*) wwctl profile set -y default --gateway=${ipv4_gateway}
[sms](*\#*) wwctl profile set -y default --netdev=default --nettagadd=DNS=${dns_servers}
# Edit the nodes.conf to mount /opt
[sms](*\#*) perl -pi -e "s/defaults,noauto,nofail,ro/defaults,nofail,ro/" /etc/warewulf/nodes.conf

# Create a new "nodes" profile and inherit the "default" profile
[sms](*\#*) wwctl profile add nodes --profile default --comment "Nodes profile"

# Configure /etc/hostname on master and compute nodes
[sms](*\#*) perl -pi -e "s/warewulf/${sms_name}/" /srv/warewulf/overlays/host/rootfs/etc/hosts.ww
[sms](*\#*) perl -pi -e "s/warewulf/${sms_name}/" /srv/warewulf/overlays/generic/rootfs/etc/hosts.ww
# Create a new "nodeconfig" overlay to store node configuration files, set the profile to use it
[sms](*\#*) wwctl overlay create nodeconfig
[sms](*\#*) wwctl profile set --yes nodes --system-overlays nodeconfig

# Bugfix: dhcpd.template does not set next-server
[sms](*\#*) echo "next-server ${sms_ip};" >> /srv/warewulf/overlays/host/rootfs/etc/dhcpd.conf.ww
# Set default network configuration
[sms](*\#*) wwctl profile set -y nodes --netdev=default --netmask=${internal_netmask}
[sms](*\#*) wwctl profile set -y nodes --netdev=default --gateway=${ipv4_gateway}
[sms](*\#*) wwctl profile set -y nodes --netdev=default --nettagadd=DNS=${dns_servers}

# Configuring Warewulf will restart/enable relevant services to support provisioning
[sms](*\#*) systemctl enable --now warewulfd
Expand All @@ -34,9 +36,3 @@
[sms](*\#*) bash /etc/profile.d/ssh_setup.sh
\end{lstlisting}
% end_ohpc_run

% begin_ohpc_run
% ohpc_validation_newline
% ohpc_validation_comment Update /etc/hosts template to have ${hostname}.localdomain as the first host entry
% ohpc_command sed -e 's_\({{$node.Id.Get}}{{end}}\)_{{$node.Id.Get}}.localdomain \1_g' -i /srv/warewulf/overlays/host/rootfs/etc/hosts.ww
% end_ohpc_run
8 changes: 4 additions & 4 deletions docs/recipes/install/rocky9/x86_64/warewulf4/slurm/steps.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
\input{vc.tex}

% Define Base OS and other local macros
\newcommand{\baseOS}{Rocky 9.4}
\newcommand{\OSRepo}{Rocky\_9.4}
\newcommand{\baseOS}{Rocky 9}
\newcommand{\OSRepo}{Rocky\_9}
\newcommand{\OSTree}{EL\_9}
\newcommand{\OSTag}{el9}
\newcommand{\baseos}{rocky-9.4}
\newcommand{\baseos}{rocky-9}
\newcommand{\baseosshort}{rocky9}
\newcommand{\provisioner}{Warewulf4}
\newcommand{\provheader}{\provisioner{}}
Expand Down Expand Up @@ -134,7 +134,7 @@ \subsubsection{Add \OHPC{} components} \label{sec:add_components}
% begin_ohpc_run
% ohpc_validation_comment Add SLURM and other components to compute instance
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true,literate={BOSVER}{\baseos{}}1]
[sms](*\#*) wwctl container exec rocky-9.4 /bin/bash <<- EOF
[sms](*\#*) wwctl image exec --build=false rocky-9 /bin/bash <<- EOF
# Add Slurm client support meta-package and enable munge and slurmd
dnf -y install ohpc-slurm-client
systemctl enable munge
Expand Down

0 comments on commit 1f6d224

Please sign in to comment.