diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..77dc2cc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,28 @@ +# VCS and CI/CD +.git +.github/ + +# Python build artefacts and envs +__pycache__/ +*.egg-info +.venv/ +venv/ +.env + +# Local outputs and data +results/ +*.csv +nifi_data/ +nifi_logs/ +nifi_registry_data/ +grafana-data/ +pgdata/ + +# Assets not needed for runtime image +Alerting.md +images/ +tests/ + +# Compose/config files not required in image +docker-compose.yml +prometheus.yml \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3127c18..a538fc9 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ pgdata *.egg-info *__pycache__ .~lock.prometheus_metrics_log* +notes.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..764dfad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.11-slim +WORKDIR /app +COPY pyproject.toml README.md ./ +COPY nifipulse/ ./nifipulse/ +RUN pip install -U pip && pip install --no-cache-dir . +ENTRYPOINT ["nifipulse"] +CMD ["--poll","10","--interval","60"] \ No newline at end of file diff --git a/Readme.md b/README.md similarity index 100% rename from Readme.md rename to README.md diff --git a/docker-compose.yml b/docker-compose.yml index e08ead9..ce88fbd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -63,6 +63,16 @@ services: - ./db/init:/docker-entrypoint-initdb.d:ro restart: unless-stopped + nifipulse: + image: ghcr.io/OWNER/NiFiPulse:latest + depends_on: [prometheus, postgres] + environment: + - PROM_URL=http://prometheus:9090/api/v1/query + - PG_DSN=postgresql+psycopg2://postgres:postgres@postgres:5432/metrics_db + volumes: + - ./results:/app/results + restart: unless-stopped + volumes: grafana-data: pgdata: \ No newline at end of file diff --git a/nifipulse/cli.py b/nifipulse/cli.py index e8fae9a..34c4327 100644 --- a/nifipulse/cli.py +++ b/nifipulse/cli.py @@ -5,11 +5,10 @@ def main(): parser = argparse.ArgumentParser(description="Run NifiPulse ETL CLI") parser.add_argument( "--poll", - nargs="?", - const=10, # `--poll` with no value → 10 type=int, - default=10, # no `--poll` at all → 10 - help="Number of polling cycles (default 10). Use --poll 0 to run forever." + default=10, + metavar="N", + help="Number of polling cycles (default 10; use 0 to run forever)." ) parser.add_argument( "--interval",