diff --git a/Dockerfile b/Dockerfile index 4f56b1f..492c9e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/metricq/metricq-python:v5.3 AS builder +FROM ghcr.io/metricq/metricq-python:v5.4 AS builder LABEL maintainer="mario.bielert@tu-dresden.de" USER root @@ -14,7 +14,7 @@ COPY --chown=metricq:metricq . /home/metricq/source-http WORKDIR /home/metricq/source-http RUN pip install --user . -FROM ghcr.io/metricq/metricq-python:v5.3 +FROM ghcr.io/metricq/metricq-python:v5.4 USER metricq COPY --from=BUILDER --chown=metricq:metricq /home/metricq/.local /home/metricq/.local diff --git a/metricq_source_http/source.py b/metricq_source_http/source.py index 1526f5a..8a95c1c 100644 --- a/metricq_source_http/source.py +++ b/metricq_source_http/source.py @@ -15,6 +15,7 @@ import metricq from hostlist import expand_hostlist # type: ignore from metricq.logging import get_logger +from metricq.cli import metricq_command from yarl import URL from .version import __version__ @@ -501,10 +502,7 @@ async def task(self) -> None: await self._stop_host_tasks() -@click.command() -@click.option("--server", default="amqp://localhost/") -@click.option("--token", default="source-http") -@click_log.simple_verbosity_option(logger) # type: ignore +@metricq_command(default_token = "source-http") def main(server: str, token: str) -> None: src = HttpSource(token=token, url=server) src.run() diff --git a/pyproject.toml b/pyproject.toml index c9d2c8d..8c706f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ requires-python = ">=3.10" dependencies = [ "click", "click_log", - "metricq ~= 5.3", + "metricq[cli] ~= 5.4", "aiohttp", "jsonpath-rw", "python-hostlist",