From e031779c71ed1b138157051357b26dfca8619ecd Mon Sep 17 00:00:00 2001 From: Max Kutschka <2004maximilian@web.de> Date: Tue, 26 Nov 2024 13:38:58 +0100 Subject: [PATCH 1/2] feat: standardized cli --- metricq_source_ipmi/source/main.py | 6 ++---- setup.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/metricq_source_ipmi/source/main.py b/metricq_source_ipmi/source/main.py index 8969368..5c9cc89 100644 --- a/metricq_source_ipmi/source/main.py +++ b/metricq_source_ipmi/source/main.py @@ -13,6 +13,7 @@ import metricq from metricq import Timedelta from metricq.logging import get_logger +from metricq.cli import metricq_command from .version import version as client_version import hostlist @@ -514,11 +515,8 @@ async def update(self): ) -@click.command() -@click.option('--server', default='amqp://localhost/') -@click.option('--token', default='source-ipmi') +@metricq_command(default_token="source-ipmi") @click.version_option(client_version) -@click_log.simple_verbosity_option(logger) def run(server, token): src = IpmiSource(token=token, management_url=server, client_version=client_version) src.run() diff --git a/setup.py b/setup.py index 76d1369..926a031 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ "aiomonitor", "click", "click_log", - "metricq ~= 4.0", + "metricq[cli] ~= 5.4", "python-hostlist", ], use_scm_version=True, From 4f83e14cb10a779bbfcb307505918f4803f01942 Mon Sep 17 00:00:00 2001 From: Max Kutschka <2004maximilian@web.de> Date: Tue, 21 Jan 2025 14:13:29 +0100 Subject: [PATCH 2/2] Update Dockerfile to metricq v5.4 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad259d1..edf9cd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/metricq/metricq-python:v4.2 AS builder +FROM ghcr.io/metricq/metricq-python:v5.4 AS builder LABEL maintainer="mario.bielert@tu-dresden.de" USER root @@ -13,7 +13,7 @@ COPY --chown=metricq:metricq . /home/metricq/source-ipmi WORKDIR /home/metricq/source-ipmi RUN pip install --user . -FROM ghcr.io/metricq/metricq-python:v4.2 +FROM ghcr.io/metricq/metricq-python:v5.4 USER root RUN apt-get update \