Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions AP-XPS.code-workspace

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile_frontend
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /frontend
COPY ./frontend/package*.json /frontend/
RUN npm ci
COPY ./frontend /frontend/
COPY .env /frontend/.env
COPY ./frontend/.env.react /frontend/.env
RUN npm run build

FROM nginx:1.26-alpine
Expand Down
18 changes: 14 additions & 4 deletions Dockerfile_processor
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
FROM python:3.11
FROM python:3.13

WORKDIR /app

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Copy dependency files first for better caching
COPY pyproject.toml /app/

# Copy the rest of the application
COPY . /app
# RUN pip install ./arroyo
RUN pip install --no-cache-dir --upgrade .

CMD ["python", "-m", "tr_ap_xps.apps.processor_cli"]
# Install dependencies
RUN uv pip install --system --no-cache .



ENTRYPOINT ["arroyo", "run"]
1 change: 0 additions & 1 deletion arroyo
Submodule arroyo deleted from feb7eb
18 changes: 18 additions & 0 deletions block_configs/labview_processor_block.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
blocks:
- name: XPS LabVIEW Operator
description: Real-time AP-XPS processor for LabVIEW data

operator:
class: tr_ap_xps.pipeline.xps_operator.build_xps_operator
kwargs:
build_heatmaps: true

listeners:
- class: tr_ap_xps.labview.xps_labview_listener_factory
kwargs:
zmq_connection_address: "tcp://localhost:5555"

publishers:
- class: tr_ap_xps.websockets.xps_ws_publisher_factory
kwargs:
ws_url: "ws://0.0.0.0:8001/xps_operator"
19 changes: 19 additions & 0 deletions block_configs/timepix_processor_block.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
blocks:
- name: XPS Timepix Operator
description: Real-time AP-XPS processor for Timepix data

operator:
class: tr_ap_xps.pipeline.xps_operator.build_xps_operator
kwargs:
build_heatmaps: false
otlp_endpoint: "http://jaeger:4317"

listeners:
- class: tr_ap_xps.timepix.xps_timepix_listener_factory
kwargs:
zmq_connection_address: "tcp://host.docker.internal:5657"

publishers:
- class: tr_ap_xps.websockets.xps_ws_publisher_factory
kwargs:
ws_url: "ws://0.0.0.0:8001/xps_operator"
141 changes: 141 additions & 0 deletions config/grafana-dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"title": "Arroyopy Metrics",
"dashboard": {
"title": "Arroyopy Metrics",
"tags": ["arroyopy", "telemetry"],
"timezone": "browser",
"schemaVersion": 16,
"version": 0,
"refresh": "5s",
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"],
"time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"]
},
"panels": [
{
"id": 1,
"title": "Messages Per Second",
"type": "graph",
"targets": [
{
"expr": "rate(arroyopy_processing_seconds_count[1m])",
"legendFormat": "rate",
"refId": "A"
}
],
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"yaxes": [
{
"label": "messages/sec",
"show": true
},
{
"show": true
}
]
},
{
"id": 2,
"title": "Average Processing Time",
"type": "graph",
"targets": [
{
"expr": "arroyopy_avg_processing_seconds",
"legendFormat": "avg time",
"refId": "A"
}
],
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"yaxes": [
{
"label": "seconds",
"show": true
},
{
"show": true
}
]
},
{
"id": 3,
"title": "Total Messages Processed",
"type": "graph",
"targets": [
{
"expr": "arroyopy_processing_seconds_count",
"legendFormat": "total",
"refId": "A"
}
],
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 8
},
"yaxes": [
{
"label": "total messages",
"show": true
},
{
"show": true
}
]
},
{
"id": 4,
"title": "Processing Time Percentiles",
"type": "graph",
"targets": [
{
"expr": "histogram_quantile(0.50, rate(arroyopy_processing_seconds_bucket[5m]))",
"legendFormat": "p50",
"refId": "A"
},
{
"expr": "histogram_quantile(0.95, rate(arroyopy_processing_seconds_bucket[5m]))",
"legendFormat": "p95",
"refId": "B"
},
{
"expr": "histogram_quantile(0.99, rate(arroyopy_processing_seconds_bucket[5m]))",
"legendFormat": "p99",
"refId": "C"
}
],
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 8
},
"yaxes": [
{
"label": "seconds",
"show": true
},
{
"show": true
}
]
}
]
},
"folderId": 0,
"overwrite": true
}
12 changes: 12 additions & 0 deletions config/grafana-dashboards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: 1

providers:
- name: 'Arroyopy Dashboards'
orgId: 1
folder: ''
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /etc/grafana/provisioning/dashboards
15 changes: 15 additions & 0 deletions config/grafana-datasources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Grafana datasource provisioning configuration

apiVersion: 1

datasources:
# Prometheus datasource
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: true
jsonData:
timeInterval: "5s"
queryTimeout: "60s"
27 changes: 27 additions & 0 deletions config/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Prometheus configuration for Arroyopy metrics

global:
scrape_interval: 15s # How frequently to scrape targets
evaluation_interval: 15s # How frequently to evaluate rules

# Scrape configurations
scrape_configs:
# Arroyopy application metrics
- job_name: 'arroyopy'
static_configs:
- targets: ['host.docker.internal:8000'] # Default metrics port
labels:
service: 'arroyopy'
environment: 'development'

# Scrape more frequently for development
scrape_interval: 5s

# Prometheus itself
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']

# Note: For Linux, you may need to use the host's IP address instead of host.docker.internal
# Find your IP with: ip addr show docker0 | grep inet
# Then replace host.docker.internal with that IP (usually 172.17.0.1)
20 changes: 20 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
dev_processor:
# dcc -f docker-compose-dev.yml run --entrypoint /bin/bash dev_processor -i
build:
context: .
dockerfile: Dockerfile_processor
command: "block_configs/timepix_processor_block.yaml"
restart: unless-stopped

volumes:
- .:/app:rw,z
ports:
- "8001:8001"
networks:
mle_net:

networks:
mle_net:
name: mle_net
driver: bridge
Loading