Compare commits
2 commits
main
...
unpoller-v
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b5a0c376a | |||
| 1b27242437 |
5 changed files with 57 additions and 46 deletions
|
|
@ -10,7 +10,7 @@ resources:
|
||||||
|
|
||||||
images:
|
images:
|
||||||
- name: registry.ops.eblu.me/blumeops/unpoller
|
- name: registry.ops.eblu.me/blumeops/unpoller
|
||||||
newTag: v2.34.0-613f05d
|
newTag: v3.2.0-1b27242
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: unpoller-config
|
- name: unpoller-config
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
# UnPoller — UniFi metrics exporter for Prometheus
|
|
||||||
# Two-stage build: Go compilation, then minimal Alpine runtime
|
|
||||||
|
|
||||||
ARG CONTAINER_APP_VERSION=v2.34.0
|
|
||||||
|
|
||||||
FROM golang:alpine3.22 AS build
|
|
||||||
|
|
||||||
ARG CONTAINER_APP_VERSION
|
|
||||||
RUN apk add --no-cache git
|
|
||||||
|
|
||||||
RUN git clone --depth 1 --branch ${CONTAINER_APP_VERSION} \
|
|
||||||
https://forge.ops.eblu.me/mirrors/unpoller.git /app
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
ENV CGO_ENABLED=0
|
|
||||||
|
|
||||||
RUN go build -ldflags="-s -w \
|
|
||||||
-X main.version=${CONTAINER_APP_VERSION} \
|
|
||||||
-X main.builtBy=blumeops \
|
|
||||||
-X golift.io/version.Version=${CONTAINER_APP_VERSION} \
|
|
||||||
-X golift.io/version.Branch=HEAD \
|
|
||||||
-X golift.io/version.BuildUser=blumeops \
|
|
||||||
-X golift.io/version.Revision=blumeops-build" \
|
|
||||||
-o /bin/unpoller .
|
|
||||||
|
|
||||||
FROM alpine:3.22
|
|
||||||
|
|
||||||
ARG CONTAINER_APP_VERSION
|
|
||||||
LABEL org.opencontainers.image.title="UnPoller"
|
|
||||||
LABEL org.opencontainers.image.description="UniFi metrics exporter for Prometheus"
|
|
||||||
LABEL org.opencontainers.image.version="${CONTAINER_APP_VERSION}"
|
|
||||||
LABEL org.opencontainers.image.source="https://forge.eblu.me/eblume/blumeops"
|
|
||||||
LABEL org.opencontainers.image.vendor="blumeops"
|
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates tzdata
|
|
||||||
|
|
||||||
COPY --from=build /bin/unpoller /usr/bin/unpoller
|
|
||||||
|
|
||||||
EXPOSE 9130
|
|
||||||
USER 65534:65534
|
|
||||||
ENTRYPOINT ["/usr/bin/unpoller"]
|
|
||||||
CMD ["--config", "/etc/unpoller/up.conf"]
|
|
||||||
53
containers/unpoller/container.py
Normal file
53
containers/unpoller/container.py
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
"""UnPoller — UniFi metrics exporter for Prometheus.
|
||||||
|
|
||||||
|
Two-stage build: Go backend, Alpine runtime.
|
||||||
|
Source cloned from forge mirror.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import dagger
|
||||||
|
|
||||||
|
from blumeops.containers import (
|
||||||
|
alpine_runtime,
|
||||||
|
clone_from_forge,
|
||||||
|
go_build,
|
||||||
|
oci_labels,
|
||||||
|
)
|
||||||
|
|
||||||
|
VERSION = "v3.2.0"
|
||||||
|
|
||||||
|
|
||||||
|
async def build(src: dagger.Directory) -> dagger.Container:
|
||||||
|
source = clone_from_forge("unpoller", VERSION)
|
||||||
|
|
||||||
|
backend = go_build(
|
||||||
|
source,
|
||||||
|
"/unpoller",
|
||||||
|
ldflags=(
|
||||||
|
f"-s -w "
|
||||||
|
f"-X main.version={VERSION} "
|
||||||
|
f"-X main.builtBy=blumeops "
|
||||||
|
f"-X golift.io/version.Version={VERSION} "
|
||||||
|
f"-X golift.io/version.Branch=HEAD "
|
||||||
|
f"-X golift.io/version.BuildUser=blumeops "
|
||||||
|
f"-X golift.io/version.Revision=blumeops-build"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
runtime = alpine_runtime(
|
||||||
|
extra_apk=["ca-certificates", "tzdata"],
|
||||||
|
create_user=False,
|
||||||
|
)
|
||||||
|
runtime = oci_labels(
|
||||||
|
runtime,
|
||||||
|
title="UnPoller",
|
||||||
|
description="UniFi metrics exporter for Prometheus",
|
||||||
|
version=VERSION,
|
||||||
|
)
|
||||||
|
return (
|
||||||
|
runtime.with_file("/usr/bin/unpoller", backend.file("/unpoller"))
|
||||||
|
.with_exposed_port(9130)
|
||||||
|
.with_user("65534")
|
||||||
|
.with_default_args(
|
||||||
|
args=["/usr/bin/unpoller", "--config", "/etc/unpoller/up.conf"]
|
||||||
|
)
|
||||||
|
)
|
||||||
1
docs/changelog.d/unpoller-v3.infra.md
Normal file
1
docs/changelog.d/unpoller-v3.infra.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Upgrade unpoller v2.34.0 → v3.2.0 and migrate container build from Dockerfile to native Dagger (container.py). v3.0.0 carries breaking UniFi API changes; v3.2.0 introduces a 60s background poll (cached scrapes) by default — set `interval = 0` in `up.conf` to restore on-demand polling.
|
||||||
|
|
@ -345,8 +345,8 @@ services:
|
||||||
|
|
||||||
- name: unpoller
|
- name: unpoller
|
||||||
type: argocd
|
type: argocd
|
||||||
last-reviewed: 2026-03-16
|
last-reviewed: 2026-05-28
|
||||||
current-version: "v2.34.0"
|
current-version: "v3.2.0"
|
||||||
upstream-source: https://github.com/unpoller/unpoller/releases
|
upstream-source: https://github.com/unpoller/unpoller/releases
|
||||||
notes: UniFi metrics exporter for Prometheus
|
notes: UniFi metrics exporter for Prometheus
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue