Skip to content

Commit

Permalink
Copy Warewulf to Warewulf4 for development
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Middelkoop <[email protected]>
  • Loading branch information
MiddelkoopT committed Oct 20, 2024
1 parent 611b01f commit ad05f74
Show file tree
Hide file tree
Showing 16 changed files with 648 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/recipes/install/common/add_ww4_hosts_finalize.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
\iftoggleverb{isx86}
% ohpc_validation_newline
% ohpc_validation_comment Optionally, define IPoIB network settings (required if planning to mount Lustre over IB)
% ohpc_command if [[ ${enable_ipoib} -eq 1 ]];then
% ohpc_indent 5
\begin{lstlisting}[language=bash,keywords={},upquote=true,basicstyle=\footnotesize\ttfamily]
# Optionally define IPoIB network settings (required if planning to mount Lustre/BeeGFS over IB)
[sms](*\#*) for ((i=0; i<$num_computes; i++)) ; do
wwsh -y node set ${c_name[$i]} -D ib0 --ipaddr=${c_ipoib[$i]} --netmask=${ipoib_netmask}
done
[sms](*\#*) wwsh -y provision set "${compute_regex}" --fileadd=ifcfg-ib0.ww
\end{lstlisting}
% ohpc_indent 0
% ohpc_command fi
% ohpc_validation_newline
% end_ohpc_run
\fi

\input{common/wwnodescan}

% begin_ohpc_run
\begin{lstlisting}[language=bash,keywords={},upquote=true,basicstyle=\footnotesize\ttfamily]
# Restart dhcp / update PXE
[sms](*\#*) systemctl restart dhcpd
[sms](*\#*) wwsh pxe update
\end{lstlisting}
% end_ohpc_run
28 changes: 28 additions & 0 deletions docs/recipes/install/common/add_ww4_hosts_intro.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
%\iftoggle{isx86}{\clearpage}
% begin_ohpc_run
% ohpc_validation_comment Add hosts to cluster

\begin{lstlisting}[language=bash,keywords={},upquote=true,basicstyle=\footnotesize\ttfamily,]
# Set provisioning interface as the default networking device
[sms](*\#*) echo "GATEWAYDEV=${eth_provision}" > /tmp/network.$$
[sms](*\#*) wwsh -y file import /tmp/network.$$ --name network
[sms](*\#*) wwsh -y file set network --path /etc/sysconfig/network --mode=0644 --uid=0

# Add nodes to Warewulf data store
[sms](*\#*) for ((i=0; i<$num_computes; i++)) ; do
wwsh -y node new ${c_name[i]} --ipaddr=${c_ip[i]} --hwaddr=${c_mac[i]} -D ${eth_provision}
done
\end{lstlisting}
% end_ohpc_run

%\iftoggle{isCentOS_ww_pbs_x86}{\clearpage}

%\iftoggle{isSLES_ww_slurm_x86}{\clearpage}

\begin{lstlisting}[language=bash,keywords={},upquote=true,basicstyle=\footnotesize\ttfamily]
# Additional step required if desiring to use predictable network interface
# naming schemes (e.g. en4s0f0). Skip if using eth# style names.
[sms](*\#*) export kargs="${kargs} net.ifnames=1,biosdevname=1"
[sms](*\#*) wwsh provision set --postnetdown=1 "${compute_regex}"
\end{lstlisting}

9 changes: 9 additions & 0 deletions docs/recipes/install/common/add_ww4_hosts_slurm.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
% begin_ohpc_run
% ohpc_validation_comment Add hosts to cluster (Cont.)
\begin{lstlisting}[language=bash,keywords={},upquote=true,basicstyle=\footnotesize\ttfamily,literate={BOSVER}{\baseos{}}1]
# Define provisioning image for hosts
[sms](*\#*) wwsh -y provision set "${compute_regex}" --vnfs=BOSVER --bootstrap=`uname -r` \
--files=dynamic_hosts,passwd,group,shadow,munge.key,network
\end{lstlisting}


74 changes: 74 additions & 0 deletions docs/recipes/install/common/finalize_warewulf4_provisioning.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
\subsection{Finalizing provisioning configuration} \label{sec:assemble_bootstrap}

\Warewulf{} employs a two-stage boot process for provisioning nodes via
creation of a bootstrap image that is used to initialize the process, and a virtual node
file system capsule containing the full system image. This section highlights
creation of the necessary provisioning images, followed by the registration of
desired compute nodes.

\subsubsection{Assemble bootstrap image}

The bootstrap image includes the runtime kernel and associated modules, as well
as some simple scripts to complete the provisioning process. The
following commands highlight the inclusion of additional drivers and creation
of the bootstrap image based on the running kernel.

%\iftoggle{isCentOS_ww_slurm_aarch}{\clearpage}

% begin_ohpc_run
% ohpc_comment_header Assemble bootstrap image \ref{sec:assemble_bootstrap}
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
# (Optional) Include drivers from kernel updates; needed if enabling additional kernel modules on computes
[sms](*\#*) export WW_CONF=/etc/warewulf/bootstrap.conf
[sms](*\#*) echo "drivers += updates/kernel/" >> $WW_CONF

# Build bootstrap image
[sms](*\#*) wwbootstrap `uname -r`
\end{lstlisting}
% end_ohpc_run

\subsubsection{Assemble Virtual Node File System (VNFS) image}

With the local site customizations in place, the following step uses the
\texttt{wwvnfs} command to assemble a VNFS capsule from the chroot environment
defined for the {\em compute} instance.

% begin_ohpc_run
% ohpc_validation_comment Assemble VNFS
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
[sms](*\#*) wwvnfs --chroot $CHROOT
\end{lstlisting}
% end_ohpc_run

\iftoggle{isCentOS_ww_slurm_aarch}{\vspace*{0.4cm}}

\iftoggle{isSLES_ww_slurm_aarch}{\vspace*{-0.1cm}}

\subsubsection{Register nodes for provisioning}

In preparation for provisioning, we can now define the desired network settings
for four example compute nodes with the underlying provisioning system and
restart the \texttt{dhcp} service. Note the use of variable names for the
desired compute hostnames, node IPs, and MAC addresses which should be modified
to accommodate local settings and hardware. By default, \Warewulf{} uses
network interface names of the \texttt{eth\#} variety and adds kernel boot
arguments to maintain this scheme on newer kernels. Consequently, when specifying
the desired provisioning interface via the \texttt{\$eth\_provision} variable,
it should follow this convention. Alternatively, if you prefer to use the
predictable network interface naming scheme (e.g. names like \texttt{en4s0f0}),
additional steps are included to alter the default kernel boot arguments and take
the \texttt{eth\#} named interface down after bootstrapping so the normal init
process can bring it up again using the desired name.

\iftoggleverb{isx86}
Also included in these steps are commands
to enable \Warewulf{} to manage IPoIB settings and corresponding definitions of
IPoIB addresses for the compute nodes. This is typically optional unless you
are planning to include a \Lustre{} client mount over \InfiniBand{}.
\fi
The final step
in this process associates the VNFS image assembled in previous steps with the
newly defined compute nodes, utilizing the user credential files and munge key
that were imported in \S\ref{sec:file_import}.


14 changes: 14 additions & 0 deletions docs/recipes/install/common/import_ww4_files.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The \Warewulf{} system includes functionality to import arbitrary files from
the provisioning server for distribution to managed hosts. This is one way to
distribute user credentials to {\em compute} nodes. To import local file-based
credentials, issue the following:

% begin_ohpc_run
% ohpc_comment_header Import files \ref{sec:file_import}
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
[sms](*\#*) wwsh file import /etc/passwd
[sms](*\#*) wwsh file import /etc/group
[sms](*\#*) wwsh file import /etc/shadow

\end{lstlisting}
% \end_ohpc_run
9 changes: 9 additions & 0 deletions docs/recipes/install/common/import_ww4_files_slurm.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\noindent Similarly, to import the cryptographic
key that is required by the {\em munge} authentication library to be available
on every host in the resource management pool, issue the following:

% begin_ohpc_run
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
[sms](*\#*) wwsh file import /etc/munge/munge.key
\end{lstlisting}
% \end_ohpc_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
With the \OHPC{} repository enabled, we can now begin adding desired components onto the
{\em master} server. This repository provides a number of aliases that group
logical components together in order to help aid in this process. For
reference, a complete list of available group aliases and RPM packages available
via \OHPC{} are provided in Appendix~\ref{appendix:manifest}. To add
support for provisioning services, the following commands illustrate addition
of a common base package followed by the Warewulf provisioning system.

%\nottoggle{isCentOS}{\clearpage}

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


Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
The \texttt{wwmkchroot} process used in the previous step is designed to
provide a minimal \baseOS{} configuration. Next, we add additional components
to include resource management client services, NTP support, and
other additional packages to support the default \OHPC{} environment. This
process augments the chroot-based install performed by \texttt{wwmkchroot} to
modify the base provisioning image and will access the BOS and \OHPC{}
repositories to resolve package install requests. 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]
# Install compute node base meta-package
[sms](*\#*) (*\chrootinstall*) ohpc-base-compute
\end{lstlisting}
% end_ohpc_run

To access the remote
repositories by hostname (and not IP addresses), the chroot environment needs
to be updated to enable DNS resolution. Assuming that the {\em master} host has
a working DNS configuration in place, the chroot environment can be updated
with a copy of the configuration as follows:

% begin_ohpc_run
% ohpc_comment_header Add OpenHPC components to compute image \ref{sec:add_components}
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
[sms](*\#*) cp -p /etc/resolv.conf $CHROOT/etc/resolv.conf
\end{lstlisting}
% end_ohpc_run

\noindent Now, we can include additional required components to the compute
instance including resource manager client, NTP, and development environment modules support.

48 changes: 48 additions & 0 deletions docs/recipes/install/common/warewulf4_mkchroot_rocky.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
With the provisioning services enabled, the next step is to define and
customize a system image that can subsequently be used to provision one or more
{\em compute} nodes. The following subsections highlight this process.

\subsubsection{Build initial BOS image} \label{sec:assemble_bos}
The \OHPC{} build of \Warewulf{} includes specific enhancements enabling support for
\baseOS{}. The following steps illustrate the process to build a minimal, default
image for use with \Warewulf{}. We begin by defining a directory structure on the
{\em master} host that will represent the root filesystem of the compute node. The
default location for this example is in
\texttt{/opt/ohpc/admin/images/\baseos{}}.

\begin{center}
\begin{tcolorbox}[]
\small \Warewulf{} is configured by default to access an external
repository (download.rockylinux.org) during the \texttt{wwmkchroot} process. If
the master host cannot reach the public Rocky mirrors, or if you prefer to
access a locally cached mirror, set the \texttt{\$\{YUM\_MIRROR\}}
environment variable to your desired repo location {\em prior} to running
the \texttt{wwmkchroot} command below. For example:

% begin_ohpc_run
% ohpc_command if [ ! -z ${BOS_MIRROR+x} ]; then
% ohpc_indent 5
\begin{lstlisting}[language=bash,keywords={}]
# Override default OS repository (optional) - set YUM_MIRROR variable to desired repo location
[sms](*\#*) export YUM_MIRROR=${BOS_MIRROR}
\end{lstlisting}
% ohpc_indent 0
% ohpc_command fi
% end_ohpc_run

\end{tcolorbox}
\end{center}

% 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]
# Define chroot location
[sms](*\#*) export CHROOT=/opt/ohpc/admin/images/BOSVER

# Build initial chroot image
[sms](*\#*) wwmkchroot -v rocky-9 $CHROOT
# Enable OpenHPC and EPEL repos inside chroot
[sms](*\#*) dnf -y --installroot $CHROOT install epel-release
[sms](*\#*) cp -p /etc/yum.repos.d/OpenHPC*.repo $CHROOT/etc/yum.repos.d
\end{lstlisting}
% end_ohpc_run
15 changes: 15 additions & 0 deletions docs/recipes/install/common/warewulf4_setup.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
At this point, all of the packages necessary to use \Warewulf{} on the {\em
master} host should be installed. Next, we need to update several
configuration files in order to allow \Warewulf{} to work with \baseOS{} and to
support local provisioning using a second private interface (refer to
Figure~\ref{fig:physical_arch}).
%\vspace*{-0.05cm}
\begin{center}
\begin{tcolorbox}[]
\small
By default, \Warewulf{} is configured to
provision over the \texttt{eth1} interface and the steps below include updating
this setting to override with a potentially alternatively-named interface specified by
\texttt{\$\{sms\_eth\_internal\}}.
\end{tcolorbox}
\end{center}
21 changes: 21 additions & 0 deletions docs/recipes/install/common/warewulf4_setup_centos.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
% begin_ohpc_run
% ohpc_comment_header Complete basic Warewulf setup for master node \ref{sec:setup_ww}
%\begin{verbatim}

\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true,keepspaces]
# Configure Warewulf provisioning to use desired internal interface
[sms](*\#*) perl -pi -e "s/device = eth1/device = ${sms_eth_internal}/" /etc/warewulf/provision.conf

# Enable internal interface for provisioning
[sms](*\#*) ip link set dev ${sms_eth_internal} up
[sms](*\#*) ip address add ${sms_ip}/${internal_netmask} broadcast + dev ${sms_eth_internal}

# Restart/enable relevant services to support provisioning
[sms](*\#*) systemctl enable httpd.service
[sms](*\#*) systemctl restart httpd
[sms](*\#*) systemctl enable dhcpd.service
[sms](*\#*) systemctl enable tftp.socket
[sms](*\#*) systemctl start tftp.socket
\end{lstlisting}
%\end{verbatim}
% end_ohpc_run
24 changes: 24 additions & 0 deletions docs/recipes/install/rocky9/x86_64/warewulf4/slurm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
PAPER := steps.pdf
TEX_SUFS := .aux .log .nav .out .snm .toc .vrb .fdb_latexmk .bbl .blg .fls
GITID := $(shell git describe 2> /dev/null)

#$(info $$GITID is [${GITID}])


%.pdf:%.tex steps.tex manifest.tex $(wildcard common/*.tex common/ohpc-doc.sty common/base_edition/*.tex common/figures/*.pdf manifest/*.tex)
ifdef GITID
common/vc
else
test -s vc.tex || { echo "vc.tex file does not exist (and this is not a git repo)!"; exit 1; }
endif
latexmk -pdf $<

all: $(PAPER)

clean:
$(RM) $(foreach suf, ${TEX_SUFS}, $(PAPER:.pdf=${suf}))
ifdef GITID
$(RM) vc.tex
endif
$(RM) $(PAPER)

1 change: 1 addition & 0 deletions docs/recipes/install/rocky9/x86_64/warewulf4/slurm/common
Loading

0 comments on commit ad05f74

Please sign in to comment.