From 9b755a05dc2256d23ad6114419d44416d7d28b4a Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 21 Jun 2025 17:37:58 +1000 Subject: [PATCH] feat: add victoria metrics - vminsert, vmselect and vmstorage - vmutils --- rpms/victoriametrics/1.119.0/release | 1 + rpms/victoriametrics/Dockerfile | 23 ++++++ rpms/victoriametrics/resources/build.sh | 4 + rpms/victoriametrics/resources/vminsert.yaml | 37 +++++++++ rpms/victoriametrics/resources/vmselect.yaml | 37 +++++++++ rpms/victoriametrics/resources/vmstorage.yaml | 37 +++++++++ rpms/vmutils/1.119.0/release | 1 + rpms/vmutils/Dockerfile | 23 ++++++ rpms/vmutils/nfpm.yaml | 80 +++++++++++++++++++ 9 files changed, 243 insertions(+) create mode 100644 rpms/victoriametrics/1.119.0/release create mode 100644 rpms/victoriametrics/Dockerfile create mode 100755 rpms/victoriametrics/resources/build.sh create mode 100644 rpms/victoriametrics/resources/vminsert.yaml create mode 100644 rpms/victoriametrics/resources/vmselect.yaml create mode 100644 rpms/victoriametrics/resources/vmstorage.yaml create mode 100644 rpms/vmutils/1.119.0/release create mode 100644 rpms/vmutils/Dockerfile create mode 100644 rpms/vmutils/nfpm.yaml diff --git a/rpms/victoriametrics/1.119.0/release b/rpms/victoriametrics/1.119.0/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/victoriametrics/1.119.0/release @@ -0,0 +1 @@ +1 diff --git a/rpms/victoriametrics/Dockerfile b/rpms/victoriametrics/Dockerfile new file mode 100644 index 0000000..2456ada --- /dev/null +++ b/rpms/victoriametrics/Dockerfile @@ -0,0 +1,23 @@ +FROM git.query.consul/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/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz \ + https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz && \ + tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz + +# Default command to build RPMs +CMD /app/resources/build.sh diff --git a/rpms/victoriametrics/resources/build.sh b/rpms/victoriametrics/resources/build.sh new file mode 100755 index 0000000..0386f7b --- /dev/null +++ b/rpms/victoriametrics/resources/build.sh @@ -0,0 +1,4 @@ +#!/usr/bin/bash +nfpm pkg --config /app/resources/vminsert.yaml --target /app/dist --packager rpm +nfpm pkg --config /app/resources/vmselect.yaml --target /app/dist --packager rpm +nfpm pkg --config /app/resources/vmstorage.yaml --target /app/dist --packager rpm diff --git a/rpms/victoriametrics/resources/vminsert.yaml b/rpms/victoriametrics/resources/vminsert.yaml new file mode 100644 index 0000000..e14f59a --- /dev/null +++ b/rpms/victoriametrics/resources/vminsert.yaml @@ -0,0 +1,37 @@ +# nfpm.yaml + +name: vminsert +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "vminsert accepts data via popular data ingestion protocols and routes it to vmstorage nodes" +maintainer: VictoriaMetrics +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license + +disable_globbing: false + +replaces: + - vminsert + +provides: + - vminsert + +# Files to include in the package +contents: + - src: /app/vminsert-prod + dst: /usr/bin/vminsert + 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/victoriametrics/resources/vmselect.yaml b/rpms/victoriametrics/resources/vmselect.yaml new file mode 100644 index 0000000..23d5f56 --- /dev/null +++ b/rpms/victoriametrics/resources/vmselect.yaml @@ -0,0 +1,37 @@ +# nfpm.yaml + +name: vmselect +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "vmselect processes incoming queries by fetching the requested data from vmstorage nodes" +maintainer: VictoriaMetrics +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license + +disable_globbing: false + +replaces: + - vmselect + +provides: + - vmselect + +# Files to include in the package +contents: + - src: /app/vmselect-prod + dst: /usr/bin/vmselect + 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/victoriametrics/resources/vmstorage.yaml b/rpms/victoriametrics/resources/vmstorage.yaml new file mode 100644 index 0000000..695d5d9 --- /dev/null +++ b/rpms/victoriametrics/resources/vmstorage.yaml @@ -0,0 +1,37 @@ +# nfpm.yaml + +name: vmstorage +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "vmstorage stores time series data obtained from vminsert and returns the requested data to vmselect" +maintainer: VictoriaMetrics +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license + +disable_globbing: false + +replaces: + - vmstorage + +provides: + - vmstorage + +# Files to include in the package +contents: + - src: /app/vmstorage-prod + dst: /usr/bin/vmstorage + 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/1.119.0/release b/rpms/vmutils/1.119.0/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/vmutils/1.119.0/release @@ -0,0 +1 @@ +1 diff --git a/rpms/vmutils/Dockerfile b/rpms/vmutils/Dockerfile new file mode 100644 index 0000000..1faff7f --- /dev/null +++ b/rpms/vmutils/Dockerfile @@ -0,0 +1,23 @@ +FROM git.query.consul/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 nfpm.yaml /app/nfpm.yaml + +# 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 nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/vmutils/nfpm.yaml b/rpms/vmutils/nfpm.yaml new file mode 100644 index 0000000..2c0c742 --- /dev/null +++ b/rpms/vmutils/nfpm.yaml @@ -0,0 +1,80 @@ +# nfpm.yaml + +name: vmutils +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "VictoriaMetrics utilities: fast, cost-effective monitoring solution and time series database." + +maintainer: VictoriaMetrics +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license + +disable_globbing: false + +replaces: + - vmutils + +provides: + - vmagent + - vmalert + - vmalert-tool + - vmauth + - vmbackup + - vmctl + - vmrestore + +# 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: + mode: 0755 + owner: root + group: root + - src: /app/vmalert-tool-prod + dst: /usr/bin/vmalert-tool + file_info: + mode: 0755 + owner: root + group: root + - src: /app/vmauth-prod + dst: /usr/bin/vmauth + file_info: + mode: 0755 + owner: root + group: root + - src: /app/vmbackup-prod + dst: /usr/bin/vmbackup + file_info: + mode: 0755 + owner: root + group: root + - src: /app/vmctl-prod + dst: /usr/bin/vmctl + file_info: + mode: 0755 + owner: root + group: root + - src: /app/vmrestore-prod + dst: /usr/bin/vmrestore + 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 -- 2.47.3