Skip to content

Commit 9891a83

Browse files
authored
Merge pull request #68 from DXC-DP-Monitoring/dev
Docker: add runtime image and compose wiring
2 parents 2d3f935 + 2926709 commit 9891a83

File tree

6 files changed

+49
-4
lines changed

6 files changed

+49
-4
lines changed

.dockerignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# VCS and CI/CD
2+
.git
3+
.github/
4+
5+
# Python build artefacts and envs
6+
__pycache__/
7+
*.egg-info
8+
.venv/
9+
venv/
10+
.env
11+
12+
# Local outputs and data
13+
results/
14+
*.csv
15+
nifi_data/
16+
nifi_logs/
17+
nifi_registry_data/
18+
grafana-data/
19+
pgdata/
20+
21+
# Assets not needed for runtime image
22+
Alerting.md
23+
images/
24+
tests/
25+
26+
# Compose/config files not required in image
27+
docker-compose.yml
28+
prometheus.yml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ pgdata
1212
*.egg-info
1313
*__pycache__
1414
.~lock.prometheus_metrics_log*
15+
notes.txt

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3.11-slim
2+
WORKDIR /app
3+
COPY pyproject.toml README.md ./
4+
COPY nifipulse/ ./nifipulse/
5+
RUN pip install -U pip && pip install --no-cache-dir .
6+
ENTRYPOINT ["nifipulse"]
7+
CMD ["--poll","10","--interval","60"]
File renamed without changes.

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ services:
6363
- ./db/init:/docker-entrypoint-initdb.d:ro
6464
restart: unless-stopped
6565

66+
nifipulse:
67+
image: ghcr.io/OWNER/NiFiPulse:latest
68+
depends_on: [prometheus, postgres]
69+
environment:
70+
- PROM_URL=http://prometheus:9090/api/v1/query
71+
- PG_DSN=postgresql+psycopg2://postgres:postgres@postgres:5432/metrics_db
72+
volumes:
73+
- ./results:/app/results
74+
restart: unless-stopped
75+
6676
volumes:
6777
grafana-data:
6878
pgdata:

nifipulse/cli.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ def main():
55
parser = argparse.ArgumentParser(description="Run NifiPulse ETL CLI")
66
parser.add_argument(
77
"--poll",
8-
nargs="?",
9-
const=10, # `--poll` with no value → 10
108
type=int,
11-
default=10, # no `--poll` at all → 10
12-
help="Number of polling cycles (default 10). Use --poll 0 to run forever."
9+
default=10,
10+
metavar="N",
11+
help="Number of polling cycles (default 10; use 0 to run forever)."
1312
)
1413
parser.add_argument(
1514
"--interval",

0 commit comments

Comments
 (0)