rmpkg: victoria-metrics

This commit is contained in:
George Rawlinson 2023-07-08 22:04:43 +12:00
parent 95d95e8f09
commit b4de1934c9
Signed by: grawlinson
GPG key ID: E0959FEA8B550539
5 changed files with 0 additions and 146 deletions

View file

@ -713,12 +713,6 @@ github = "veeso/suppaftp"
use_max_tag = true
prefix = "v"
[victoria-metrics]
source = "github"
github = "VictoriaMetrics/VictoriaMetrics"
use_max_tag = true
prefix = "v"
[dagger]
source = "github"
github = "dagger/dagger"

View file

@ -1,92 +0,0 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgbase=victoria-metrics
pkgname=('victoria-metrics' 'victoria-metrics-utils')
pkgver=1.86.1
pkgrel=1
pkgdesc='A fast, cost-effective monitoring solution and time series database'
arch=('x86_64')
url='https://victoriametrics.com'
license=('Apache')
depends=('glibc')
makedepends=('git' 'go')
options=('!lto')
_commit='351fc152e0b57a3a9e481b8495c49000f8a3b395'
source=(
"$pkgbase::git+https://github.com/VictoriaMetrics/VictoriaMetrics.git#commit=$_commit"
'systemd.service'
'tmpfiles.conf'
'sysusers.conf'
)
b2sums=('SKIP'
'9fbcc9b95f935c07658f0bf30b7e17e2c86ae75b4a270a78cbbd7dbe9ef0a698e9f4e617943047b1f6ea07515964466f456f378d2f5565b05fd873eedc50e26f'
'f39262508fd73a0ac2841e6f93bab9428ff6b84b009beb3d9d13913c3e361b6f16e7ceb5939fa2cff9d99d183e4d2263afa1b8d871c348a74646033bab46583c'
'7d947bfabfb96e14842cc13dac12612b40d28361f81675f5d5cf930453d0ba6f32cb735634d61d17bc602ce147dcf6f36ca3a161ba5a4a346f1896f71b06430b')
_binaries=(
'victoria-metrics'
'vmagent'
'vmalert'
'vmauth'
'vmbackup'
'vmrestore'
'vmctl'
)
pkgver() {
cd "$pkgbase"
git describe --tags | sed 's/^v//'
}
prepare() {
# create directory for build output
mkdir build
cd "$pkgbase"
# download dependencies
go mod download
}
build() {
cd "$pkgbase"
# set Go flags
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
for binary in "${_binaries[@]}"; do
go build -v \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags $LDFLAGS" \
-o "$srcdir/build" \
"./app/$binary"
done
}
check() {
cd "$pkgbase"
for binary in "${_binaries[@]}"; do
go test -v "./app/$binary/..."
done
}
package_victoria-metrics() {
# systemd integration
install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgbase.service"
install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgbase.conf"
install -vDm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgbase.conf"
# binary
install -vDm755 -t "$pkgdir/usr/bin" build/victoria-metrics
}
package_victoria-metrics-utils() {
pkgdesc+=" (utilities)"
install -vDm755 -t "$pkgdir/usr/bin" build/vm*
}

View file

@ -1,46 +0,0 @@
[Unit]
Description=High-performance, cost-effective and scalable time series database, long-term remote storage for Prometheus
Documentation=https://docs.victoriametrics.com/
After=network-online.target
[Service]
User=victoria-metrics
Group=victoria-metrics
Type=simple
StartLimitBurst=5
StartLimitInterval=0
Restart=on-failure
RestartSec=1
ExecStart=/usr/bin/victoria-metrics -storageDataPath=/var/lib/victoria-metrics
ExecStop=/bin/kill -s SIGTERM $MAINPID
# hardening options
UMask=0077
NoNewPrivileges=true
LimitNOFILE=1048576
ProtectSystem=strict
ProtectHome=true
PrivateUsers=yes
PrivateTmp=true
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=true
LockPersonality=true
MemoryDenyWriteExecute=true
RestrictRealtime=true
RestrictSUIDSGID=true
RemoveIPC=true
CapabilityBoundingSet=
AmbientCapabilities=
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target

View file

@ -1 +0,0 @@
u victoria-metrics - "victoria-metrics daemon user" /var/lib/victoria-metrics

View file

@ -1 +0,0 @@
d /var/lib/victoria-metrics 0755 victoria-metrics victoria-metrics