diff --git a/CHANGELOG.md b/CHANGELOG.md index e4073954..0592ef9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,6 +118,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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 ## [4.4.0] 2023-01-18 diff --git a/Makefile b/Makefile index 85d41cdd..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) @@ -133,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: 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 8f8db4c8..b3d34108 100644 --- a/Variables.mk +++ b/Variables.mk @@ -1,7 +1,7 @@ -include Defaults.mk # Linux distro (try and set to /etc/os-release ID) -OS_REL := $(shell sed -n "s/^ID\w*\s*=\s*['"\""]\(.*\)['"\""]/\1/p" /etc/os-release) +OS_REL := $(shell sed -n "s/^ID\s*=\s*['"\""]\(.*\)['"\""]/\1/p" /etc/os-release) OS ?= $(OS_REL) ARCH_REL := $(shell uname -p) @@ -26,16 +26,14 @@ else RELEASE ?= 1 endif -# Always default to GNU autotools default paths if PREFIX has been redefined -ifdef PREFIX - USE_LSB_PATHS := false -endif - # Use LSB-compliant paths if OS is known ifneq ($(OS),) USE_LSB_PATHS := true - PREFIX="/usr" - SYSCONFDIR="/etc" +endif + +# Always default to GNU autotools default paths if PREFIX has been redefined +ifdef PREFIX + USE_LSB_PATHS := false endif # System directory paths @@ -82,8 +80,7 @@ WWCLIENTDIR ?= /warewulf CONFIG := $(shell pwd) -# Get iPXE binaries from warewulf -IPXESOURCE ?= $(DATADIR)/$(WAREWULF)/ipxe +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/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 f6285655..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.Ipxesource, 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 be147938..318703fb 100644 --- a/warewulf.spec.in +++ b/warewulf.spec.in @@ -52,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} @@ -91,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 @@ -107,10 +110,10 @@ 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" = "ipxe/undionly.kpxe" | - .tftp.ipxe."00:07" = "ipxe/ipxe-x86_64.efi" | - .tftp.ipxe."00:09" = "ipxe/ipxe-x86_64.efi" | - .tftp.ipxe."00:0B" = "ipxe/snp-arm64.efi" ' \ + .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