diff --git a/CHANGELOG.md b/CHANGELOG.md index 83f0a9c4..70280717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - only write IPMI if write is true - Don't show an error if image files for containers can't be found. #933 - Make configured paths available in overlays as `.Path` #960 +- Introduced IPXESOURCE environment variable which allows to specify the path to iPXE + binaries not provided by warewulf +- use distrubtion ipxe binaries in the rpm +- Allow absolute iPXE paths in warewulf.conf - Support importing containers with symlinked `/bin/sh` #797 - Don't panic on malformed passwd #527 diff --git a/Makefile b/Makefile index aaedba30..4ef5a5bf 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ etc/bash_completion.d/wwctl: wwctl .PHONY: lint lint: $(config) - $(GOLANGCI_LINT) run --build-tags "$(WW_GO_BUILD_TAGS)" --skip-dirs internal/pkg/staticfiles --timeout=5m ./... + $(GOLANGCI_LINT) run --build-tags "$(WW_GO_BUILD_TAGS)" --timeout=5m ./... .PHONY: vet vet: $(config) @@ -102,7 +102,8 @@ install: build docs install -d -m 0755 $(DESTDIR)$(WWDOCDIR) install -d -m 0755 $(DESTDIR)$(FIREWALLDDIR) install -d -m 0755 $(DESTDIR)$(SYSTEMDDIR) - install -d -m 0755 $(DESTDIR)$(WWDATADIR)/ipxe + install -d -m 0755 $(DESTDIR)$(IPXESOURCE) + install -d -m 0755 $(DESTDIR)$(DATADIR)/warewulf test -f $(DESTDIR)$(WWCONFIGDIR)/warewulf.conf || install -m 0644 etc/warewulf.conf $(DESTDIR)$(WWCONFIGDIR) test -f $(DESTDIR)$(WWCONFIGDIR)/nodes.conf || install -m 0644 etc/nodes.conf $(DESTDIR)$(WWCONFIGDIR) test -f $(DESTDIR)$(WWCONFIGDIR)/wwapic.conf || install -m 0644 etc/wwapic.conf $(DESTDIR)$(WWCONFIGDIR) @@ -132,10 +133,6 @@ install: build docs install -m 0644 etc/bash_completion.d/wwctl $(DESTDIR)$(BASHCOMPDIR)/wwctl for f in docs/man/man1/*.1.gz; do install -m 0644 $$f $(DESTDIR)$(MANDIR)/man1/; done for f in docs/man/man5/*.5.gz; do install -m 0644 $$f $(DESTDIR)$(MANDIR)/man5/; done - install -m 0644 staticfiles/README-ipxe.md $(DESTDIR)$(WWDATADIR)/ipxe - install -m 0644 staticfiles/arm64.efi $(DESTDIR)$(WWDATADIR)/ipxe - install -m 0644 staticfiles/x86_64.efi $(DESTDIR)$(WWDATADIR)/ipxe - install -m 0644 staticfiles/x86_64.kpxe $(DESTDIR)$(WWDATADIR)/ipxe .PHONY: init init: @@ -147,7 +144,7 @@ init: dist: rm -rf .dist/ $(WAREWULF)-$(VERSION).tar.gz mkdir -p .dist/$(WAREWULF)-$(VERSION) - rsync -a --exclude=".*" --exclude "*~" * .dist/$(WAREWULF)-$(VERSION)/ + rsync -a --exclude=".github" --exclude=".vscode" --exclude "*~" * .dist/$(WAREWULF)-$(VERSION)/ cd .dist; tar -czf ../$(WAREWULF)-$(VERSION).tar.gz $(WAREWULF)-$(VERSION) rm -rf .dist diff --git a/README.md b/README.md index 2100a7b2..0ee8c705 100644 --- a/README.md +++ b/README.md @@ -13,36 +13,69 @@ ## About Warewulf ### History -For over two decades, Warewulf has powered HPC systems around the world. From simple “under the desk” clusters to large -institutional systems at HPC centers as well as enterprises who rely on performance critical computing. -Through the evolution of Warewulf, we have seen various iterations provisioning models starting from CDROM / ISO images -to Etherboot (predecessor to PXE), then PXE, and more recently iPXE, but even during these different bootloaders, -Warewulf in it’s heart, has always been first and foremost a stateless provisioning system (e.g. the operating system -node image is not written to any persistent storage and rather it boots from the network directly into a runtime -system). +For over two decades, Warewulf has powered HPC systems around the +world. From simple “under the desk” clusters to large institutional +systems at HPC centers as well as enterprises who rely on performance +critical computing. -Warewulf v3 has been in production for over 6 years now as it has stabilized into a very solid and full featured -solution. But over the last few years, there have been many innovations in Enterprise technologies which can (and -should) be leveraged as part of Warewulf. Additionally, some of the lessons learned from Warewulf v3 architecture -should be rolled into an updated architecture for provisioning management. +Through the evolution of Warewulf, we have seen various iterations +provisioning models starting from CDROM / ISO images to Etherboot +(predecessor to PXE), then PXE, and more recently iPXE, but even +during these different bootloaders, Warewulf in it’s heart, has always +been first and foremost a stateless provisioning system (e.g. the +operating system node image is not written to any persistent storage +and rather it boots from the network directly into a runtime system). + +Warewulf v3 has been in production for over 6 years now as it has +stabilized into a very solid and full featured solution. But over the +last few years, there have been many innovations in Enterprise +technologies which can (and should) be leveraged as part of +Warewulf. Additionally, some of the lessons learned from Warewulf v3 +architecture should be rolled into an updated architecture for +provisioning management. ### Warewulf v4 -Leveraging this legacy of provisioning and cluster management brings us to where we are today. The next generation -of Warewulf. Warewulf v4 is a complete rewrite in GoLang, taking in the legacy of what we've come to expect with -Warewulf, bringing it into the present, and looking out into the future. -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. +Leveraging this legacy of provisioning and cluster management brings +us to where we are today. The next generation of Warewulf. Warewulf v4 +is a complete rewrite in GoLang, taking in the legacy of what we've +come to expect with Warewulf, bringing it into the present, and +looking out into the future. + +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. ### Architecture -One of the design tenants of Warewulf is how to scalably administrate many thousands of compute nodes. Generally -speaking, operating system state introduce a surface for potential discrepancies and version creep between nodes and -thus Warewulf has always gone with the "single system image" approach to clustered operating system management. -This means that you can have a single management node "image". For the last 20 years, we've been calling this a -Virtual Node File System (VNFS), but in hindsight, this is a container. -At its core, Warewulf v4 focuses on what has made Warewulf so widely loved: simplicity, ultra scalable, lightweight, -and an easy to manage solution built for both scientists and seasons system administrators to be able to design a -highly functional yet easy to maintain cluster no matter how big or small or customized it needs to be. +One of the design tenants of Warewulf is how to scalably administrate +many thousands of compute nodes. Generally speaking, operating system +state introduce a surface for potential discrepancies and version +creep between nodes and thus Warewulf has always gone with the "single +system image" approach to clustered operating system management. This +means that you can have a single management node "image". For the last +20 years, we've been calling this a Virtual Node File System (VNFS), +but in hindsight, this is a container. + +At its core, Warewulf v4 focuses on what has made Warewulf so widely +loved: simplicity, ultra scalable, lightweight, and an easy to manage +solution built for both scientists and seasons system administrators +to be able to design a highly functional yet easy to maintain cluster +no matter how big or small or customized it needs to be. + +## iPXE + +Warewulf uses iPXE for network boot. Typically iPXE is provided by the +operating system; but the iPXE binaries can be rebuilt with the +`ipxe-update.sh` script. This script accepts command-line arguments +that are passed to the underlying `make` process. e.g., + +```bash +echo "#!ipxe +echo Tagging with vlan 1000 +vcreate --tag 1000 net0 autoboot || shell" >vlan-1000.ipxe + +sh ipxe-update.sh EMBED=$(readlink -f vlan-1000.ipxe) +``` diff --git a/Variables.mk b/Variables.mk index c405e450..b3d34108 100644 --- a/Variables.mk +++ b/Variables.mk @@ -37,7 +37,7 @@ ifdef PREFIX endif # System directory paths -VARLIST += PREFIX BINDIR SYSCONFDIR SRVDIR DATADIR MANDIR DOCDIR LOCALSTATEDIR +VARLIST += PREFIX BINDIR SYSCONFDIR SRVDIR DATADIR MANDIR DOCDIR LOCALSTATEDIR RELEASE PREFIX ?= /usr/local BINDIR ?= $(PREFIX)/bin SYSCONFDIR ?= $(PREFIX)/etc @@ -68,7 +68,7 @@ endif TFTPDIR ?= /var/lib/tftpboot # Warewulf directory paths -VARLIST += WWCLIENTDIR WWCONFIGDIR WWPROVISIONDIR WWOVERLAYDIR WWCHROOTDIR WWTFTPDIR WWDOCDIR WWDATADIR +VARLIST += WWCLIENTDIR WWCONFIGDIR WWPROVISIONDIR WWOVERLAYDIR WWCHROOTDIR WWTFTPDIR WWDOCDIR WWDATADIR IPXESOURCE WWCONFIGDIR := $(SYSCONFDIR)/$(WAREWULF) WWPROVISIONDIR := $(LOCALSTATEDIR)/$(WAREWULF)/provision WWOVERLAYDIR := $(LOCALSTATEDIR)/$(WAREWULF)/overlays @@ -80,6 +80,8 @@ WWCLIENTDIR ?= /warewulf CONFIG := $(shell pwd) +IPXESOURCE ?= $(PREFIX)/share/ipxe + # helper functions godeps=$(shell go list -mod vendor -deps -f '{{if not .Standard}}{{ $$dep := . }}{{range .GoFiles}}{{$$dep.Dir}}/{{.}} {{end}}{{end}}' $(1) | sed "s%${PWD}/%%g") diff --git a/etc/warewulf.conf b/etc/warewulf.conf index a5b9a346..0ab38da9 100644 --- a/etc/warewulf.conf +++ b/etc/warewulf.conf @@ -17,6 +17,11 @@ dhcp: tftp: enabled: true systemd name: tftp + ipxe: + 00:09: ipxe-snponly-x86_64.efi + 00:00: undionly.kpxe + 00:0B: arm64-efi/snponly.efi + 00:07: ipxe-snponly-x86_64.efi nfs: enabled: true export paths: diff --git a/internal/pkg/config/buildconfig.go.in b/internal/pkg/config/buildconfig.go.in index 5316e518..125f192f 100644 --- a/internal/pkg/config/buildconfig.go.in +++ b/internal/pkg/config/buildconfig.go.in @@ -7,6 +7,7 @@ type BuildConfig struct { Sysconfdir string `default:"@SYSCONFDIR@"` Datadir string `default:"@DATADIR@"` Localstatedir string `default:"@LOCALSTATEDIR@"` + Ipxesource string `default:"@IPXESOURCE@"` Srvdir string `default:"@SRVDIR@"` Tftpdir string `default:"@TFTPDIR@"` Firewallddir string `default:"@FIREWALLDDIR@"` diff --git a/internal/pkg/config/tftp.go b/internal/pkg/config/tftp.go index 78f8d2aa..bdbfeeba 100644 --- a/internal/pkg/config/tftp.go +++ b/internal/pkg/config/tftp.go @@ -7,6 +7,5 @@ type TFTPConf struct { TftpRoot string `yaml:"tftproot" default:"/var/lib/tftpboot"` SystemdName string `yaml:"systemd name" default:"tftp"` - // Path is relative to buildconfig.DATADIR() IpxeBinaries map[string]string `yaml:"ipxe" default:"{\"00:09\": \"ipxe/ipxe-snponly-x86_64.efi\",\"00:00\": \"ipxe/undionly.kpxe\",\"00:0B\": \"ipxe/arm64-efi/snponly.efi\",\"00:07\": \"ipxe/ipxe-snponly-x86_64.efi\"}"` } diff --git a/internal/pkg/configure/tftp.go b/internal/pkg/configure/tftp.go index 71d7719c..82e023f3 100644 --- a/internal/pkg/configure/tftp.go +++ b/internal/pkg/configure/tftp.go @@ -23,11 +23,14 @@ func TFTP() error { fmt.Printf("Writing PXE files to: %s\n", tftpdir) copyCheck := make(map[string]bool) for _, f := range controller.TFTP.IpxeBinaries { + if !path.IsAbs(f) { + f = path.Join(controller.Paths.Ipxesource, f) + } if copyCheck[f] { continue } copyCheck[f] = true - err = util.SafeCopyFile(path.Join(controller.Paths.Datadir, f), path.Join(tftpdir, path.Base(f))) + err = util.SafeCopyFile(f, path.Join(tftpdir, path.Base(f))) if err != nil { wwlog.Warn("ipxe binary could not be copied, booting may not work: %s", err) } diff --git a/ipxe-update.sh b/ipxe-update.sh index e7af33ea..1db450a5 100755 --- a/ipxe-update.sh +++ b/ipxe-update.sh @@ -8,8 +8,8 @@ ARCH=x86_64 PCBIOS=bin-${ARCH}-pcbios/undionly.kpxe EFI=bin-${ARCH}-efi/ipxe.efi -PCBIOS_output=`pwd`/staticfiles/${ARCH}.kpxe -EFI_output=`pwd`/staticfiles/${ARCH}.efi +PCBIOS_output=${ARCH}.kpxe +EFI_output=${ARCH}.efi SYSBIOS="/usr/share/ipxe/undionly.kpxe" SYSEFI="/usr/share/ipxe/ipxe-${ARCH}.efi" diff --git a/staticfiles/README-ipxe.md b/staticfiles/README-ipxe.md deleted file mode 100644 index 19df4ed7..00000000 --- a/staticfiles/README-ipxe.md +++ /dev/null @@ -1,19 +0,0 @@ -# Warewulf-provided iPXE binaries - -- `arm64.efi` - EFI support for `arm64` processors -- `x86_64.efi` - EFI support for `x86_64` processors -- `x86_64.kpxe` - legacy BIOS support for `x86_64` processors - -## Rebuilding - -The iPXE binaries can be rebuilt with the `ipxe-update.sh` -script. This script accepts command-line arguments that are passed to -the underlying `make` process. e.g., - -```bash -echo "#!ipxe -echo Tagging with vlan 1000 -vcreate --tag 1000 net0 autoboot || shell" >vlan-1000.ipxe - -sh ipxe-update.sh EMBED=$(readlink -f vlan-1000.ipxe) -``` diff --git a/staticfiles/README.md b/staticfiles/README.md deleted file mode 100644 index 01c2460d..00000000 --- a/staticfiles/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Warewulf-bundled static files - -These files are bundled statically with Warewulf 4. - -See also: [README-ipxe.md](README-ipxe.md) diff --git a/staticfiles/arm64.efi b/staticfiles/arm64.efi deleted file mode 100644 index e786fed7..00000000 Binary files a/staticfiles/arm64.efi and /dev/null differ diff --git a/staticfiles/x86_64.efi b/staticfiles/x86_64.efi deleted file mode 100644 index 5a3e3638..00000000 Binary files a/staticfiles/x86_64.efi and /dev/null differ diff --git a/staticfiles/x86_64.kpxe b/staticfiles/x86_64.kpxe deleted file mode 100644 index 51264c12..00000000 Binary files a/staticfiles/x86_64.kpxe and /dev/null differ diff --git a/warewulf.spec.in b/warewulf.spec.in index 83ad5034..318703fb 100644 --- a/warewulf.spec.in +++ b/warewulf.spec.in @@ -39,9 +39,11 @@ BuildRequires: go >= 1.16 BuildRequires: firewall-macros BuildRequires: firewalld BuildRequires: tftp +BuildRequires: yq Requires: tftp Requires: nfs-kernel-server Requires: firewalld +Requires: ipxe-bootimgs %else # Assume Red Hat/Fedora build BuildRequires: system-release @@ -50,6 +52,8 @@ BuildRequires: golang >= 1.16 BuildRequires: firewalld-filesystem Requires: tftp-server Requires: nfs-utils +Requires: ipxe-bootimgs-x86 +Requires: ipxe-bootimgs-aarch64 %endif %if 0%{?rhel} >= 8 || 0%{?suse_version} || 0%{?fedora} @@ -89,7 +93,8 @@ make defaults \ SYSTEMDDIR=%{_unitdir} \ BASHCOMPDIR=/etc/bash_completion.d/ \ FIREWALLDDIR=/usr/lib/firewalld/services \ - WWCLIENTDIR=/warewulf + WWCLIENTDIR=/warewulf \ + IPXESOURCE=/usr/share/ipxe make @@ -102,6 +107,15 @@ make install \ %pre getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup} +# use ipxe images from the distribution +%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 %post