From a8cf68b6d3e06b0a833081797888a15ece3f4498 Mon Sep 17 00:00:00 2001 From: Jake Kasper Date: Fri, 24 Apr 2026 11:24:58 -0400 Subject: [PATCH] updated the repo to use host networking as the default appliance deployment model --- Dockerfile | 6 ++++-- README.md | 12 +++++++++++- app/__pycache__/config.cpython-314.pyc | Bin 0 -> 2360 bytes app/config.py | 5 +++-- config/marvis.env.example | 14 ++++++++++++++ config/p5g-marvis.service | 20 +++++++++++++------- 6 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 app/__pycache__/config.cpython-314.pyc create mode 100644 config/marvis.env.example diff --git a/Dockerfile b/Dockerfile index b32d3da..3e5facf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM python:3.12-slim +FROM docker.io/library/python:3.12-slim + WORKDIR /app @@ -14,7 +15,8 @@ COPY config/ ./config/ EXPOSE 8100 -# When running standalone, override these to point at your Prometheus/Alertmanager +# Appliance-style defaults for host-network deployment. Override via env or +# systemd EnvironmentFile when needed. ENV MARVIS_PROMETHEUS_URL=http://127.0.0.1:9090 ENV MARVIS_PROMETHEUS_PREFIX=/prometheus ENV MARVIS_ALERTMANAGER_URL=http://127.0.0.1:9093 diff --git a/README.md b/README.md index 9e657b6..ec2c424 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The target environment for this project is a host where services are started by `systemd`, including Docker-backed services. Marvis is intended to run the same way: -- the FastAPI app runs on `127.0.0.1:8100` +- the FastAPI app runs in a container with host networking on `127.0.0.1:8100` - Traefik exposes it at `/core/marvis/*` - `patch-ncm.py` injects the sidebar entries and iframe routes into the NCM UI - the injected entries should only be added for services that are actually @@ -30,6 +30,8 @@ docker build -t p5g-marvis:latest . ```bash cp config/p5g-marvis.service /usr/lib/systemd/system/p5g-marvis.service +mkdir -p /etc/p5g-marvis +cp config/marvis.env.example /etc/p5g-marvis/marvis.env systemctl daemon-reload systemctl enable --now p5g-marvis ``` @@ -41,6 +43,14 @@ http://127.0.0.1:8100 http://127.0.0.1:8100/api/docs ``` +Edit `/etc/p5g-marvis/marvis.env` per host instead of hardcoding addresses in the +unit file. In particular: + +- set `MARVIS_PROMETHEUS_URL` and `MARVIS_ALERTMANAGER_URL` to the correct host + endpoints for that appliance +- keep the defaults if Prometheus and Alertmanager are already available on host + loopback from the appliance network namespace + --- ## Architecture Overview diff --git a/app/__pycache__/config.cpython-314.pyc b/app/__pycache__/config.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..deb9faf8adca25cbb68c04f49f6b8238cd95c703 GIT binary patch literal 2360 zcmZ{k!BZMn9LFDmpoky=)QYjuM5{>viJ-wII$KheH3y9_^m@Ap3M_ulWf-^U&Q zpcj$n-*5k}{Nh3APjk?E#x3XluRRDg(K7@N4r%Bq63MvxnMBY7&XhHy_1ID_=%tj? zmU4rKQZ8Gn5Be$9YfE`yfKqN-$_Im#^4L;-2vDlemKuT}rTT5DYY?K8*Om%Hgi-^x z)Nn_QK3i%8Mrp1=Tj~QCqmAqH_sz&s@39xOl#(y$0ia33EvdK#xueK|rpe2RMDpHJe4c!g%bEGiJRbc& zEdsmFeSS2Mkd=D1tR0jaDju;gCdWd7X9Q-01^cuM*x%y0BA;Jlu}f(jmg&**A}cUl zkrBD#BlZbKIAr10gt;VlG_Wsgu~a=)t<)-b_$u)UBe56z51VDFq^^=&iPz^?j!RZ9!BKiRxcU^szP4O>Ei<5}$9t?ztQ zR$aZqpXx_YNblEQWcYRLR83DZy@pJ@Ez$ILtHfL5O;0gBz|NXNW(8Qsu2MtY z!!Bk^BBZ=SqGFbK)oK|#dD2gpy8mJayQGcBS?t_ZO4zvu4DnQwb4?;SYdgdfvc!`Q zRkAuKt+NV_qSyq)15}5NTW8_CM|MHay)7&u4lxc36X2vwLrnzmJyQYbo zW}cY22+5{m_kLM3yY0Vvjc~AIe0fpuQ1_+49wP1w+55Yc?&}md4p^g>n6Woc)rx(V ze<{ac`}J7*Q-b8M*iTh(p)wq#S-NC&G<5E!3*#pm!3ayu09})`B3>FwT4eJ^dzf+