From 2d78d4eec93c7695b67e21a7ac3187a2be3e509d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Tue, 16 Jul 2024 14:30:47 +0300 Subject: [PATCH 1/2] feat(mergerfs): add extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will fix #396 Signed-off-by: Skyler Mäntysaari --- .kres.yaml | 1 + Pkgfile | 2 ++ storage/mergerfs/manifest.yaml | 10 +++++++++ storage/mergerfs/mergerfs.yaml | 15 ++++++++++++++ storage/mergerfs/pkg.yaml | 38 ++++++++++++++++++++++++++++++++++ storage/mergerfs/vars.yaml | 1 + 6 files changed, 67 insertions(+) create mode 100644 storage/mergerfs/manifest.yaml create mode 100644 storage/mergerfs/mergerfs.yaml create mode 100644 storage/mergerfs/pkg.yaml create mode 100644 storage/mergerfs/vars.yaml diff --git a/.kres.yaml b/.kres.yaml index 1881d262..2ced3477 100644 --- a/.kres.yaml +++ b/.kres.yaml @@ -22,6 +22,7 @@ spec: - iscsi-tools - kata-containers - mdadm + - mergerfs - nut-client - nvidia-container-toolkit - nvidia-fabricmanager diff --git a/Pkgfile b/Pkgfile index 8a991780..a4fd901c 100644 --- a/Pkgfile +++ b/Pkgfile @@ -12,6 +12,8 @@ vars: LIBTIRPC_VERSION: 1-3-3 # renovate: datasource=github-tags extractVersion=^v(?.*)$ depName=madler/zlib ZLIB_VERSION: 1.3.1 + # renovate: datasource=github-releases depName=trapexit/mergerfs + MERGERFS_VERSION: 2.40.2 labels: org.opencontainers.image.source: https://github.com/siderolabs/extensions diff --git a/storage/mergerfs/manifest.yaml b/storage/mergerfs/manifest.yaml new file mode 100644 index 00000000..16b00e2f --- /dev/null +++ b/storage/mergerfs/manifest.yaml @@ -0,0 +1,10 @@ +version: v1alpha1 +metadata: + name: mergerfs + version: "$VERSION" + author: Skyler Mäntysaari + description: | + mergerfs is a union filesystem geared towards simplifying storage and management of files across numerous commodity storage devices. + compatibility: + talos: + version: ">= v1.7.0" diff --git a/storage/mergerfs/mergerfs.yaml b/storage/mergerfs/mergerfs.yaml new file mode 100644 index 00000000..33993fb7 --- /dev/null +++ b/storage/mergerfs/mergerfs.yaml @@ -0,0 +1,15 @@ +name: mergerfs +depends: + - configuration: true +container: + entrypoint: /usr/local/bin/mergerfs + args: + - -o config=/usr/local/etc/mergerfs/config.ini + mounts: + - source: /var/mnt + destination: /var/mnt + type: bind + options: + - bind + - rw +restart: always diff --git a/storage/mergerfs/pkg.yaml b/storage/mergerfs/pkg.yaml new file mode 100644 index 00000000..521941ca --- /dev/null +++ b/storage/mergerfs/pkg.yaml @@ -0,0 +1,38 @@ +name: mergerfs +variant: scratch +shell: /toolchain/bin/bash +dependencies: + - stage: base +steps: + - sources: + # {{ if eq .ARCH "aarch64" }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr + - url: https://github.com/trapexit/mergerfs/releases/download/{{ .MERGERFS_VERSION }}/mergerfs-static-linux_arm64.tar.gz + destination: mergerfs-static.tar.gz + sha256: 5a487019b4da69c1401d5a3ec10003af2f68291a777a0358e758c420beea0771 + sha512: b6583f545c3d22541ae08513c3d8cfcda61a65a54cf3ab06b045ac62328d7ac526feb81926b809a1095a8c37016841ae2608293306201effc60ece6a5302e8af + # {{ else }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr + - url: https://github.com/trapexit/mergerfs/releases/download/{{ .MERGERFS_VERSION }}/mergerfs-static-linux_amd64.tar.gz + destination: mergerfs-static.tar.gz + sha256: 524c7ec093b2339c5e3e90cf9876a01d6aa93706279f89beb9cff5efa9f6ba72 + sha512: 24410f757f4cf2702ccb088dcceca147ce0e6a2f49c422e1898d1b7f5924d3037cb63243188e317492c8df5e1babccce84aa912d987f8362f8d97a2a3a8e1755 + # {{ end }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr + prepare: + - | + sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml + - | + mkdir -p /rootfs/usr/local/lib/containers/mergerfs + mkdir -p /rootfs/usr/local/etc/mergerfs + tar xf mergerfs-static.tar.gz -C /rootfs/usr/local/lib/containers/mergerfs + test: + - | + mkdir -p /extensions-validator-rootfs + cp -r /rootfs/ /extensions-validator-rootfs/rootfs + cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml + /extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}" +finalize: + - from: /rootfs + to: /rootfs + - from: /pkg/manifest.yaml + to: / + - from: /pkg/mergerfs.yaml + to: /rootfs/usr/local/etc/containers/ diff --git a/storage/mergerfs/vars.yaml b/storage/mergerfs/vars.yaml new file mode 100644 index 00000000..96b3abb2 --- /dev/null +++ b/storage/mergerfs/vars.yaml @@ -0,0 +1 @@ +VERSION: "{{ .MERGERFS_VERSION }}" From 70faedf9b3257db3da767b8724b56c8b24726a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Wed, 17 Jul 2024 05:24:57 +0300 Subject: [PATCH 2/2] chore(mergerfs): dependency on cri MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Skyler Mäntysaari --- Makefile | 5 +++-- storage/mergerfs/mergerfs.yaml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b33b1886..8458e291 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-07-04T10:11:27Z by kres 8c8b007. +# Generated on 2024-07-16T09:31:28Z by kres ac94478. # common variables @@ -13,7 +13,7 @@ IMAGE_TAG ?= $(TAG) OPERATING_SYSTEM := $(shell uname -s | tr '[:upper:]' '[:lower:]') GOARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/') REGISTRY ?= ghcr.io -USERNAME ?= siderolabs +USERNAME ?= skyssolutions REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest @@ -73,6 +73,7 @@ TARGETS += intel-ucode TARGETS += iscsi-tools TARGETS += kata-containers TARGETS += mdadm +TARGETS += mergerfs TARGETS += nut-client TARGETS += nvidia-container-toolkit TARGETS += nvidia-fabricmanager diff --git a/storage/mergerfs/mergerfs.yaml b/storage/mergerfs/mergerfs.yaml index 33993fb7..2a442342 100644 --- a/storage/mergerfs/mergerfs.yaml +++ b/storage/mergerfs/mergerfs.yaml @@ -1,5 +1,6 @@ name: mergerfs depends: + - service: cri - configuration: true container: entrypoint: /usr/local/bin/mergerfs