git: 6797c5bb6641 - main - sysutils/tempo: add new port.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 05 Jan 2025 06:55:29 UTC
The branch main has been updated by vanilla:
URL: https://cgit.FreeBSD.org/ports/commit/?id=6797c5bb6641a498e7245172189c307a4c7c543b
commit 6797c5bb6641a498e7245172189c307a4c7c543b
Author: Vanilla I. Shu <vanilla@FreeBSD.org>
AuthorDate: 2025-01-05 06:54:19 +0000
Commit: Vanilla I. Shu <vanilla@FreeBSD.org>
CommitDate: 2025-01-05 06:55:03 +0000
sysutils/tempo: add new port.
PR: 283803
Reported by: Daniel Morante <daniel at morante.net>
---
GIDs | 2 +-
UIDs | 2 +-
sysutils/Makefile | 1 +
sysutils/tempo/Makefile | 53 ++++++++++++++++
sysutils/tempo/distinfo | 5 ++
.../patch-example_docker-compose_shared_tempo.yaml | 30 +++++++++
sysutils/tempo/files/tempo.in | 71 ++++++++++++++++++++++
sysutils/tempo/pkg-descr | 3 +
sysutils/tempo/pkg-plist | 12 ++++
9 files changed, 177 insertions(+), 2 deletions(-)
diff --git a/GIDs b/GIDs
index 5256462db79e..81a5275cc3c2 100644
--- a/GIDs
+++ b/GIDs
@@ -289,7 +289,7 @@ _metronome:*:345:
ngircd:*:346:
eturnal:*:347:
davfs2:*:348:
-# free: 349
+tempo:*:349:
_sabnzbd:*:350:
sonarr:*:351:
radarr:*:352:
diff --git a/UIDs b/UIDs
index 7b7b343fc60f..f79658aa4f96 100644
--- a/UIDs
+++ b/UIDs
@@ -295,7 +295,7 @@ _metronome:*:345:345::0:0:Metronome Daemon:/nonexistent:/usr/sbin/nologin
ngircd:*:346:346::0:0:ngIRCd Daemon:/var/empty:/usr/sbin/nologin
eturnal:*:347:347::0:0:eturnal User:/var/spool/eturnal:/bin/sh
davfs2:*:348:348::0:0:Davfs2 Daemon:/nonexistent:/usr/sbin/nologin
-# free: 349
+tempo:*:349:349::0:0:Tempo Daemon:/nonexistent:/usr/sbin/nologin
_sabnzbd:*:350:350::0:0:sabnzb Daemon:/nonexistent:/usr/sbin/nologin
sonarr:*:351:351::0:0:Sonarr PVR:/nonexistent:/usr/sbin/nologin
radarr:*:352:352::0:0:Radarr Daemon:/nonexistent:/usr/sbin/nologin
diff --git a/sysutils/Makefile b/sysutils/Makefile
index b89b447a4946..305e8eb4e844 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1363,6 +1363,7 @@
SUBDIR += tcplist
SUBDIR += tdir
SUBDIR += tealdeer
+ SUBDIR += tempo
SUBDIR += tenshi
SUBDIR += tere
SUBDIR += terraform
diff --git a/sysutils/tempo/Makefile b/sysutils/tempo/Makefile
new file mode 100644
index 000000000000..1ff162aa61b0
--- /dev/null
+++ b/sysutils/tempo/Makefile
@@ -0,0 +1,53 @@
+PORTNAME= tempo
+DISTVERSIONPREFIX= v
+DISTVERSION= 2.6.1
+CATEGORIES= sysutils
+MASTER_SITES+= https://raw.githubusercontent.com/${GH_ACCOUNT}/${PORTNAME}/${DISTVERSIONFULL}/
+PKGNAMEPREFIX= grafana-
+DISTFILES= go.mod
+
+MAINTAINER= daniel@morante.net
+COMMENT= High volume, minimal dependency distributed tracing backend
+WWW= https://github.com/grafana/tempo
+
+LICENSE= AGPLv3
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= go:modules
+USE_GITHUB= yes
+GH_ACCOUNT= grafana
+GH_PROJECT= tempo
+
+USE_RC_SUBR= tempo
+
+GO_MODULE= github.com/${GH_ACCOUNT}/${GH_PROJECT}
+GO_TARGET= ./cmd/tempo ./cmd/tempo-query ./cmd/tempo-cli ./cmd/tempo-vulture
+GO_BUILDFLAGS= -v -ldflags "${LD_FLAG_STRING}"
+
+LD_FLAG_STRING= -s \
+ ${LD_FLAG_X_PREFIX}.Version=${PORTVERSION} \
+ ${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \
+ ${LD_FLAG_X_PREFIX}.Branch=HEAD \
+ ${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} \
+ ${LD_FLAG_X_PREFIX}.BuildDate=$$(date -u +"%Y-%m-%dT%H:%M:%SZ")
+LD_FLAG_X_PREFIX= -X github.com/grafana/tempo/pkg/util/build
+BUILD_USER?= ${USER}
+
+TEMPO_USER?= tempo
+TEMPO_GROUP?= tempo
+TEMPO_DATADIR?= /var/db/${PORTNAME}
+
+SUB_LIST= TEMPO_USER=${TEMPO_USER} \
+ TEMPO_GROUP=${TEMPO_GROUP} \
+ TEMPO_DATADIR=${TEMPO_DATADIR} \
+
+USERS= ${TEMPO_USER}
+GROUPS= ${TEMPO_GROUP}
+
+PLIST_SUB= ${SUB_LIST}
+
+post-install:
+ @${CP} ${WRKSRC}/example/docker-compose/shared/tempo.yaml ${STAGEDIR}${PREFIX}/etc/tempo.yaml.sample
+ @${MKDIR} ${STAGEDIR}${TEMPO_DATADIR}
+
+.include <bsd.port.mk>
diff --git a/sysutils/tempo/distinfo b/sysutils/tempo/distinfo
new file mode 100644
index 000000000000..51d3059d3285
--- /dev/null
+++ b/sysutils/tempo/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1735843421
+SHA256 (go/sysutils_tempo/grafana-tempo-v2.6.1_GH0/go.mod) = 16764341886c2531d9cbba50cbbc30c80676a2010c494cfed439b1f80c89b61e
+SIZE (go/sysutils_tempo/grafana-tempo-v2.6.1_GH0/go.mod) = 17886
+SHA256 (go/sysutils_tempo/grafana-tempo-v2.6.1_GH0/grafana-tempo-v2.6.1_GH0.tar.gz) = ff53e3eb7ed70e378b06a70295677d4f05d40554b33b8bd91d5c351c18d3b55f
+SIZE (go/sysutils_tempo/grafana-tempo-v2.6.1_GH0/grafana-tempo-v2.6.1_GH0.tar.gz) = 36372210
diff --git a/sysutils/tempo/files/patch-example_docker-compose_shared_tempo.yaml b/sysutils/tempo/files/patch-example_docker-compose_shared_tempo.yaml
new file mode 100644
index 000000000000..599c59d5f87a
--- /dev/null
+++ b/sysutils/tempo/files/patch-example_docker-compose_shared_tempo.yaml
@@ -0,0 +1,30 @@
+--- example/docker-compose/shared/tempo.yaml.orig 2024-10-22 18:23:02 UTC
++++ example/docker-compose/shared/tempo.yaml
+@@ -36,22 +36,22 @@ metrics_generator:
+ registry:
+ external_labels:
+ source: tempo
+- cluster: docker-compose
++ cluster: freebsd
+ storage:
+- path: /var/tempo/generator/wal
++ path: /var/db/tempo/generator/wal
+ remote_write:
+ - url: http://prometheus:9090/api/v1/write
+ send_exemplars: true
+ traces_storage:
+- path: /var/tempo/generator/traces
++ path: /var/db/tempo/generator/traces
+
+ storage:
+ trace:
+ backend: local # backend configuration to use
+ wal:
+- path: /var/tempo/wal # where to store the wal locally
++ path: /var/db/tempo/wal # where to store the wal locally
+ local:
+- path: /var/tempo/blocks
++ path: /var/db/tempo/blocks
+
+ overrides:
+ defaults:
diff --git a/sysutils/tempo/files/tempo.in b/sysutils/tempo/files/tempo.in
new file mode 100644
index 000000000000..0182b8956280
--- /dev/null
+++ b/sysutils/tempo/files/tempo.in
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# PROVIDE: tempo
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable tempo
+# tempo_enable="YES"
+#
+# tempo_enable (bool):
+# Set it to YES to enable grafana
+# Set to NO by default
+# tempo_user (string):
+# Set user that grafana will run under
+# Default is "%%tempo_USER%%"
+# tempo_group (string):
+# Set group that own grafana files
+# Default is "%%tempo_GROUP%%"
+# tempo_config (string)
+# Set full path to config file
+# Default is "%%PREFIX%%/etc/tempo.yaml"
+# tempo_logfile (string)
+# Set full path to log file
+# Default is "/var/log/tempo/tempo.log"
+# tempo_loglevel (string)
+# Set log level. Only log messages with the given severity or above.
+# Valid levels: [debug, info, warn, error]
+# Default is "warn"
+# tempo_args (string)
+# Set additional command line arguments
+# Default is ""
+
+. /etc/rc.subr
+
+name=tempo
+rcvar=tempo_enable
+
+load_rc_config $name
+
+: ${tempo_enable:="NO"}
+: ${tempo_user:="%%TEMPO_USER%%"}
+: ${tempo_group:="%%TEMPO_GROUP%%"}
+: ${tempo_config:="%%PREFIX%%/etc/tempo.yaml"}
+: ${tempo_logfile:="/var/log/tempo/tempo.log"}
+: ${tempo_loglevel:="warn"}
+
+pidfile="/var/run/${name}/${name}.pid"
+required_files="${tempo_config}"
+
+procname="%%PREFIX%%/bin/tempo"
+command="/usr/sbin/daemon"
+command_args="-p ${pidfile} -t ${name} -o ${tempo_logfile} \
+ ${procname} \
+ -config.file=${tempo_config} \
+ -log.level=${tempo_loglevel} \
+ ${tempo_args}"
+
+start_precmd="tempo_start_precmd"
+
+tempo_start_precmd()
+{
+ if [ ! -d "/var/run/${name}" ]; then
+ install -d -m 0750 -o ${tempo_user} -g ${tempo_group} "/var/run/${name}"
+ fi
+
+ if [ ! -d "/var/log/tempo" ]; then
+ install -d -m 0750 -o ${tempo_user} -g ${tempo_group} "/var/log/tempo"
+ fi
+}
+
+run_rc_command "$1"
diff --git a/sysutils/tempo/pkg-descr b/sysutils/tempo/pkg-descr
new file mode 100644
index 000000000000..f13b3fdd9b17
--- /dev/null
+++ b/sysutils/tempo/pkg-descr
@@ -0,0 +1,3 @@
+Grafana Tempo is an open source, easy-to-use and high-scale distributed tracing
+backend. Tempo is cost-efficient, requiring only object storage to operate, and
+is deeply integrated with Grafana, Prometheus, and Loki.
diff --git a/sysutils/tempo/pkg-plist b/sysutils/tempo/pkg-plist
new file mode 100644
index 000000000000..1894892a2746
--- /dev/null
+++ b/sysutils/tempo/pkg-plist
@@ -0,0 +1,12 @@
+bin/tempo
+bin/tempo-query
+bin/tempo-cli
+bin/tempo-vulture
+@sample etc/tempo.yaml.sample
+@owner %%TEMPO_USER%%
+@group %%TEMPO_GROUP%%
+@mode 750
+@dir %%TEMPO_DATADIR%%
+@mode
+@group
+@owner