From 76c331e5303b8458d79afb0122b4901f9c93324a Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 13 Jul 2025 16:48:22 +1000 Subject: [PATCH 1/2] feat: split vmagent out of vmutils - move vmagent to be its own package --- rpms/vmagent/1.119.0/release | 1 + rpms/vmagent/Dockerfile | 23 ++++++++++++++++++++ rpms/vmagent/resources/build.sh | 2 ++ rpms/vmagent/resources/nfpm.yaml | 37 ++++++++++++++++++++++++++++++++ rpms/vmutils/nfpm.yaml | 7 ------ 5 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 rpms/vmagent/1.119.0/release create mode 100644 rpms/vmagent/Dockerfile create mode 100755 rpms/vmagent/resources/build.sh create mode 100644 rpms/vmagent/resources/nfpm.yaml diff --git a/rpms/vmagent/1.119.0/release b/rpms/vmagent/1.119.0/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/vmagent/1.119.0/release @@ -0,0 +1 @@ +1 diff --git a/rpms/vmagent/Dockerfile b/rpms/vmagent/Dockerfile new file mode 100644 index 0000000..b48cbc2 --- /dev/null +++ b/rpms/vmagent/Dockerfile @@ -0,0 +1,23 @@ +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_VERSION +ENV PACKAGE_VERSION=${PACKAGE_VERSION} + +# Copy nfpm.yaml from the context into the container +COPY resources /app/resources + +# Download the required files +RUN wget -O /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ + https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz && \ + tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz + +# Default command to build RPMs +CMD /app/resources/build.sh diff --git a/rpms/vmagent/resources/build.sh b/rpms/vmagent/resources/build.sh new file mode 100755 index 0000000..ae730e3 --- /dev/null +++ b/rpms/vmagent/resources/build.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/vmagent/resources/nfpm.yaml b/rpms/vmagent/resources/nfpm.yaml new file mode 100644 index 0000000..0d64fd7 --- /dev/null +++ b/rpms/vmagent/resources/nfpm.yaml @@ -0,0 +1,37 @@ +# nfpm.yaml + +name: vmagent +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "vmagent collects metrics data via popular data ingestion protocols and routes it to VictoriaMetrics." +maintainer: VictoriaMetrics +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license + +disable_globbing: false + +replaces: + - vmagent + +provides: + - vmagent + +# Files to include in the package +contents: + - src: /app/vmagent-prod + dst: /usr/bin/vmagent + file_info: + mode: 0755 + owner: root + group: root + +# Scripts to run during installation/removal (optional) +# scripts: +# preinstall: ./scripts/preinstall.sh +# postinstall: ./scripts/postinstall.sh +# preremove: ./scripts/preremove.sh +# postremove: ./scripts/postremove.sh diff --git a/rpms/vmutils/nfpm.yaml b/rpms/vmutils/nfpm.yaml index 2c0c742..6564225 100644 --- a/rpms/vmutils/nfpm.yaml +++ b/rpms/vmutils/nfpm.yaml @@ -19,7 +19,6 @@ replaces: - vmutils provides: - - vmagent - vmalert - vmalert-tool - vmauth @@ -29,12 +28,6 @@ provides: # Files to include in the package contents: - - src: /app/vmagent-prod - dst: /usr/bin/vmagent - file_info: - mode: 0755 - owner: root - group: root - src: /app/vmalert-prod dst: /usr/bin/vmalert file_info: From 37e7e7c1b7dac2e6069da86626a937b540b435e9 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 13 Jul 2025 16:53:05 +1000 Subject: [PATCH 2/2] feat: move vmalert to own package - move vmalert from vmutils to its own package --- rpms/vmalert/1.119.0/release | 1 + rpms/vmalert/Dockerfile | 23 ++++++++++++++++++++ rpms/vmalert/resources/build.sh | 2 ++ rpms/vmalert/resources/nfpm.yaml | 37 ++++++++++++++++++++++++++++++++ rpms/vmutils/nfpm.yaml | 7 ------ 5 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 rpms/vmalert/1.119.0/release create mode 100644 rpms/vmalert/Dockerfile create mode 100755 rpms/vmalert/resources/build.sh create mode 100644 rpms/vmalert/resources/nfpm.yaml diff --git a/rpms/vmalert/1.119.0/release b/rpms/vmalert/1.119.0/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/vmalert/1.119.0/release @@ -0,0 +1 @@ +1 diff --git a/rpms/vmalert/Dockerfile b/rpms/vmalert/Dockerfile new file mode 100644 index 0000000..b48cbc2 --- /dev/null +++ b/rpms/vmalert/Dockerfile @@ -0,0 +1,23 @@ +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_VERSION +ENV PACKAGE_VERSION=${PACKAGE_VERSION} + +# Copy nfpm.yaml from the context into the container +COPY resources /app/resources + +# Download the required files +RUN wget -O /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ + https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz && \ + tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz + +# Default command to build RPMs +CMD /app/resources/build.sh diff --git a/rpms/vmalert/resources/build.sh b/rpms/vmalert/resources/build.sh new file mode 100755 index 0000000..ae730e3 --- /dev/null +++ b/rpms/vmalert/resources/build.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/vmalert/resources/nfpm.yaml b/rpms/vmalert/resources/nfpm.yaml new file mode 100644 index 0000000..f41e0db --- /dev/null +++ b/rpms/vmalert/resources/nfpm.yaml @@ -0,0 +1,37 @@ +# nfpm.yaml + +name: vmalert +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "vmalert processes alerts and recording rules from VictoriaMetrics." +maintainer: VictoriaMetrics +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license + +disable_globbing: false + +replaces: + - vmalert + +provides: + - vmalert + +# Files to include in the package +contents: + - src: /app/vmalert-prod + dst: /usr/bin/vmalert + file_info: + mode: 0755 + owner: root + group: root + +# Scripts to run during installation/removal (optional) +# scripts: +# preinstall: ./scripts/preinstall.sh +# postinstall: ./scripts/postinstall.sh +# preremove: ./scripts/preremove.sh +# postremove: ./scripts/postremove.sh diff --git a/rpms/vmutils/nfpm.yaml b/rpms/vmutils/nfpm.yaml index 6564225..2527d29 100644 --- a/rpms/vmutils/nfpm.yaml +++ b/rpms/vmutils/nfpm.yaml @@ -19,7 +19,6 @@ replaces: - vmutils provides: - - vmalert - vmalert-tool - vmauth - vmbackup @@ -28,12 +27,6 @@ provides: # Files to include in the package contents: - - src: /app/vmalert-prod - dst: /usr/bin/vmalert - file_info: - mode: 0755 - owner: root - group: root - src: /app/vmalert-tool-prod dst: /usr/bin/vmalert-tool file_info: