C1(unpoller-v3): upgrade v2.34.0 -> v3.2.0, migrate to container.py
Major version bump from v2.34.0 to v3.2.0. Breaking changes upstream: - v3.0.0: UniFi network API shifts (later 10.x); metrics, events and logs may have changed names/labels. - v3.2.0: defaults to a 60s background poll feeding cached Prometheus scrapes (was on-demand poll per scrape). Set interval = 0 in up.conf to restore on-demand behavior if needed. Also migrate the container build from a Dockerfile to a native Dagger pipeline (containers/unpoller/container.py) using the shared helpers in blumeops.containers, following the navidrome/miniflux pattern. The build-container workflow already prefers container.py when present. Refresh last-reviewed and current-version in service-versions.yaml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f6febb1f77
commit
1b27242437
4 changed files with 56 additions and 45 deletions
|
|
@ -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
|
||||
type: argocd
|
||||
last-reviewed: 2026-03-16
|
||||
current-version: "v2.34.0"
|
||||
last-reviewed: 2026-05-28
|
||||
current-version: "v3.2.0"
|
||||
upstream-source: https://github.com/unpoller/unpoller/releases
|
||||
notes: UniFi metrics exporter for Prometheus
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue