SHA256
1
0
forked from pool/warewulf4

Accepting request 970201 from network:cluster

- update to v4.3.0rc2 with following major changes:
  * Provision interface is not tied to 'eth0' any more. The provision interface
    must be named 'default' now. The file `nodes.yaml' must be changed accordingly.
  * Creating of '/etc/exports' can now be disabled, so that wwctl configure -a
    wont overwrite a existing '/etc/exports'.
  * All configurations files for the host (/etc/exports, /etc/dhcpd.conf,
    /etc/hosts) are now populated from the
    (OVERLAYDIR/host/etc/{exports|dhcpd|hosts}.ww . Also other configuration
    files like prometheus.yml.ww or slurm.conf.ww which depend on the cluster
    nodes can be placed. Also the new templated functions {{ abort }}, 
    {{ IncludeBlock }} abd {{ no_backup }} are allowed now.
  * nodes and profiles can now have multiple system and runtime overlays, as a
    comma separated list.
  * The overlays of the profile and the nodes are combined.
  * Simple ipv6 support is now enabled. In warewulf.conf the option
    ipaddr6/Ipv6net must be set to enable ipv6. If enabled on of these options
    is set a node will get a derived ipv6 in the scheme ipv6net:ipaddr4. This
    address can also be overwritten for every node
  * Multiple files can now created from a single template.ww file with the {{ file FILENAME }}
    command in the template. The command is expanded to the magic template command
    {{ /* file FILENAME */}} which is picked up by wwctl and everything which comes after this
    magic comment will be written to the file FILENAME. This mechanism is leveraged in the
    configuration files for the network, see ifcfg.xml.ww and ifcgf.ww.
  * Networks can now have arbitrary keys value pairs in the profiles and on the node, so that
    things like bridges and mtu sizes can be set
  * The yaml format for nodes has now sub-keys for ipmi and kernel, old nodes.conf files have to
    to be changed accordingly
  * uids and gids of a container now get synced at import time, so that at least users with the
    same name have the same uid. This is not necessarily needed for warewulf, but services like
    munge.
  * backward compatibility for nodes.conf
  * added file:// uri for importing archived containers
- removed LocalStateDir-is-configureable-to-meet-FHS.patch as implemented upstream

OBS-URL: https://build.opensuse.org/request/show/970201
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/warewulf4?expand=0&rev=4
This commit is contained in:
Dominique Leuenberger 2022-04-14 15:26:06 +00:00 committed by Git OBS Bridge
commit c7d98cdae7
8 changed files with 153 additions and 183 deletions

View File

@ -1,128 +0,0 @@
From b670e183470c97e7fc0a266866ec3e9964084d12 Mon Sep 17 00:00:00 2001
From: Christian Goll <cgoll@suse.de>
Date: Wed, 21 Jul 2021 12:45:16 +0200
Subject: [PATCH] LocalStateDir is configureable to meet FHS
---
Makefile | 27 +++++++++++-----------
internal/app/wwctl/configure/nfs/main.go | 2 +-
internal/pkg/config/config.go | 16 ++++++++++---
internal/pkg/warewulfconf/datastructure.go | 1 +
4 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/Makefile b/Makefile
index 0babd54..7169b6c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
.PHONY: all
VERSION := 4.2.0
+LOCALSTATE ?= /var/warewulf/
# auto installed tooling
TOOLS_DIR := .tools
@@ -52,8 +53,8 @@ debian: all
files: all
install -d -m 0755 $(DESTDIR)/usr/bin/
- install -d -m 0755 $(DESTDIR)/var/warewulf/
- install -d -m 0755 $(DESTDIR)/var/warewulf/chroots
+ install -d -m 0755 $(DESTDIR)$(LOCALSTATE)/
+ install -d -m 0755 $(DESTDIR)$(LOCALSTATE)/chroots
install -d -m 0755 $(DESTDIR)/etc/warewulf/
install -d -m 0755 $(DESTDIR)/etc/warewulf/ipxe
install -d -m 0755 $(DESTDIR)/var/lib/tftpboot/warewulf/ipxe/
@@ -63,12 +64,12 @@ files: all
test -f $(DESTDIR)/etc/warewulf/hosts.tmpl || install -m 644 etc/hosts.tmpl $(DESTDIR)/etc/warewulf/
cp -r etc/dhcp $(DESTDIR)/etc/warewulf/
cp -r etc/ipxe $(DESTDIR)/etc/warewulf/
- cp -r overlays $(DESTDIR)/var/warewulf/
- chmod +x $(DESTDIR)/var/warewulf/overlays/system/default/init
- chmod 600 $(DESTDIR)/var/warewulf/overlays/system/default/etc/ssh/ssh*
- chmod 644 $(DESTDIR)/var/warewulf/overlays/system/default/etc/ssh/ssh*.pub.ww
- mkdir -p $(DESTDIR)/var/warewulf/overlays/system/default/warewulf/bin/
- cp wwclient $(DESTDIR)/var/warewulf/overlays/system/default/warewulf/bin/
+ cp -r overlays $(DESTDIR)$(LOCALSTATE)/
+ chmod +x $(DESTDIR)$(LOCALSTATE)/overlays/system/default/init
+ chmod 600 $(DESTDIR)$(LOCALSTATE)/overlays/system/default/etc/ssh/ssh*
+ chmod 644 $(DESTDIR)$(LOCALSTATE)/overlays/system/default/etc/ssh/ssh*.pub.ww
+ mkdir -p $(DESTDIR)$(LOCALSTATE)/overlays/system/default/warewulf/bin/
+ cp wwclient $(DESTDIR)$(LOCALSTATE)/overlays/system/default/warewulf/bin/
cp wwctl $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/lib/firewalld/services
install -c -m 0644 include/firewalld/warewulf.xml $(DESTDIR)/usr/lib/firewalld/services
@@ -82,11 +83,11 @@ files: all
# restorecon -r /var/lib/tftpboot/warewulf
debfiles: debian
- chmod +x $(DESTDIR)/var/warewulf/overlays/system/debian/init
- chmod 600 $(DESTDIR)/var/warewulf/overlays/system/debian/etc/ssh/ssh*
- chmod 644 $(DESTDIR)/var/warewulf/overlays/system/debian/etc/ssh/ssh*.pub.ww
- mkdir -p $(DESTDIR)/var/warewulf/overlays/system/debian/warewulf/bin/
- cp wwclient $(DESTDIR)/var/warewulf/overlays/system/debian/warewulf/bin/
+ chmod +x $(DESTDIR)$(LOCALSTATE)/overlays/system/debian/init
+ chmod 600 $(DESTDIR)$(LOCALSTATE)/overlays/system/debian/etc/ssh/ssh*
+ chmod 644 $(DESTDIR)$(LOCALSTATE)/overlays/system/debian/etc/ssh/ssh*.pub.ww
+ mkdir -p $(DESTDIR)$(LOCALSTATE)/overlays/system/debian/warewulf/bin/
+ cp wwclient $(DESTDIR)$(LOCALSTATE)/overlays/system/debian/warewulf/bin/
wwctl:
cd cmd/wwctl; GOOS=linux go build -mod vendor -tags "$(WW_BUILD_GO_BUILD_TAGS)" -o ../../wwctl
diff --git a/internal/app/wwctl/configure/nfs/main.go b/internal/app/wwctl/configure/nfs/main.go
index 7827b24..4657f66 100644
--- a/internal/app/wwctl/configure/nfs/main.go
+++ b/internal/app/wwctl/configure/nfs/main.go
@@ -40,7 +40,7 @@ func Configure(show bool) error {
}
defer exports.Close()
- fstab, err := os.OpenFile("/var/warewulf/overlays/system/default/etc/fstab", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
+ fstab, err := os.OpenFile(fmt.Sprintf("%s/overlays/system/default/etc/fstab",controller.LocalStateDir), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
wwlog.Printf(wwlog.ERROR, "%s\n", err)
os.Exit(1)
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index 34a9f00..c08221d 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -6,11 +6,21 @@ import (
"github.com/hpcng/warewulf/internal/pkg/util"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
+ "github.com/hpcng/warewulf/internal/pkg/warewulfconf"
)
-const (
- LocalStateDir = "/var/warewulf"
-)
+var LocalStateDir = "/var/warewulf"
+
+func init() {
+ conf, err := warewulfconf.New()
+ if err != nil {
+ wwlog.Printf(wwlog.ERROR, "%s\n", err)
+ return
+ }
+ if conf.LocalStateDir != "" {
+ LocalStateDir = conf.LocalStateDir
+ }
+}
func OverlayDir() string {
return fmt.Sprintf("%s/overlays/", LocalStateDir)
diff --git a/internal/pkg/warewulfconf/datastructure.go b/internal/pkg/warewulfconf/datastructure.go
index 8315ddd..a688617 100644
--- a/internal/pkg/warewulfconf/datastructure.go
+++ b/internal/pkg/warewulfconf/datastructure.go
@@ -13,6 +13,7 @@ type ControllerConf struct {
Netmask string `yaml:"netmask"`
Network string `yaml:"network,omitempty"`
Fqdn string `yaml:"fqdn,omitempty"`
+ LocalStateDir string `yaml:"localstatedir"`
Warewulf *WarewulfConf `yaml:"warewulf"`
Dhcp *DhcpConf `yaml:"dhcp"`
Tftp *TftpConf `yaml:"tftp"`
--
2.33.0

5
_service Normal file
View File

@ -0,0 +1,5 @@
<services>
<service name="go_modules" mode="disabled">
</service>
</services>

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65783e69b83be9ce0a2bede542ae5983b23c15994c8e4487ed83adb1c1745808
size 3526332
oid sha256:d7f581d6646f04eaca87287ff924a728e345cbcf331e4f9972990276cb7a5840
size 4839581

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8c1ea8284584374011c6125cf0100f2ab1dbe7d7b9eeb4bc979b9a9766db6bd6
size 1298057

View File

@ -1,23 +0,0 @@
ipaddr: 10.10.93.254
netmask: 255.255.255.0
localstatedir: /var/lib/warewulf
warewulf:
port: 9873
secure: true
update interval: 60
dhcp:
enabled: true
range start: 10.10.93.10
range end: 10.10.93.250
template: default
systemd name: dhcpd
config file: /etc/dhcpd.conf
tftp:
enabled: true
tftproot: /srv/tftpboot
systemd name: tftp
nfs:
systemd name: nfs-server
exports:
- /home
- /var/lib/warewulf

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:defeaa11a95214d1da4886b4418d75c3596f51a512b63cd04a2fd0a4f01f0340
size 945584

View File

@ -1,3 +1,40 @@
-------------------------------------------------------------------
Thu Apr 14 13:18:23 UTC 2022 - Christian Goll <cgoll@suse.com>
- update to v4.3.0rc2 with following major changes:
* Provision interface is not tied to 'eth0' any more. The provision interface
must be named 'default' now. The file `nodes.yaml' must be changed accordingly.
* Creating of '/etc/exports' can now be disabled, so that wwctl configure -a
wont overwrite a existing '/etc/exports'.
* All configurations files for the host (/etc/exports, /etc/dhcpd.conf,
/etc/hosts) are now populated from the
(OVERLAYDIR/host/etc/{exports|dhcpd|hosts}.ww . Also other configuration
files like prometheus.yml.ww or slurm.conf.ww which depend on the cluster
nodes can be placed. Also the new templated functions {{ abort }},
{{ IncludeBlock }} abd {{ no_backup }} are allowed now.
* nodes and profiles can now have multiple system and runtime overlays, as a
comma separated list.
* The overlays of the profile and the nodes are combined.
* Simple ipv6 support is now enabled. In warewulf.conf the option
ipaddr6/Ipv6net must be set to enable ipv6. If enabled on of these options
is set a node will get a derived ipv6 in the scheme ipv6net:ipaddr4. This
address can also be overwritten for every node
* Multiple files can now created from a single template.ww file with the {{ file FILENAME }}
command in the template. The command is expanded to the magic template command
{{ /* file FILENAME */}} which is picked up by wwctl and everything which comes after this
magic comment will be written to the file FILENAME. This mechanism is leveraged in the
configuration files for the network, see ifcfg.xml.ww and ifcgf.ww.
* Networks can now have arbitrary keys value pairs in the profiles and on the node, so that
things like bridges and mtu sizes can be set
* The yaml format for nodes has now sub-keys for ipmi and kernel, old nodes.conf files have to
to be changed accordingly
* uids and gids of a container now get synced at import time, so that at least users with the
same name have the same uid. This is not necessarily needed for warewulf, but services like
munge.
* backward compatibility for nodes.conf
* added file:// uri for importing archived containers
- removed LocalStateDir-is-configureable-to-meet-FHS.patch as implemented upstream
-------------------------------------------------------------------
Thu Oct 28 07:00:53 UTC 2021 - Christian Goll <cgoll@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package warewulf4
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,45 +16,47 @@
#
%global provider github
%global provider_tld com
%global project hpcng
%global repo warewulf
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
ExclusiveArch: x86_64 aarch64
Name: warewulf4
Version: 4.2.0
Version: 4.3.0rc2
Release: 0
Summary: A suite of tools for clustering
License: BSD-3-Clause
Group: Productivity/Clustering/Computing
URL: https://warewulf.hpcng.org/docs/
Source0: https://github.com/hpcng/warewulf/archive/v%{version}.tar.gz#/warewulf-%{version}.tar.gz
URL: https://warewulf.org
Source0: https://github.com/hpcng/warewulf/archive/v%{version}.tar.gz#/warewulf4-v%{version}.tar.gz
Source1: vendor.tar.gz
Source2: warewulf.conf
Source3: warewulf4-rpmlintrc
#Patch1: overlay-host.patch
# no firewalld in sle12
%if 0%{?sle_version} >= 150000 || 0%{?suse_version} > 1500
BuildRequires: firewalld
%endif
BuildRequires: dracut
BuildRequires: go >= 1.15
BuildRequires: golang-packaging
BuildRequires: libgpgme-devel
BuildRequires: make
BuildRequires: munge
BuildRequires: sysuser-tools
BuildRequires: tftp
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Patch0: LocalStateDir-is-configureable-to-meet-FHS.patch
Requires: %{name}-ipxe
Requires: %{name}-overlay
Requires: dhcp-server
Requires: ipmitool
Requires: tftp
Requires: nfs-kernel-server
%{go_nostrip}
%description
Warewulf v4 combines ultra scalability, flexibility, and simplicity with being light weight, non-intrusive, and a great tool for scientists and seasoned system administrators alike. Warewulf empowers you to scalably and easily manage thousands of compute resources.
Warewulf v4 combines ultra scalability, flexibility, and simplicity with being
light weight, non-intrusive, and a great tool for scientists and seasoned
system administrators alike. Warewulf empowers you to scalably and easily
manage thousands of compute resources.
%package overlay
# Smells like a circular dependcy, but needed in this case as the
@ -66,30 +68,82 @@ Group: Productivity/Clustering/Computing
%description overlay
Includes the default overlays so that they can be updated seprately.
%package ipxe
Requires: tftp
Summary: Binaries of iPXE for ww4 installation
BuildArch: noarch
%description ipxe
For the boot of the nodes iPXE binaries are needed. As these package includes these files for
x86, i386 and ARM.
%package slurm
Summary: Configuration template for slurm
Requires: %{name} = %{version}
Requires: slurm
%description slurm
This package install the necessary configuration files in order to run a slurm
cluster on the configured warewulf nodes.
%prep
%setup -q -n warewulf-%{version}
%setup -q -D -T -a 1 -n warewulf-%{version}
# extract the vendor stuff
tar xzf %{S:1}
%autopatch -p1
%build
%goprep %{import_path}
make %{?_smp_mflags}
%global tftpdir /srv/tftpboot
make %{?_smp_mflags} genconfig \
PREFIX=%{_prefix} \
BINDIR=%{_bindir} \
SYSCONFDIR=%{_sysconfdir} \
DATADIR=%{_datadir} \
LOCALSTATEDIR=%{_sharedstatedir} \
SHAREDSTATEDIR=%{_sharedstatedir} \
MANDIR=%{_mandir} \
INFODIR=%{_infodir} \
DOCDIR=%{_docdir} \
SRVDIR=%{_sharedstatedir} \
TFTPDIR=%{tftpdir} \
SYSTEMDDIR=%{_unitdir} \
BASHCOMPDIR=%{_datadir}/bash-completion/completions/ \
FIREWALLDDIR=/usr/lib/firewalld/services \
WWCLIENTDIR=/warewulf
%install
LOCALSTATE=%{_localstatedir}/lib/warewulf/ %{makeinstall}
# we have a broken symlink for wwclient
export NO_BRP_STALE_LINK_ERROR=yes
%{makeinstall}
# cleanup
mkdir -p %{buildroot}%{_sbindir}/
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcwarewulfd
chmod 755 %{buildroot}%{_localstatedir}/lib/warewulf/overlays/system/default/warewulf/init.d/*
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions/
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
mv -v %{buildroot}%{_sysconfdir}/bash_completion.d/warewulf %{buildroot}%{_datadir}/bash-completion/completions/wwctl
cp %{S:2} %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
#cp %{S:2} %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
#rm -rf %{buildroot}%{_datadir}/warewulf/ipxe
rm -f %{buildroot}/usr/share/doc/packages/warewulf/LICENSE.md
# create systemuser
echo "u warewulf -" > system-user-%{name}.conf
echo "g warewulf -" >> system-user-%{name}.conf
%sysusers_generate_pre system-user-%{name}.conf %{name} system-user-%{name}.conf
install -D -m 644 system-user-%{name}.conf %{buildroot}%{_sysusersdir}/system-user-%{name}.conf
# get the slurm package readay
mkdir -p %{buildroot}%{_localstatedir}/lib/warewulf/overlays/host/etc/slurm
mv %{buildroot}%{_sysconfdir}/warewulf/examples/slurm.conf.ww %{buildroot}%{_localstatedir}/lib/warewulf/overlays/host/etc/slurm
mkdir -p %{buildroot}%{_localstatedir}/lib/warewulf/overlays/generic/etc/munge
cat > %{buildroot}%{_localstatedir}/lib/warewulf/overlays/generic/etc/munge/munge.key.ww <<EOF
{{ Include "/etc/munge/munge.key" -}}
EOF
chmod 600 %{buildroot}%{_localstatedir}/lib/warewulf/overlays/generic/etc/munge/munge.key.ww
mkdir -p %{buildroot}%{_localstatedir}/lib/warewulf/overlays/generic/etc/slurm
cat > %{buildroot}%{_localstatedir}/lib/warewulf/overlays/generic/etc/slurm/slurm.conf.ww <<EOF
{{ Include "/etc/slurm/slurm.conf" }}
EOF
%pre -f %{name}.pre
%service_add_pre warewulfd.service
@ -104,20 +158,28 @@ install -D -m 644 system-user-%{name}.conf %{buildroot}%{_sysusersdir}/system-us
%files
%defattr(-,root,root)
%doc README.md LICENSE.md
%doc README.md
%license LICENSE.md
%attr(0755, root, warewulf) %dir %{_sysconfdir}/warewulf
%attr(0755, root, warewulf) %dir %{_sysconfdir}/warewulf/dhcp
%attr(0755, root, warewulf) %dir %{_sysconfdir}/warewulf/examples
%attr(0755, root, warewulf) %dir %{_sysconfdir}/warewulf/ipxe
%{_datadir}/bash-completion/completions/wwctl
%{_mandir}/man1/wwctl*1.gz
%config(noreplace) %{_sysconfdir}/warewulf/nodes.conf
%config(noreplace) %{_sysconfdir}/warewulf/warewulf.conf
%config(noreplace) %{_sysconfdir}/warewulf/hosts.tmpl
%config(noreplace) %{_sysconfdir}/warewulf/dhcp/*.conf
#%config(noreplace) %{_sysconfdir}/warewulf/wwapic.conf
#%config(noreplace) %{_sysconfdir}/warewulf/wwapid.conf
#%config(noreplace) %{_sysconfdir}/warewulf/wwapird.conf
%config(noreplace) %{_sysconfdir}/warewulf/ipxe/*.ipxe
%{_sysconfdir}/warewulf/examples
%{_prefix}/lib/firewalld/services/warewulf.xml
%{_localstatedir}/lib/warewulf
%exclude %{_localstatedir}/lib/warewulf/overlays
%{_bindir}/wwctl
#%{_bindir}/wwapic
#%{_bindir}/wwapid
#%{_bindir}/wwapird
%{_sbindir}/rcwarewulfd
%{_unitdir}/warewulfd.service
%{_sysusersdir}/system-user-%{name}.conf
@ -127,5 +189,22 @@ install -D -m 644 system-user-%{name}.conf %{buildroot}%{_sysusersdir}/system-us
# nodes, so when modified we do not replace them as sensible
# admin will read the changelog
%config(noreplace) %{_localstatedir}/lib/warewulf/overlays
%exclude %{_localstatedir}/lib/warewulf/overlays/host/etc/slurm
%exclude %{_localstatedir}/lib/warewulf/overlays/generic/etc/slurm
%exclude %{_localstatedir}/lib/warewulf/overlays/generic/etc/munge
%files ipxe
/srv/tftpboot/warewulf
%{_datadir}/warewulf
%files slurm
%dir %{_localstatedir}/lib/warewulf/overlays/host/etc/slurm
%{_localstatedir}/lib/warewulf/overlays/host/etc/slurm/slurm.conf.ww
%dir %{_localstatedir}/lib/warewulf/overlays/generic/etc/slurm
%{_localstatedir}/lib/warewulf/overlays/generic/etc/slurm/slurm.conf.ww
%dir %{_localstatedir}/lib/warewulf/overlays/generic/etc/munge
%{_localstatedir}/lib/warewulf/overlays/generic/etc/munge/munge.key.ww
%dir %attr(0700,munge,munge) %{_localstatedir}/lib/warewulf/overlays/generic/etc/munge
%attr(0600,munge,munge) %config(noreplace) %{_localstatedir}/lib/warewulf/overlays/generic/etc/munge/munge.key.ww
%changelog