PranavKK1201 commited on
Commit ·
2343011
1
Parent(s): a693df5
deployed to HF
Browse files- .dockerignore +11 -0
- Dockerfile +57 -0
- README.md +2 -2
- deploy/entrypoint.sh +62 -0
- deploy/grafana/grafana.ini +21 -0
- deploy/grafana/provisioning/dashboards/dashboard.yaml +12 -0
- deploy/grafana/provisioning/dashboards/json/antiatropos-overview.json +642 -0
- deploy/grafana/provisioning/datasources/prometheus.yaml +10 -0
- deploy/index.html +473 -0
- deploy/nginx.conf +89 -0
- deploy/prometheus.yml +10 -0
- inference.py +6 -1
- openenv.yaml +1 -1
.dockerignore
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
*.pyc
|
| 3 |
+
*.pyo
|
| 4 |
+
*.pyd
|
| 5 |
+
.pytest_cache/
|
| 6 |
+
.mypy_cache/
|
| 7 |
+
.ruff_cache/
|
| 8 |
+
openenv_AntiAtropos.egg-info/
|
| 9 |
+
.git/
|
| 10 |
+
.venv/
|
| 11 |
+
.DS_Store
|
Dockerfile
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive \
|
| 4 |
+
PYTHONUNBUFFERED=1 \
|
| 5 |
+
PIP_NO_CACHE_DIR=1 \
|
| 6 |
+
PROMETHEUS_VERSION=3.5.1 \
|
| 7 |
+
GRAFANA_VERSION=12.3.1 \
|
| 8 |
+
PROMETHEUS_ARCH=linux-amd64 \
|
| 9 |
+
GRAFANA_ARCH=linux-amd64
|
| 10 |
+
|
| 11 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
+
bash \
|
| 13 |
+
ca-certificates \
|
| 14 |
+
curl \
|
| 15 |
+
fontconfig \
|
| 16 |
+
libfontconfig1 \
|
| 17 |
+
libfreetype6 \
|
| 18 |
+
libx11-6 \
|
| 19 |
+
libxext6 \
|
| 20 |
+
libxrender1 \
|
| 21 |
+
nginx \
|
| 22 |
+
tar \
|
| 23 |
+
wget \
|
| 24 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
+
|
| 26 |
+
WORKDIR /app
|
| 27 |
+
|
| 28 |
+
COPY . /app
|
| 29 |
+
|
| 30 |
+
RUN pip install --upgrade pip setuptools wheel \
|
| 31 |
+
&& pip install -e .
|
| 32 |
+
|
| 33 |
+
RUN set -eux; \
|
| 34 |
+
mkdir -p /opt/prometheus /opt/grafana /var/lib/grafana /var/log/grafana /var/lib/prometheus /etc/grafana /etc/prometheus; \
|
| 35 |
+
curl -fsSL -o /tmp/prometheus.tar.gz "https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.${PROMETHEUS_ARCH}.tar.gz"; \
|
| 36 |
+
tar -xzf /tmp/prometheus.tar.gz -C /tmp; \
|
| 37 |
+
PROMETHEUS_DIR="$(find /tmp -maxdepth 1 -type d -name "prometheus-*" | head -n 1)"; \
|
| 38 |
+
cp -a "${PROMETHEUS_DIR}/." /opt/prometheus/; \
|
| 39 |
+
curl -fsSL -o /tmp/grafana.tar.gz "https://dl.grafana.com/oss/release/grafana-${GRAFANA_VERSION}.linux-amd64.tar.gz"; \
|
| 40 |
+
tar -xzf /tmp/grafana.tar.gz -C /tmp; \
|
| 41 |
+
GRAFANA_DIR="$(find /tmp -maxdepth 1 -type d -name "grafana-*" | head -n 1)"; \
|
| 42 |
+
cp -a "${GRAFANA_DIR}/." /opt/grafana/; \
|
| 43 |
+
rm -rf /tmp/prometheus* /tmp/grafana*; \
|
| 44 |
+
chmod +x /app/deploy/entrypoint.sh
|
| 45 |
+
|
| 46 |
+
COPY deploy/nginx.conf /etc/nginx/nginx.conf
|
| 47 |
+
COPY deploy/prometheus.yml /etc/prometheus/prometheus.yml
|
| 48 |
+
COPY deploy/index.html /var/www/html/index.html
|
| 49 |
+
COPY deploy/grafana/grafana.ini /etc/grafana/grafana.ini
|
| 50 |
+
COPY deploy/grafana/provisioning /etc/grafana/provisioning
|
| 51 |
+
|
| 52 |
+
EXPOSE 7860
|
| 53 |
+
|
| 54 |
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
| 55 |
+
CMD curl -fsS http://127.0.0.1:7860/health || exit 1
|
| 56 |
+
|
| 57 |
+
CMD ["/app/deploy/entrypoint.sh"]
|
README.md
CHANGED
|
@@ -5,8 +5,8 @@ colorFrom: gray
|
|
| 5 |
colorTo: red
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
-
app_port:
|
| 9 |
-
base_path: /
|
| 10 |
tags:
|
| 11 |
- openenv
|
| 12 |
---
|
|
|
|
| 5 |
colorTo: red
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
app_port: 7860
|
| 9 |
+
base_path: /
|
| 10 |
tags:
|
| 11 |
- openenv
|
| 12 |
---
|
deploy/entrypoint.sh
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
FASTAPI_PID=""
|
| 5 |
+
PROMETHEUS_PID=""
|
| 6 |
+
GRAFANA_PID=""
|
| 7 |
+
NGINX_PID=""
|
| 8 |
+
MONITOR_PID=""
|
| 9 |
+
|
| 10 |
+
cleanup() {
|
| 11 |
+
for pid in "${MONITOR_PID}" "${NGINX_PID}" "${GRAFANA_PID}" "${PROMETHEUS_PID}" "${FASTAPI_PID}"; do
|
| 12 |
+
if [[ -n "${pid}" ]]; then
|
| 13 |
+
kill "${pid}" 2>/dev/null || true
|
| 14 |
+
fi
|
| 15 |
+
done
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
trap cleanup INT TERM EXIT
|
| 19 |
+
|
| 20 |
+
cd /app
|
| 21 |
+
|
| 22 |
+
uvicorn server.app:app --host 127.0.0.1 --port 8000 &
|
| 23 |
+
FASTAPI_PID=$!
|
| 24 |
+
|
| 25 |
+
/opt/prometheus/prometheus \
|
| 26 |
+
--config.file=/etc/prometheus/prometheus.yml \
|
| 27 |
+
--storage.tsdb.path=/tmp/prometheus-data \
|
| 28 |
+
--web.listen-address=127.0.0.1:9090 \
|
| 29 |
+
--web.route-prefix=/prometheus \
|
| 30 |
+
&
|
| 31 |
+
PROMETHEUS_PID=$!
|
| 32 |
+
|
| 33 |
+
/opt/grafana/bin/grafana-server \
|
| 34 |
+
--homepath /opt/grafana \
|
| 35 |
+
--config /etc/grafana/grafana.ini \
|
| 36 |
+
cfg:default.paths.data=/var/lib/grafana \
|
| 37 |
+
cfg:default.paths.logs=/var/log/grafana \
|
| 38 |
+
cfg:default.paths.plugins=/var/lib/grafana/plugins \
|
| 39 |
+
cfg:default.paths.provisioning=/etc/grafana/provisioning \
|
| 40 |
+
&
|
| 41 |
+
GRAFANA_PID=$!
|
| 42 |
+
|
| 43 |
+
nginx -g "daemon off;" &
|
| 44 |
+
NGINX_PID=$!
|
| 45 |
+
|
| 46 |
+
monitor_children() {
|
| 47 |
+
while true; do
|
| 48 |
+
for pid in "${FASTAPI_PID}" "${PROMETHEUS_PID}" "${GRAFANA_PID}"; do
|
| 49 |
+
if ! kill -0 "${pid}" 2>/dev/null; then
|
| 50 |
+
echo "A backend service exited unexpectedly." >&2
|
| 51 |
+
kill "${NGINX_PID}" 2>/dev/null || true
|
| 52 |
+
exit 1
|
| 53 |
+
fi
|
| 54 |
+
done
|
| 55 |
+
sleep 2
|
| 56 |
+
done
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
monitor_children &
|
| 60 |
+
MONITOR_PID=$!
|
| 61 |
+
|
| 62 |
+
wait "${NGINX_PID}"
|
deploy/grafana/grafana.ini
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[server]
|
| 2 |
+
http_addr = 127.0.0.1
|
| 3 |
+
http_port = 3000
|
| 4 |
+
domain = localhost
|
| 5 |
+
root_url = /grafana/
|
| 6 |
+
serve_from_sub_path = true
|
| 7 |
+
router_logging = false
|
| 8 |
+
enable_gzip = true
|
| 9 |
+
|
| 10 |
+
[auth]
|
| 11 |
+
disable_login_form = false
|
| 12 |
+
|
| 13 |
+
[auth.anonymous]
|
| 14 |
+
enabled = true
|
| 15 |
+
org_role = Viewer
|
| 16 |
+
|
| 17 |
+
[dashboards]
|
| 18 |
+
default_home_dashboard_path = /etc/grafana/provisioning/dashboards/json/antiatropos-overview.json
|
| 19 |
+
|
| 20 |
+
[security]
|
| 21 |
+
allow_embedding = true
|
deploy/grafana/provisioning/dashboards/dashboard.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
apiVersion: 1
|
| 2 |
+
|
| 3 |
+
providers:
|
| 4 |
+
- name: AntiAtropos Dashboards
|
| 5 |
+
orgId: 1
|
| 6 |
+
folder: AntiAtropos
|
| 7 |
+
type: file
|
| 8 |
+
disableDeletion: false
|
| 9 |
+
editable: true
|
| 10 |
+
updateIntervalSeconds: 30
|
| 11 |
+
options:
|
| 12 |
+
path: /etc/grafana/provisioning/dashboards/json
|
deploy/grafana/provisioning/dashboards/json/antiatropos-overview.json
ADDED
|
@@ -0,0 +1,642 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"annotations": {
|
| 3 |
+
"list": [
|
| 4 |
+
{
|
| 5 |
+
"builtIn": 1,
|
| 6 |
+
"datasource": {
|
| 7 |
+
"type": "grafana",
|
| 8 |
+
"uid": "-- Grafana --"
|
| 9 |
+
},
|
| 10 |
+
"enable": true,
|
| 11 |
+
"hide": true,
|
| 12 |
+
"iconColor": "rgba(0, 211, 255, 1)",
|
| 13 |
+
"name": "Annotations & Alerts",
|
| 14 |
+
"type": "dashboard"
|
| 15 |
+
}
|
| 16 |
+
]
|
| 17 |
+
},
|
| 18 |
+
"editable": true,
|
| 19 |
+
"fiscalYearStartMonth": 0,
|
| 20 |
+
"graphTooltip": 1,
|
| 21 |
+
"id": null,
|
| 22 |
+
"links": [],
|
| 23 |
+
"liveNow": false,
|
| 24 |
+
"panels": [
|
| 25 |
+
{
|
| 26 |
+
"datasource": {
|
| 27 |
+
"type": "prometheus",
|
| 28 |
+
"uid": "PBFA97CFB590B2093"
|
| 29 |
+
},
|
| 30 |
+
"fieldConfig": {
|
| 31 |
+
"defaults": {
|
| 32 |
+
"color": {
|
| 33 |
+
"mode": "thresholds"
|
| 34 |
+
},
|
| 35 |
+
"decimals": 3,
|
| 36 |
+
"mappings": [],
|
| 37 |
+
"thresholds": {
|
| 38 |
+
"mode": "absolute",
|
| 39 |
+
"steps": [
|
| 40 |
+
{
|
| 41 |
+
"color": "green",
|
| 42 |
+
"value": null
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"color": "red",
|
| 46 |
+
"value": 0
|
| 47 |
+
}
|
| 48 |
+
]
|
| 49 |
+
},
|
| 50 |
+
"unit": "short"
|
| 51 |
+
},
|
| 52 |
+
"overrides": []
|
| 53 |
+
},
|
| 54 |
+
"gridPos": {
|
| 55 |
+
"h": 4,
|
| 56 |
+
"w": 6,
|
| 57 |
+
"x": 0,
|
| 58 |
+
"y": 0
|
| 59 |
+
},
|
| 60 |
+
"id": 1,
|
| 61 |
+
"options": {
|
| 62 |
+
"colorMode": "value",
|
| 63 |
+
"graphMode": "none",
|
| 64 |
+
"justifyMode": "auto",
|
| 65 |
+
"orientation": "auto",
|
| 66 |
+
"reduceOptions": {
|
| 67 |
+
"calcs": [
|
| 68 |
+
"lastNotNull"
|
| 69 |
+
],
|
| 70 |
+
"fields": "",
|
| 71 |
+
"values": false
|
| 72 |
+
},
|
| 73 |
+
"textMode": "auto"
|
| 74 |
+
},
|
| 75 |
+
"pluginVersion": "12.3.1",
|
| 76 |
+
"targets": [
|
| 77 |
+
{
|
| 78 |
+
"editorMode": "code",
|
| 79 |
+
"expr": "antiatropos_reward",
|
| 80 |
+
"legendFormat": "reward",
|
| 81 |
+
"range": true,
|
| 82 |
+
"refId": "A"
|
| 83 |
+
}
|
| 84 |
+
],
|
| 85 |
+
"title": "Latest Reward",
|
| 86 |
+
"type": "stat"
|
| 87 |
+
},
|
| 88 |
+
{
|
| 89 |
+
"datasource": {
|
| 90 |
+
"type": "prometheus",
|
| 91 |
+
"uid": "PBFA97CFB590B2093"
|
| 92 |
+
},
|
| 93 |
+
"fieldConfig": {
|
| 94 |
+
"defaults": {
|
| 95 |
+
"color": {
|
| 96 |
+
"mode": "thresholds"
|
| 97 |
+
},
|
| 98 |
+
"decimals": 3,
|
| 99 |
+
"mappings": [],
|
| 100 |
+
"thresholds": {
|
| 101 |
+
"mode": "absolute",
|
| 102 |
+
"steps": [
|
| 103 |
+
{
|
| 104 |
+
"color": "green",
|
| 105 |
+
"value": null
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"color": "orange",
|
| 109 |
+
"value": 0.4
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"color": "red",
|
| 113 |
+
"value": 0.8
|
| 114 |
+
}
|
| 115 |
+
]
|
| 116 |
+
},
|
| 117 |
+
"unit": "short"
|
| 118 |
+
},
|
| 119 |
+
"overrides": []
|
| 120 |
+
},
|
| 121 |
+
"gridPos": {
|
| 122 |
+
"h": 4,
|
| 123 |
+
"w": 6,
|
| 124 |
+
"x": 6,
|
| 125 |
+
"y": 0
|
| 126 |
+
},
|
| 127 |
+
"id": 2,
|
| 128 |
+
"options": {
|
| 129 |
+
"colorMode": "value",
|
| 130 |
+
"graphMode": "none",
|
| 131 |
+
"justifyMode": "auto",
|
| 132 |
+
"orientation": "auto",
|
| 133 |
+
"reduceOptions": {
|
| 134 |
+
"calcs": [
|
| 135 |
+
"lastNotNull"
|
| 136 |
+
],
|
| 137 |
+
"fields": "",
|
| 138 |
+
"values": false
|
| 139 |
+
},
|
| 140 |
+
"textMode": "auto"
|
| 141 |
+
},
|
| 142 |
+
"pluginVersion": "12.3.1",
|
| 143 |
+
"targets": [
|
| 144 |
+
{
|
| 145 |
+
"editorMode": "code",
|
| 146 |
+
"expr": "antiatropos_total_queue_backlog",
|
| 147 |
+
"legendFormat": "queue backlog",
|
| 148 |
+
"range": true,
|
| 149 |
+
"refId": "A"
|
| 150 |
+
}
|
| 151 |
+
],
|
| 152 |
+
"title": "Queue Backlog (Norm)",
|
| 153 |
+
"type": "stat"
|
| 154 |
+
},
|
| 155 |
+
{
|
| 156 |
+
"datasource": {
|
| 157 |
+
"type": "prometheus",
|
| 158 |
+
"uid": "PBFA97CFB590B2093"
|
| 159 |
+
},
|
| 160 |
+
"fieldConfig": {
|
| 161 |
+
"defaults": {
|
| 162 |
+
"color": {
|
| 163 |
+
"mode": "thresholds"
|
| 164 |
+
},
|
| 165 |
+
"decimals": 3,
|
| 166 |
+
"mappings": [],
|
| 167 |
+
"thresholds": {
|
| 168 |
+
"mode": "absolute",
|
| 169 |
+
"steps": [
|
| 170 |
+
{
|
| 171 |
+
"color": "green",
|
| 172 |
+
"value": null
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"color": "orange",
|
| 176 |
+
"value": 0.4
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"color": "red",
|
| 180 |
+
"value": 0.8
|
| 181 |
+
}
|
| 182 |
+
]
|
| 183 |
+
},
|
| 184 |
+
"unit": "short"
|
| 185 |
+
},
|
| 186 |
+
"overrides": []
|
| 187 |
+
},
|
| 188 |
+
"gridPos": {
|
| 189 |
+
"h": 4,
|
| 190 |
+
"w": 6,
|
| 191 |
+
"x": 12,
|
| 192 |
+
"y": 0
|
| 193 |
+
},
|
| 194 |
+
"id": 3,
|
| 195 |
+
"options": {
|
| 196 |
+
"colorMode": "value",
|
| 197 |
+
"graphMode": "none",
|
| 198 |
+
"justifyMode": "auto",
|
| 199 |
+
"orientation": "auto",
|
| 200 |
+
"reduceOptions": {
|
| 201 |
+
"calcs": [
|
| 202 |
+
"lastNotNull"
|
| 203 |
+
],
|
| 204 |
+
"fields": "",
|
| 205 |
+
"values": false
|
| 206 |
+
},
|
| 207 |
+
"textMode": "auto"
|
| 208 |
+
},
|
| 209 |
+
"pluginVersion": "12.3.1",
|
| 210 |
+
"targets": [
|
| 211 |
+
{
|
| 212 |
+
"editorMode": "code",
|
| 213 |
+
"expr": "antiatropos_average_latency_norm",
|
| 214 |
+
"legendFormat": "latency",
|
| 215 |
+
"range": true,
|
| 216 |
+
"refId": "A"
|
| 217 |
+
}
|
| 218 |
+
],
|
| 219 |
+
"title": "Latency (Norm)",
|
| 220 |
+
"type": "stat"
|
| 221 |
+
},
|
| 222 |
+
{
|
| 223 |
+
"datasource": {
|
| 224 |
+
"type": "prometheus",
|
| 225 |
+
"uid": "PBFA97CFB590B2093"
|
| 226 |
+
},
|
| 227 |
+
"fieldConfig": {
|
| 228 |
+
"defaults": {
|
| 229 |
+
"color": {
|
| 230 |
+
"mode": "thresholds"
|
| 231 |
+
},
|
| 232 |
+
"decimals": 3,
|
| 233 |
+
"mappings": [],
|
| 234 |
+
"thresholds": {
|
| 235 |
+
"mode": "absolute",
|
| 236 |
+
"steps": [
|
| 237 |
+
{
|
| 238 |
+
"color": "green",
|
| 239 |
+
"value": null
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"color": "orange",
|
| 243 |
+
"value": 100
|
| 244 |
+
},
|
| 245 |
+
{
|
| 246 |
+
"color": "red",
|
| 247 |
+
"value": 1000
|
| 248 |
+
}
|
| 249 |
+
]
|
| 250 |
+
},
|
| 251 |
+
"unit": "short"
|
| 252 |
+
},
|
| 253 |
+
"overrides": []
|
| 254 |
+
},
|
| 255 |
+
"gridPos": {
|
| 256 |
+
"h": 4,
|
| 257 |
+
"w": 6,
|
| 258 |
+
"x": 18,
|
| 259 |
+
"y": 0
|
| 260 |
+
},
|
| 261 |
+
"id": 4,
|
| 262 |
+
"options": {
|
| 263 |
+
"colorMode": "value",
|
| 264 |
+
"graphMode": "none",
|
| 265 |
+
"justifyMode": "auto",
|
| 266 |
+
"orientation": "auto",
|
| 267 |
+
"reduceOptions": {
|
| 268 |
+
"calcs": [
|
| 269 |
+
"lastNotNull"
|
| 270 |
+
],
|
| 271 |
+
"fields": "",
|
| 272 |
+
"values": false
|
| 273 |
+
},
|
| 274 |
+
"textMode": "auto"
|
| 275 |
+
},
|
| 276 |
+
"pluginVersion": "12.3.1",
|
| 277 |
+
"targets": [
|
| 278 |
+
{
|
| 279 |
+
"editorMode": "code",
|
| 280 |
+
"expr": "antiatropos_lyapunov_energy",
|
| 281 |
+
"legendFormat": "lyapunov energy",
|
| 282 |
+
"range": true,
|
| 283 |
+
"refId": "A"
|
| 284 |
+
}
|
| 285 |
+
],
|
| 286 |
+
"title": "Lyapunov Energy",
|
| 287 |
+
"type": "stat"
|
| 288 |
+
},
|
| 289 |
+
{
|
| 290 |
+
"datasource": {
|
| 291 |
+
"type": "prometheus",
|
| 292 |
+
"uid": "PBFA97CFB590B2093"
|
| 293 |
+
},
|
| 294 |
+
"fieldConfig": {
|
| 295 |
+
"defaults": {
|
| 296 |
+
"color": {
|
| 297 |
+
"mode": "palette-classic"
|
| 298 |
+
},
|
| 299 |
+
"custom": {
|
| 300 |
+
"axisBorderShow": false,
|
| 301 |
+
"axisCenteredZero": false,
|
| 302 |
+
"axisColorMode": "text",
|
| 303 |
+
"axisLabel": "",
|
| 304 |
+
"axisPlacement": "auto",
|
| 305 |
+
"barAlignment": 0,
|
| 306 |
+
"drawStyle": "line",
|
| 307 |
+
"fillOpacity": 10,
|
| 308 |
+
"gradientMode": "none",
|
| 309 |
+
"hideFrom": {
|
| 310 |
+
"legend": false,
|
| 311 |
+
"tooltip": false,
|
| 312 |
+
"viz": false
|
| 313 |
+
},
|
| 314 |
+
"insertNulls": false,
|
| 315 |
+
"lineInterpolation": "linear",
|
| 316 |
+
"lineWidth": 2,
|
| 317 |
+
"pointSize": 3,
|
| 318 |
+
"scaleDistribution": {
|
| 319 |
+
"type": "linear"
|
| 320 |
+
},
|
| 321 |
+
"showPoints": "auto",
|
| 322 |
+
"spanNulls": false,
|
| 323 |
+
"stacking": {
|
| 324 |
+
"group": "A",
|
| 325 |
+
"mode": "none"
|
| 326 |
+
},
|
| 327 |
+
"thresholdsStyle": {
|
| 328 |
+
"mode": "off"
|
| 329 |
+
}
|
| 330 |
+
},
|
| 331 |
+
"mappings": [],
|
| 332 |
+
"thresholds": {
|
| 333 |
+
"mode": "absolute",
|
| 334 |
+
"steps": [
|
| 335 |
+
{
|
| 336 |
+
"color": "green",
|
| 337 |
+
"value": null
|
| 338 |
+
},
|
| 339 |
+
{
|
| 340 |
+
"color": "red",
|
| 341 |
+
"value": 80
|
| 342 |
+
}
|
| 343 |
+
]
|
| 344 |
+
},
|
| 345 |
+
"unit": "short"
|
| 346 |
+
},
|
| 347 |
+
"overrides": []
|
| 348 |
+
},
|
| 349 |
+
"gridPos": {
|
| 350 |
+
"h": 8,
|
| 351 |
+
"w": 12,
|
| 352 |
+
"x": 0,
|
| 353 |
+
"y": 4
|
| 354 |
+
},
|
| 355 |
+
"id": 5,
|
| 356 |
+
"options": {
|
| 357 |
+
"legend": {
|
| 358 |
+
"calcs": [],
|
| 359 |
+
"displayMode": "list",
|
| 360 |
+
"placement": "bottom",
|
| 361 |
+
"showLegend": true
|
| 362 |
+
},
|
| 363 |
+
"tooltip": {
|
| 364 |
+
"mode": "single",
|
| 365 |
+
"sort": "none"
|
| 366 |
+
}
|
| 367 |
+
},
|
| 368 |
+
"pluginVersion": "12.3.1",
|
| 369 |
+
"targets": [
|
| 370 |
+
{
|
| 371 |
+
"editorMode": "code",
|
| 372 |
+
"expr": "antiatropos_reward",
|
| 373 |
+
"legendFormat": "reward {{task_id}}",
|
| 374 |
+
"range": true,
|
| 375 |
+
"refId": "A"
|
| 376 |
+
},
|
| 377 |
+
{
|
| 378 |
+
"editorMode": "code",
|
| 379 |
+
"expr": "antiatropos_lyapunov_energy",
|
| 380 |
+
"legendFormat": "lyapunov {{task_id}}",
|
| 381 |
+
"range": true,
|
| 382 |
+
"refId": "B"
|
| 383 |
+
}
|
| 384 |
+
],
|
| 385 |
+
"title": "Reward and Lyapunov Trend",
|
| 386 |
+
"type": "timeseries"
|
| 387 |
+
},
|
| 388 |
+
{
|
| 389 |
+
"datasource": {
|
| 390 |
+
"type": "prometheus",
|
| 391 |
+
"uid": "PBFA97CFB590B2093"
|
| 392 |
+
},
|
| 393 |
+
"fieldConfig": {
|
| 394 |
+
"defaults": {
|
| 395 |
+
"color": {
|
| 396 |
+
"mode": "palette-classic"
|
| 397 |
+
},
|
| 398 |
+
"custom": {
|
| 399 |
+
"axisBorderShow": false,
|
| 400 |
+
"axisCenteredZero": false,
|
| 401 |
+
"axisColorMode": "text",
|
| 402 |
+
"axisLabel": "",
|
| 403 |
+
"axisPlacement": "auto",
|
| 404 |
+
"barAlignment": 0,
|
| 405 |
+
"drawStyle": "line",
|
| 406 |
+
"fillOpacity": 10,
|
| 407 |
+
"gradientMode": "none",
|
| 408 |
+
"hideFrom": {
|
| 409 |
+
"legend": false,
|
| 410 |
+
"tooltip": false,
|
| 411 |
+
"viz": false
|
| 412 |
+
},
|
| 413 |
+
"insertNulls": false,
|
| 414 |
+
"lineInterpolation": "linear",
|
| 415 |
+
"lineWidth": 2,
|
| 416 |
+
"pointSize": 3,
|
| 417 |
+
"scaleDistribution": {
|
| 418 |
+
"type": "linear"
|
| 419 |
+
},
|
| 420 |
+
"showPoints": "auto",
|
| 421 |
+
"spanNulls": false,
|
| 422 |
+
"stacking": {
|
| 423 |
+
"group": "A",
|
| 424 |
+
"mode": "none"
|
| 425 |
+
},
|
| 426 |
+
"thresholdsStyle": {
|
| 427 |
+
"mode": "off"
|
| 428 |
+
}
|
| 429 |
+
},
|
| 430 |
+
"mappings": [],
|
| 431 |
+
"thresholds": {
|
| 432 |
+
"mode": "absolute",
|
| 433 |
+
"steps": [
|
| 434 |
+
{
|
| 435 |
+
"color": "green",
|
| 436 |
+
"value": null
|
| 437 |
+
},
|
| 438 |
+
{
|
| 439 |
+
"color": "red",
|
| 440 |
+
"value": 80
|
| 441 |
+
}
|
| 442 |
+
]
|
| 443 |
+
},
|
| 444 |
+
"unit": "short"
|
| 445 |
+
},
|
| 446 |
+
"overrides": []
|
| 447 |
+
},
|
| 448 |
+
"gridPos": {
|
| 449 |
+
"h": 8,
|
| 450 |
+
"w": 12,
|
| 451 |
+
"x": 12,
|
| 452 |
+
"y": 4
|
| 453 |
+
},
|
| 454 |
+
"id": 6,
|
| 455 |
+
"options": {
|
| 456 |
+
"legend": {
|
| 457 |
+
"calcs": [],
|
| 458 |
+
"displayMode": "list",
|
| 459 |
+
"placement": "bottom",
|
| 460 |
+
"showLegend": true
|
| 461 |
+
},
|
| 462 |
+
"tooltip": {
|
| 463 |
+
"mode": "single",
|
| 464 |
+
"sort": "none"
|
| 465 |
+
}
|
| 466 |
+
},
|
| 467 |
+
"pluginVersion": "12.3.1",
|
| 468 |
+
"targets": [
|
| 469 |
+
{
|
| 470 |
+
"editorMode": "code",
|
| 471 |
+
"expr": "antiatropos_total_queue_backlog",
|
| 472 |
+
"legendFormat": "queue {{task_id}}",
|
| 473 |
+
"range": true,
|
| 474 |
+
"refId": "A"
|
| 475 |
+
},
|
| 476 |
+
{
|
| 477 |
+
"editorMode": "code",
|
| 478 |
+
"expr": "antiatropos_average_latency_norm",
|
| 479 |
+
"legendFormat": "latency {{task_id}}",
|
| 480 |
+
"range": true,
|
| 481 |
+
"refId": "B"
|
| 482 |
+
}
|
| 483 |
+
],
|
| 484 |
+
"title": "Queue and Latency Trend",
|
| 485 |
+
"type": "timeseries"
|
| 486 |
+
},
|
| 487 |
+
{
|
| 488 |
+
"datasource": {
|
| 489 |
+
"type": "prometheus",
|
| 490 |
+
"uid": "PBFA97CFB590B2093"
|
| 491 |
+
},
|
| 492 |
+
"fieldConfig": {
|
| 493 |
+
"defaults": {
|
| 494 |
+
"color": {
|
| 495 |
+
"mode": "palette-classic"
|
| 496 |
+
},
|
| 497 |
+
"mappings": [],
|
| 498 |
+
"thresholds": {
|
| 499 |
+
"mode": "absolute",
|
| 500 |
+
"steps": [
|
| 501 |
+
{
|
| 502 |
+
"color": "green",
|
| 503 |
+
"value": null
|
| 504 |
+
},
|
| 505 |
+
{
|
| 506 |
+
"color": "red",
|
| 507 |
+
"value": 80
|
| 508 |
+
}
|
| 509 |
+
]
|
| 510 |
+
},
|
| 511 |
+
"unit": "short"
|
| 512 |
+
},
|
| 513 |
+
"overrides": []
|
| 514 |
+
},
|
| 515 |
+
"gridPos": {
|
| 516 |
+
"h": 8,
|
| 517 |
+
"w": 12,
|
| 518 |
+
"x": 0,
|
| 519 |
+
"y": 12
|
| 520 |
+
},
|
| 521 |
+
"id": 7,
|
| 522 |
+
"options": {
|
| 523 |
+
"legend": {
|
| 524 |
+
"calcs": [],
|
| 525 |
+
"displayMode": "list",
|
| 526 |
+
"placement": "bottom",
|
| 527 |
+
"showLegend": true
|
| 528 |
+
},
|
| 529 |
+
"tooltip": {
|
| 530 |
+
"mode": "single",
|
| 531 |
+
"sort": "none"
|
| 532 |
+
}
|
| 533 |
+
},
|
| 534 |
+
"pluginVersion": "12.3.1",
|
| 535 |
+
"targets": [
|
| 536 |
+
{
|
| 537 |
+
"editorMode": "code",
|
| 538 |
+
"expr": "rate(antiatropos_steps_total[1m])",
|
| 539 |
+
"legendFormat": "steps/sec {{task_id}}",
|
| 540 |
+
"range": true,
|
| 541 |
+
"refId": "A"
|
| 542 |
+
},
|
| 543 |
+
{
|
| 544 |
+
"editorMode": "code",
|
| 545 |
+
"expr": "rate(antiatropos_actions_total[1m])",
|
| 546 |
+
"legendFormat": "actions/sec {{action_type}}",
|
| 547 |
+
"range": true,
|
| 548 |
+
"refId": "B"
|
| 549 |
+
}
|
| 550 |
+
],
|
| 551 |
+
"title": "Action Throughput",
|
| 552 |
+
"type": "timeseries"
|
| 553 |
+
},
|
| 554 |
+
{
|
| 555 |
+
"datasource": {
|
| 556 |
+
"type": "prometheus",
|
| 557 |
+
"uid": "PBFA97CFB590B2093"
|
| 558 |
+
},
|
| 559 |
+
"fieldConfig": {
|
| 560 |
+
"defaults": {
|
| 561 |
+
"color": {
|
| 562 |
+
"mode": "palette-classic"
|
| 563 |
+
},
|
| 564 |
+
"mappings": [],
|
| 565 |
+
"thresholds": {
|
| 566 |
+
"mode": "absolute",
|
| 567 |
+
"steps": [
|
| 568 |
+
{
|
| 569 |
+
"color": "green",
|
| 570 |
+
"value": null
|
| 571 |
+
},
|
| 572 |
+
{
|
| 573 |
+
"color": "red",
|
| 574 |
+
"value": 1
|
| 575 |
+
}
|
| 576 |
+
]
|
| 577 |
+
},
|
| 578 |
+
"unit": "short"
|
| 579 |
+
},
|
| 580 |
+
"overrides": []
|
| 581 |
+
},
|
| 582 |
+
"gridPos": {
|
| 583 |
+
"h": 8,
|
| 584 |
+
"w": 12,
|
| 585 |
+
"x": 12,
|
| 586 |
+
"y": 12
|
| 587 |
+
},
|
| 588 |
+
"id": 8,
|
| 589 |
+
"options": {
|
| 590 |
+
"legend": {
|
| 591 |
+
"calcs": [],
|
| 592 |
+
"displayMode": "list",
|
| 593 |
+
"placement": "bottom",
|
| 594 |
+
"showLegend": true
|
| 595 |
+
},
|
| 596 |
+
"tooltip": {
|
| 597 |
+
"mode": "single",
|
| 598 |
+
"sort": "none"
|
| 599 |
+
}
|
| 600 |
+
},
|
| 601 |
+
"pluginVersion": "12.3.1",
|
| 602 |
+
"targets": [
|
| 603 |
+
{
|
| 604 |
+
"editorMode": "code",
|
| 605 |
+
"expr": "rate(antiatropos_executor_errors_total[5m])",
|
| 606 |
+
"legendFormat": "executor errors {{error_code}}",
|
| 607 |
+
"range": true,
|
| 608 |
+
"refId": "A"
|
| 609 |
+
},
|
| 610 |
+
{
|
| 611 |
+
"editorMode": "code",
|
| 612 |
+
"expr": "histogram_quantile(0.95, sum(rate(antiatropos_executor_latency_ms_bucket[5m])) by (le, mode))",
|
| 613 |
+
"legendFormat": "p95 executor latency {{mode}}",
|
| 614 |
+
"range": true,
|
| 615 |
+
"refId": "B"
|
| 616 |
+
}
|
| 617 |
+
],
|
| 618 |
+
"title": "Executor Reliability",
|
| 619 |
+
"type": "timeseries"
|
| 620 |
+
}
|
| 621 |
+
],
|
| 622 |
+
"refresh": "5s",
|
| 623 |
+
"schemaVersion": 41,
|
| 624 |
+
"style": "dark",
|
| 625 |
+
"tags": [
|
| 626 |
+
"antiatropos",
|
| 627 |
+
"sre"
|
| 628 |
+
],
|
| 629 |
+
"templating": {
|
| 630 |
+
"list": []
|
| 631 |
+
},
|
| 632 |
+
"time": {
|
| 633 |
+
"from": "now-30m",
|
| 634 |
+
"to": "now"
|
| 635 |
+
},
|
| 636 |
+
"timepicker": {},
|
| 637 |
+
"timezone": "browser",
|
| 638 |
+
"title": "AntiAtropos Overview",
|
| 639 |
+
"uid": "antiatropos-overview",
|
| 640 |
+
"version": 1,
|
| 641 |
+
"weekStart": ""
|
| 642 |
+
}
|
deploy/grafana/provisioning/datasources/prometheus.yaml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
apiVersion: 1
|
| 2 |
+
|
| 3 |
+
datasources:
|
| 4 |
+
- name: Prometheus
|
| 5 |
+
uid: PBFA97CFB590B2093
|
| 6 |
+
type: prometheus
|
| 7 |
+
access: proxy
|
| 8 |
+
url: http://127.0.0.1:9090/prometheus
|
| 9 |
+
isDefault: true
|
| 10 |
+
editable: false
|
deploy/index.html
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>AntiAtropos Control Console</title>
|
| 7 |
+
<style>
|
| 8 |
+
:root {
|
| 9 |
+
--bg: #0b1220;
|
| 10 |
+
--bg-soft: #101a2d;
|
| 11 |
+
--panel: #111d33;
|
| 12 |
+
--line: #2b3d5d;
|
| 13 |
+
--text: #e6edf8;
|
| 14 |
+
--muted: #9bb0cf;
|
| 15 |
+
--accent: #ff5a3d;
|
| 16 |
+
--accent-strong: #e14830;
|
| 17 |
+
--ok: #3dcf8e;
|
| 18 |
+
--bad: #ff6f7f;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
* {
|
| 22 |
+
box-sizing: border-box;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
body {
|
| 26 |
+
margin: 0;
|
| 27 |
+
padding: 24px;
|
| 28 |
+
background:
|
| 29 |
+
radial-gradient(circle at top right, rgba(255, 90, 61, 0.18), transparent 40%),
|
| 30 |
+
radial-gradient(circle at top left, rgba(74, 140, 255, 0.18), transparent 35%),
|
| 31 |
+
var(--bg);
|
| 32 |
+
color: var(--text);
|
| 33 |
+
font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.shell {
|
| 37 |
+
max-width: 1440px;
|
| 38 |
+
margin: 0 auto;
|
| 39 |
+
display: grid;
|
| 40 |
+
gap: 18px;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.card {
|
| 44 |
+
background: linear-gradient(180deg, rgba(17, 29, 51, 0.88), rgba(15, 25, 44, 0.92));
|
| 45 |
+
border: 1px solid var(--line);
|
| 46 |
+
border-radius: 16px;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.header {
|
| 50 |
+
padding: 20px 22px;
|
| 51 |
+
display: flex;
|
| 52 |
+
justify-content: space-between;
|
| 53 |
+
align-items: center;
|
| 54 |
+
gap: 16px;
|
| 55 |
+
flex-wrap: wrap;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.title h1 {
|
| 59 |
+
margin: 0;
|
| 60 |
+
font-size: 1.5rem;
|
| 61 |
+
letter-spacing: 0.01em;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.title p {
|
| 65 |
+
margin: 4px 0 0;
|
| 66 |
+
color: var(--muted);
|
| 67 |
+
font-size: 0.95rem;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
.links {
|
| 71 |
+
display: flex;
|
| 72 |
+
gap: 10px;
|
| 73 |
+
flex-wrap: wrap;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.link-btn {
|
| 77 |
+
display: inline-flex;
|
| 78 |
+
align-items: center;
|
| 79 |
+
justify-content: center;
|
| 80 |
+
height: 38px;
|
| 81 |
+
padding: 0 14px;
|
| 82 |
+
border-radius: 10px;
|
| 83 |
+
border: 1px solid var(--line);
|
| 84 |
+
color: var(--text);
|
| 85 |
+
text-decoration: none;
|
| 86 |
+
background: var(--bg-soft);
|
| 87 |
+
font-size: 0.9rem;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
.layout {
|
| 91 |
+
display: grid;
|
| 92 |
+
grid-template-columns: 1fr;
|
| 93 |
+
gap: 18px;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.controls {
|
| 97 |
+
padding: 16px;
|
| 98 |
+
display: grid;
|
| 99 |
+
grid-template-columns: 1fr;
|
| 100 |
+
gap: 14px;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
.controls-grid {
|
| 104 |
+
display: grid;
|
| 105 |
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
| 106 |
+
gap: 12px;
|
| 107 |
+
align-items: end;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
.field label {
|
| 111 |
+
display: block;
|
| 112 |
+
color: var(--muted);
|
| 113 |
+
font-size: 0.78rem;
|
| 114 |
+
font-weight: 600;
|
| 115 |
+
letter-spacing: 0.04em;
|
| 116 |
+
margin-bottom: 6px;
|
| 117 |
+
text-transform: uppercase;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
.field select,
|
| 121 |
+
.field input {
|
| 122 |
+
width: 100%;
|
| 123 |
+
height: 44px;
|
| 124 |
+
border-radius: 10px;
|
| 125 |
+
border: 1px solid var(--line);
|
| 126 |
+
background: #0c162a;
|
| 127 |
+
color: var(--text);
|
| 128 |
+
padding: 0 12px;
|
| 129 |
+
font-size: 0.95rem;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.actions {
|
| 133 |
+
display: grid;
|
| 134 |
+
grid-template-columns: 180px 1fr;
|
| 135 |
+
gap: 10px;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
.btn {
|
| 139 |
+
border: 1px solid var(--line);
|
| 140 |
+
border-radius: 10px;
|
| 141 |
+
height: 44px;
|
| 142 |
+
cursor: pointer;
|
| 143 |
+
font-weight: 600;
|
| 144 |
+
font-size: 0.95rem;
|
| 145 |
+
color: var(--text);
|
| 146 |
+
background: var(--bg-soft);
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
.btn-primary {
|
| 150 |
+
background: linear-gradient(135deg, var(--accent), var(--accent-strong));
|
| 151 |
+
border-color: transparent;
|
| 152 |
+
color: #fff;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
.metrics {
|
| 156 |
+
padding: 16px;
|
| 157 |
+
display: grid;
|
| 158 |
+
grid-template-columns: repeat(5, minmax(0, 1fr));
|
| 159 |
+
gap: 10px;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
.metric {
|
| 163 |
+
background: #0d172a;
|
| 164 |
+
border: 1px solid var(--line);
|
| 165 |
+
border-radius: 12px;
|
| 166 |
+
padding: 12px;
|
| 167 |
+
min-height: 86px;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
.metric .name {
|
| 171 |
+
color: var(--muted);
|
| 172 |
+
font-size: 0.78rem;
|
| 173 |
+
text-transform: uppercase;
|
| 174 |
+
letter-spacing: 0.05em;
|
| 175 |
+
margin-bottom: 8px;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
.metric .value {
|
| 179 |
+
font-family: Consolas, "SFMono-Regular", Menlo, monospace;
|
| 180 |
+
font-size: 1.18rem;
|
| 181 |
+
font-weight: 700;
|
| 182 |
+
color: var(--text);
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
.metric .value.good {
|
| 186 |
+
color: var(--ok);
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
.metric .value.bad {
|
| 190 |
+
color: var(--bad);
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
.monitor {
|
| 194 |
+
padding: 16px;
|
| 195 |
+
display: grid;
|
| 196 |
+
gap: 10px;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
.monitor-head {
|
| 200 |
+
display: flex;
|
| 201 |
+
justify-content: space-between;
|
| 202 |
+
align-items: center;
|
| 203 |
+
gap: 12px;
|
| 204 |
+
flex-wrap: wrap;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
.monitor-head h2 {
|
| 208 |
+
margin: 0;
|
| 209 |
+
font-size: 1.05rem;
|
| 210 |
+
font-weight: 700;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
.monitor-head p {
|
| 214 |
+
margin: 0;
|
| 215 |
+
color: var(--muted);
|
| 216 |
+
font-size: 0.85rem;
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
.graph-wrap {
|
| 220 |
+
height: 920px;
|
| 221 |
+
border: 1px solid var(--line);
|
| 222 |
+
border-radius: 12px;
|
| 223 |
+
overflow: hidden;
|
| 224 |
+
background: #0a1324;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
iframe {
|
| 228 |
+
width: 100%;
|
| 229 |
+
height: 100%;
|
| 230 |
+
border: 0;
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
.logs {
|
| 234 |
+
padding: 16px;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
.logs h3 {
|
| 238 |
+
margin: 0 0 10px;
|
| 239 |
+
font-size: 0.9rem;
|
| 240 |
+
color: var(--muted);
|
| 241 |
+
text-transform: uppercase;
|
| 242 |
+
letter-spacing: 0.05em;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
#terminal {
|
| 246 |
+
background: #091121;
|
| 247 |
+
border: 1px solid var(--line);
|
| 248 |
+
border-radius: 10px;
|
| 249 |
+
height: 160px;
|
| 250 |
+
overflow-y: auto;
|
| 251 |
+
padding: 10px;
|
| 252 |
+
font-family: Consolas, "SFMono-Regular", Menlo, monospace;
|
| 253 |
+
font-size: 0.83rem;
|
| 254 |
+
color: #c9d6ed;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
.log-line {
|
| 258 |
+
padding: 2px 0;
|
| 259 |
+
border-bottom: 1px solid rgba(155, 176, 207, 0.08);
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.log-time {
|
| 263 |
+
color: #7084a8;
|
| 264 |
+
margin-right: 8px;
|
| 265 |
+
font-size: 0.72rem;
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
@media (max-width: 1120px) {
|
| 269 |
+
.controls-grid {
|
| 270 |
+
grid-template-columns: 1fr 1fr;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
.actions {
|
| 274 |
+
grid-template-columns: 1fr;
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
.metrics {
|
| 278 |
+
grid-template-columns: 1fr 1fr;
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
@media (max-width: 680px) {
|
| 283 |
+
body {
|
| 284 |
+
padding: 12px;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
.controls-grid,
|
| 288 |
+
.metrics {
|
| 289 |
+
grid-template-columns: 1fr;
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
.graph-wrap {
|
| 293 |
+
height: 760px;
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
</style>
|
| 297 |
+
</head>
|
| 298 |
+
<body>
|
| 299 |
+
<div class="shell">
|
| 300 |
+
<header class="card header">
|
| 301 |
+
<div class="title">
|
| 302 |
+
<h1>AntiAtropos SRE Control Console</h1>
|
| 303 |
+
<p>Simulated environment with direct observability through Prometheus and Grafana</p>
|
| 304 |
+
</div>
|
| 305 |
+
<div class="links">
|
| 306 |
+
<a class="link-btn" href="/docs" target="_blank">API Docs</a>
|
| 307 |
+
<a class="link-btn" href="/prometheus/" target="_blank">Open Prometheus</a>
|
| 308 |
+
<a class="link-btn" href="/grafana/" target="_blank">Open Grafana</a>
|
| 309 |
+
</div>
|
| 310 |
+
</header>
|
| 311 |
+
|
| 312 |
+
<main class="layout">
|
| 313 |
+
<section class="card controls">
|
| 314 |
+
<div class="controls-grid">
|
| 315 |
+
<div class="field">
|
| 316 |
+
<label for="action-type">Action Type</label>
|
| 317 |
+
<select id="action-type">
|
| 318 |
+
<option value="NO_OP">NO_OP</option>
|
| 319 |
+
<option value="SCALE_UP">SCALE_UP</option>
|
| 320 |
+
<option value="SCALE_DOWN">SCALE_DOWN</option>
|
| 321 |
+
<option value="REROUTE_TRAFFIC">REROUTE_TRAFFIC</option>
|
| 322 |
+
<option value="SHED_LOAD">SHED_LOAD</option>
|
| 323 |
+
</select>
|
| 324 |
+
</div>
|
| 325 |
+
<div class="field">
|
| 326 |
+
<label for="node-id">Target Node</label>
|
| 327 |
+
<select id="node-id">
|
| 328 |
+
<option value="node-0">node-0 (VIP)</option>
|
| 329 |
+
<option value="node-1">node-1</option>
|
| 330 |
+
<option value="node-2">node-2</option>
|
| 331 |
+
<option value="node-3">node-3</option>
|
| 332 |
+
<option value="node-4">node-4</option>
|
| 333 |
+
</select>
|
| 334 |
+
</div>
|
| 335 |
+
<div class="field">
|
| 336 |
+
<label for="parameter">Parameter</label>
|
| 337 |
+
<input id="parameter" type="number" step="0.1" value="0.0">
|
| 338 |
+
</div>
|
| 339 |
+
<div class="actions">
|
| 340 |
+
<button class="btn btn-primary" onclick="resetEnv()">Reset Episode</button>
|
| 341 |
+
<button class="btn" onclick="stepEnv()">Execute Step</button>
|
| 342 |
+
</div>
|
| 343 |
+
</div>
|
| 344 |
+
</section>
|
| 345 |
+
|
| 346 |
+
<section class="card metrics">
|
| 347 |
+
<div class="metric">
|
| 348 |
+
<div class="name">Cluster ID</div>
|
| 349 |
+
<div id="cluster-id" class="value">---</div>
|
| 350 |
+
</div>
|
| 351 |
+
<div class="metric">
|
| 352 |
+
<div class="name">Reward</div>
|
| 353 |
+
<div id="last-reward" class="value">0.0000</div>
|
| 354 |
+
</div>
|
| 355 |
+
<div class="metric">
|
| 356 |
+
<div class="name">Lyapunov Energy</div>
|
| 357 |
+
<div id="lyapunov-val" class="value">0.0000</div>
|
| 358 |
+
</div>
|
| 359 |
+
<div class="metric">
|
| 360 |
+
<div class="name">Mode</div>
|
| 361 |
+
<div id="mode-val" class="value">simulated</div>
|
| 362 |
+
</div>
|
| 363 |
+
<div class="metric">
|
| 364 |
+
<div class="name">Step</div>
|
| 365 |
+
<div id="step-val" class="value">0</div>
|
| 366 |
+
</div>
|
| 367 |
+
</section>
|
| 368 |
+
|
| 369 |
+
<section class="card monitor">
|
| 370 |
+
<div class="monitor-head">
|
| 371 |
+
<h2>Required Graphs</h2>
|
| 372 |
+
<p>Raw metrics source: Prometheus. Curated dashboard: Grafana.</p>
|
| 373 |
+
</div>
|
| 374 |
+
<div class="graph-wrap">
|
| 375 |
+
<iframe
|
| 376 |
+
id="grafana-iframe"
|
| 377 |
+
src="/grafana/d/antiatropos-overview/antiatropos-overview?kiosk&theme=dark&refresh=5s&from=now-30m&to=now">
|
| 378 |
+
</iframe>
|
| 379 |
+
</div>
|
| 380 |
+
</section>
|
| 381 |
+
|
| 382 |
+
<section class="card logs">
|
| 383 |
+
<h3>System Logs</h3>
|
| 384 |
+
<div id="terminal">
|
| 385 |
+
<div class="log-line"><span class="log-time">[init]</span>Waiting for interaction.</div>
|
| 386 |
+
</div>
|
| 387 |
+
</section>
|
| 388 |
+
</main>
|
| 389 |
+
</div>
|
| 390 |
+
|
| 391 |
+
<script>
|
| 392 |
+
const terminal = document.getElementById("terminal");
|
| 393 |
+
|
| 394 |
+
function log(message, type = "info") {
|
| 395 |
+
const time = new Date().toLocaleTimeString([], {
|
| 396 |
+
hour12: false,
|
| 397 |
+
hour: "2-digit",
|
| 398 |
+
minute: "2-digit",
|
| 399 |
+
second: "2-digit"
|
| 400 |
+
});
|
| 401 |
+
const row = document.createElement("div");
|
| 402 |
+
row.className = "log-line";
|
| 403 |
+
const color = type === "error" ? "#ff6f7f" : type === "success" ? "#3dcf8e" : "#c9d6ed";
|
| 404 |
+
row.innerHTML = '<span class="log-time">[' + time + "]</span><span style=\"color:" + color + "\">" + message + "</span>";
|
| 405 |
+
terminal.appendChild(row);
|
| 406 |
+
terminal.scrollTop = terminal.scrollHeight;
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
function updateUI(data) {
|
| 410 |
+
const observation = data.observation || {};
|
| 411 |
+
const rewardNode = document.getElementById("last-reward");
|
| 412 |
+
const reward = typeof data.reward === "number" ? data.reward : 0;
|
| 413 |
+
|
| 414 |
+
document.getElementById("cluster-id").innerText = (observation.cluster_id || "---").toString().slice(0, 12);
|
| 415 |
+
document.getElementById("lyapunov-val").innerText = Number(observation.lyapunov_energy || 0).toFixed(4);
|
| 416 |
+
document.getElementById("mode-val").innerText = (observation.mode || "simulated").toString();
|
| 417 |
+
document.getElementById("step-val").innerText = String(observation.step || 0);
|
| 418 |
+
|
| 419 |
+
rewardNode.innerText = reward.toFixed(4);
|
| 420 |
+
rewardNode.className = reward < 0 ? "value bad" : "value good";
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
async function resetEnv() {
|
| 424 |
+
log("Resetting environment...");
|
| 425 |
+
try {
|
| 426 |
+
const response = await fetch("/reset", {
|
| 427 |
+
method: "POST",
|
| 428 |
+
headers: { "Content-Type": "application/json" },
|
| 429 |
+
body: JSON.stringify({})
|
| 430 |
+
});
|
| 431 |
+
const data = await response.json();
|
| 432 |
+
updateUI(data);
|
| 433 |
+
log("Environment reset complete.", "success");
|
| 434 |
+
} catch (err) {
|
| 435 |
+
log("Reset failed: " + err.message, "error");
|
| 436 |
+
}
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
async function stepEnv() {
|
| 440 |
+
const action = {
|
| 441 |
+
action_type: document.getElementById("action-type").value,
|
| 442 |
+
target_node_id: document.getElementById("node-id").value,
|
| 443 |
+
parameter: parseFloat(document.getElementById("parameter").value)
|
| 444 |
+
};
|
| 445 |
+
|
| 446 |
+
log("Dispatching " + action.action_type + " to " + action.target_node_id + " (" + action.parameter + ")");
|
| 447 |
+
|
| 448 |
+
try {
|
| 449 |
+
const response = await fetch("/step", {
|
| 450 |
+
method: "POST",
|
| 451 |
+
headers: { "Content-Type": "application/json" },
|
| 452 |
+
body: JSON.stringify({ action: action })
|
| 453 |
+
});
|
| 454 |
+
const data = await response.json();
|
| 455 |
+
|
| 456 |
+
if (data.detail) {
|
| 457 |
+
log("Invalid payload: " + JSON.stringify(data.detail), "error");
|
| 458 |
+
return;
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
updateUI(data);
|
| 462 |
+
log(
|
| 463 |
+
"Step complete. Reward=" + Number(data.reward || 0).toFixed(3) +
|
| 464 |
+
" Lyapunov=" + Number((data.observation || {}).lyapunov_energy || 0).toFixed(3),
|
| 465 |
+
"success"
|
| 466 |
+
);
|
| 467 |
+
} catch (err) {
|
| 468 |
+
log("Execution failed: " + err.message, "error");
|
| 469 |
+
}
|
| 470 |
+
}
|
| 471 |
+
</script>
|
| 472 |
+
</body>
|
| 473 |
+
</html>
|
deploy/nginx.conf
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
worker_processes auto;
|
| 2 |
+
pid /tmp/nginx.pid;
|
| 3 |
+
error_log /dev/stderr info;
|
| 4 |
+
|
| 5 |
+
events {
|
| 6 |
+
worker_connections 1024;
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
http {
|
| 10 |
+
include /etc/nginx/mime.types;
|
| 11 |
+
default_type application/octet-stream;
|
| 12 |
+
sendfile on;
|
| 13 |
+
keepalive_timeout 65;
|
| 14 |
+
access_log /dev/stdout;
|
| 15 |
+
|
| 16 |
+
map $http_upgrade $connection_upgrade {
|
| 17 |
+
default upgrade;
|
| 18 |
+
'' close;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
server {
|
| 22 |
+
listen 7860;
|
| 23 |
+
server_name _;
|
| 24 |
+
|
| 25 |
+
client_max_body_size 50m;
|
| 26 |
+
proxy_read_timeout 3600s;
|
| 27 |
+
proxy_send_timeout 3600s;
|
| 28 |
+
|
| 29 |
+
location = /prometheus {
|
| 30 |
+
return 301 /prometheus/;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
location = /grafana {
|
| 34 |
+
return 301 /grafana/;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
location /prometheus/ {
|
| 38 |
+
proxy_pass http://127.0.0.1:9090;
|
| 39 |
+
proxy_http_version 1.1;
|
| 40 |
+
proxy_set_header Host $host;
|
| 41 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 42 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 43 |
+
proxy_set_header X-Forwarded-Host $host;
|
| 44 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 45 |
+
proxy_set_header X-Forwarded-Prefix /prometheus;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
location /grafana/ {
|
| 49 |
+
proxy_pass http://127.0.0.1:3000;
|
| 50 |
+
proxy_http_version 1.1;
|
| 51 |
+
proxy_set_header Host $host;
|
| 52 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 53 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 54 |
+
proxy_set_header X-Forwarded-Host $host;
|
| 55 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 56 |
+
proxy_set_header X-Forwarded-Prefix /grafana;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
location /grafana/api/live/ {
|
| 60 |
+
proxy_pass http://127.0.0.1:3000;
|
| 61 |
+
proxy_http_version 1.1;
|
| 62 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 63 |
+
proxy_set_header Connection $connection_upgrade;
|
| 64 |
+
proxy_set_header Host $host;
|
| 65 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 66 |
+
proxy_set_header X-Forwarded-Host $host;
|
| 67 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 68 |
+
proxy_set_header X-Forwarded-Prefix /grafana;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
location / {
|
| 72 |
+
root /var/www/html;
|
| 73 |
+
index index.html;
|
| 74 |
+
try_files $uri $uri/ @fastapi;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
location @fastapi {
|
| 78 |
+
proxy_pass http://127.0.0.1:8000;
|
| 79 |
+
proxy_http_version 1.1;
|
| 80 |
+
proxy_set_header Host $host;
|
| 81 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 82 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 83 |
+
proxy_set_header X-Forwarded-Host $host;
|
| 84 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 85 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 86 |
+
proxy_set_header Connection $connection_upgrade;
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
}
|
deploy/prometheus.yml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
global:
|
| 2 |
+
scrape_interval: 15s
|
| 3 |
+
evaluation_interval: 15s
|
| 4 |
+
|
| 5 |
+
scrape_configs:
|
| 6 |
+
- job_name: antiatropos
|
| 7 |
+
metrics_path: /metrics
|
| 8 |
+
static_configs:
|
| 9 |
+
- targets:
|
| 10 |
+
- 127.0.0.1:8000
|
inference.py
CHANGED
|
@@ -4,6 +4,10 @@ import os
|
|
| 4 |
import textwrap
|
| 5 |
from typing import List, Optional
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
from openai import AsyncOpenAI
|
| 8 |
|
| 9 |
from AntiAtropos.client import AntiAtroposEnv
|
|
@@ -233,7 +237,8 @@ async def run_episode() -> None:
|
|
| 233 |
|
| 234 |
score = max(0.0, min(1.0, grader.score().composite))
|
| 235 |
success = score >= SUCCESS_SCORE_THRESHOLD
|
| 236 |
-
except Exception:
|
|
|
|
| 237 |
success = False
|
| 238 |
finally:
|
| 239 |
if client is not None:
|
|
|
|
| 4 |
import textwrap
|
| 5 |
from typing import List, Optional
|
| 6 |
|
| 7 |
+
from dotenv import load_dotenv
|
| 8 |
+
|
| 9 |
+
load_dotenv() # Load variables from .env file
|
| 10 |
+
|
| 11 |
from openai import AsyncOpenAI
|
| 12 |
|
| 13 |
from AntiAtropos.client import AntiAtroposEnv
|
|
|
|
| 237 |
|
| 238 |
score = max(0.0, min(1.0, grader.score().composite))
|
| 239 |
success = score >= SUCCESS_SCORE_THRESHOLD
|
| 240 |
+
except Exception as e:
|
| 241 |
+
print(f"[CRITICAL ERROR] Episode failed to initialize: {e}")
|
| 242 |
success = False
|
| 243 |
finally:
|
| 244 |
if client is not None:
|
openenv.yaml
CHANGED
|
@@ -3,5 +3,5 @@ name: AntiAtropos
|
|
| 3 |
type: space
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
-
port:
|
| 7 |
|
|
|
|
| 3 |
type: space
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
+
port: 7860
|
| 7 |
|