第一次

This commit is contained in:
ZhuJW
2026-04-16 15:44:32 +08:00
commit 5a98242f2f
171 changed files with 42954 additions and 0 deletions

3
infra/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Cloud infra
All cloud infra scripts for fst data production line, include docker files, k8s configs and terraform scripts.

63
infra/monitor/README.md Normal file
View File

@@ -0,0 +1,63 @@
# Cloud infra monitor
## 环境准备
> Docker Engine
>Grafana & Prometheus docker images
## 服务部署
### 创建工作目录
```bash
mkdir -p ~/grafana/{prometheus,grafana,data}
cd grafana/
sudo chown -R 65534:65534 ~/grafana/data
```
### 部署Grafana
使用docker命令启动
```bash
sudo docker run -d \
--name grafana \
-p 3000:3000 \
-v ~/grafana/grafana:/var/lib/grafana \
-e "GF_SECURITY_ADMIN_PASSWORD=${password}" \
grafana/grafana:latest
```
### 部署Prometheus
使用docker命令启动
```bash
sudo docker run -d \
--name prometheus \
-p 9090:9090 \
-v ~/grafana/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
-v ~/grafana/data:/prometheus \
prom/prometheus:latest \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/prometheus \
--web.console.libraries=/etc/prometheus/console_libraries \
--web.console.templates=/etc/prometheus/consoles \
--web.enable-lifecycle
```
## 验证服务
| 服务 | 地址 | 默认账号/密码 |
| ---------- | ----------------------- |-------------------|
| Prometheus | <http://localhost:9090> | - |
| Grafana | <http://localhost:3000> | admin/${password} |
## 配置数据源
1. 登录 Grafana → Configuration → Data Sources → Add data source
2. 选择 Prometheus
3. 配置参数:
- URL: http://<host>:<port>
- Access: Server (默认)
- 点击 Save & Test
## 导入模板
1. 点击 + → Import → Upload JSON file
2. 选择对应的json文件
3. 点击 Import

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

View File

@@ -0,0 +1,745 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 4,
"links": [],
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 7,
"panels": [],
"title": "10.0.210.6",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 0,
"y": 1
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_retries_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_failures_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Download Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 8,
"y": 1
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_failures_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_retries_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Process Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 16,
"y": 1
},
"id": 15,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_failures_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_retries_total{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Upload Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": [],
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 7,
"x": 0,
"y": 11
},
"id": 5,
"options": {
"displayLabels": [],
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"pieType": "pie",
"reduceOptions": {
"calcs": [],
"fields": "",
"values": false
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_duration_seconds_sum{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_duration_seconds_sum{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_duration_seconds_sum{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Stage Duration",
"type": "piechart"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 11,
"x": 7,
"y": 11
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_batches{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_processing{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_uploading{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Queue Size",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 6,
"x": 18,
"y": 11
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_local_subdir_count{job=\"auto-labeling-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Local Rosbag Sum",
"type": "stat"
}
],
"preload": false,
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "2025-07-15T22:49:59.520Z",
"to": "2025-07-18T21:42:20.460Z"
},
"timepicker": {},
"timezone": "browser",
"title": "Auto Labeling Dashboard",
"uid": "aaa",
"version": 9
}

View File

@@ -0,0 +1,740 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 7,
"panels": [],
"title": "Main",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 0,
"y": 1
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_retries_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_failures_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Download Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 8,
"y": 1
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_failures_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_retries_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Process Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 16,
"y": 1
},
"id": 15,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_failures_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_retries_total{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Upload Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": [],
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 7,
"x": 0,
"y": 11
},
"id": 5,
"options": {
"displayLabels": [],
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"pieType": "pie",
"reduceOptions": {
"calcs": [],
"fields": "",
"values": false
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"exemplar": false,
"expr": "pipeline_download_duration_seconds_sum{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": false,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_duration_seconds_sum{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_duration_seconds_sum{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Stage Duration",
"type": "piechart"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 11,
"x": 7,
"y": 11
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_batches{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_processing{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_uploading{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Queue Size",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 6,
"x": 18,
"y": 11
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_local_file_count{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Local Rosbag Sum",
"type": "stat"
}
],
"preload": false,
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-12h",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "Rosbag Decoder Dashboard",
"uid": "467cc95c-9817-429b-9b61-b951a10b4df2",
"version": 40
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@@ -0,0 +1,745 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 5,
"links": [],
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 7,
"panels": [],
"title": "10.0.210.6",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 0,
"y": 1
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_retries_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_failures_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Download Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 8,
"y": 1
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_failures_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_retries_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Process Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 16,
"y": 1
},
"id": 15,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_failures_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_retries_total{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Upload Stage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": [],
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 7,
"x": 0,
"y": 11
},
"id": 5,
"options": {
"displayLabels": [],
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"pieType": "pie",
"reduceOptions": {
"calcs": [],
"fields": "",
"values": false
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_process_duration_seconds_sum{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_upload_duration_seconds_sum{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_download_duration_seconds_sum{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Stage Duration",
"type": "piechart"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 11,
"x": 7,
"y": 11
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_batches{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_processing{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_queue_uploading{job=\"ldgt-metrics\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Queue Size",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "cen4i7q79xc00d"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 6,
"x": 18,
"y": 11
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.0.1",
"targets": [
{
"disableTextWrap": false,
"editorMode": "builder",
"expr": "pipeline_local_file_count{job=\"rosbag_decoder-metrics\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Local Rosbag Sum",
"type": "stat"
}
],
"preload": false,
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "2025-07-19T05:18:48.389Z",
"to": "2025-07-22T23:20:43.519Z"
},
"timepicker": {},
"timezone": "browser",
"title": "LDGT Dashboard",
"uid": "112",
"version": 8
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

View File

@@ -0,0 +1,20 @@
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'rosbag_decoder-metrics'
metrics_path: /metrics
static_configs:
- targets: ['10.0.210.6:8000']
- job_name: 'auto-labeling-metrics'
scrape_interval: 10s
metrics_path: /metrics
static_configs:
- targets: ['10.0.210.6:8001']
- job_name: 'ldgt-metrics'
scrape_interval: 10s
metrics_path: /metrics
static_configs:
- targets: ['10.0.210.8:8002']

View File

@@ -0,0 +1,6 @@
FROM python:3.12-alpine
ARG RUFF_VERSION="0.9.10"
RUN apk add sudo bash git parallel
RUN pip install ruff==$RUFF_VERSION

View File

@@ -0,0 +1,25 @@
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.12-slim-bookworm AS builder
#FROM artifacts.swf.i.mercedes-benz.com/panguprod-docker/fst_data_pipeline/python:3.12-slim-bookworm AS builder
#COPY --from=artifacts.swf.i.mercedes-benz.com/panguprod-docker/fst_data_pipeline/astral-sh/uv:0.7.21 /uv /uvx /bin/
COPY --from=swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /app
COPY fst_data_pipeline/apps/root_db_api/pyproject.toml fst_data_pipeline/apps/root_db_api/uv.lock ./
RUN uv venv .venv && \
uv pip install -r pyproject.toml
COPY . .
RUN uv pip install --no-deps .
# ---------- 运行时 ----------
#FROM artifacts.swf.i.mercedes-benz.com/panguprod-docker/fst_data_pipeline/python:3.12-slim-bookworm
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.12-slim-bookworm
RUN groupadd -r app && useradd -r -g app app
COPY --from=builder --chown=app:app /app/.venv /app/.venv
COPY --from=builder --chown=app:app /app /app
ENV VIRTUAL_ENV=/app/.venv PATH="/app/.venv/bin:$PATH"
WORKDIR /app
USER app
EXPOSE 5232
CMD ["gunicorn", "fst_data_pipeline.apps.root_db_api.src.app:app", "-b", "0.0.0.0:5232", "-w", "32"]

View File

@@ -0,0 +1,11 @@
version: '3'
services:
python-format:
image: fst_data_pipeline:python-format-v1
build:
dockerfile: Dockerfile.python-format
context: .
volumes:
- ../../..:/fst_data_pipeline
working_dir: /fst_data_pipeline

View File

@@ -0,0 +1,66 @@
#!/usr/bin/env sh
set -euo pipefail
current_dir=$(dirname "$0")
cd "${current_dir}/../../.." || exit
fetch=0
check=0
no_lint=0
fix=0
unsafe_fixes=0
format_all=0
while [ $# -gt 0 ]; do
case "$1" in
--fetch) fetch=1 ;;
--check) check=1 ;;
--no-lint) no_lint=1 ;;
--fix) fix=1 ;;
--unsafe-fixes) unsafe_fixes=1 ;;
--format-all) format_all=1 ;;
*)
echo "ignored unexpected arguments $1"
;;
esac
shift
done
if [ "$fetch" -eq 1 ]; then
git fetch origin
fi
echo -e "\033[33mchecking python code style, wait a moment...\033[0m"
if [ "$format_all" -eq 1 ]; then
py_source_code_files=$(find . -type f -name "*.py" ! -path "*/.venv/*" ! -path "*/venv/*")
else
py_source_code_files=$(git diff --name-only --diff-filter=ACMRTUXB origin/main | grep -E '\.py$' || true)
fi
if [ -n "${py_source_code_files}" ]; then
if [ "$check" -eq 1 ]; then
echo -e "checking python files: \n${py_source_code_files}"
echo -e "-----------------------------------\033[32m ruff checking \033[0m-----------------------------------"
ruff format --respect-gitignore --check --diff --preview ${py_source_code_files}
if [ "$no_lint" -eq 0 ]; then
ruff check --respect-gitignore ${py_source_code_files}
else
echo "no lint!!!"
fi
else
echo -e "fixing python files: \n${py_source_code_files}"
if [ "$fix" -eq 1 ]; then
echo -e "-----------------------------------\033[32m ruff fixing \033[0m-----------------------------------"
ruff check --respect-gitignore --fix ${py_source_code_files}
elif [ "${unsafe_fixes}" -eq 1 ]; then
echo -e "-----------------------------------\033[32m ruff unsafe-fixing \033[0m-----------------------------------"
ruff check --respect-gitignore --fix --unsafe-fixes ${py_source_code_files}
fi
echo -e "-----------------------------------\033[32m ruff formatting \033[0m-----------------------------------"
ruff format --respect-gitignore ${py_source_code_files}
echo -e "\033[32mall python code matches the coding style\033[0m"
fi
else
echo "no python files to process"
fi

View File

@@ -0,0 +1,34 @@
FROM artifacts.swf.i.mercedes-benz.com/panguprod-docker/fst_data_pipeline/ros:noetic-desktop-full-focal
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
# ---------- OS tools ----------
RUN apt-get update && apt-get install -y \
bash \
curl \
wget \
ca-certificates \
python3 \
python3-pip \
tzdata \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# ---------- Python deps ----------
RUN pip3 install --no-cache-dir \
psycopg2-binary \
requests \
tqdm \
coscmd
# ---------- App ----------
WORKDIR /app
COPY runner.py /app/runner.py
COPY merge_ros1.sh /app/merge_ros1.sh
RUN chmod +x /app/merge_ros1.sh
# ROS env
RUN echo "source /opt/ros/noetic/setup.bash" >> /etc/profile
ENTRYPOINT ["python3", "/app/runner.py"]

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -lt 2 ]; then
echo "Usage: merge_ros1.sh OUT.bag IN1.bag [IN2.bag ...]"
exit 1
fi
OUT_BAG="$1"
shift
IN_BAGS=("$@")
source /opt/ros/noetic/setup.bash
echo "[ROS] start roscore"
roscore >/tmp/roscore.log 2>&1 &
ROSCORE_PID=$!
sleep 3
echo "[ROS] start record -> $OUT_BAG"
rosbag record -a -x "/rosout.*" -O "$OUT_BAG" >/tmp/rosbag_record.log 2>&1 &
REC_PID=$!
sleep 2
for b in "${IN_BAGS[@]}"; do
echo "[ROS] play $b"
rosbag play "$b" >/tmp/rosbag_play.log 2>&1
done
echo "[ROS] stop record"
kill -INT "$REC_PID" || true
wait "$REC_PID" || true
echo "[ROS] stop roscore"
kill -INT "$ROSCORE_PID" || true
echo "[ROS] merge done -> $OUT_BAG"

View File

@@ -0,0 +1,270 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import time
import shutil
import logging
import subprocess
from pathlib import Path
from concurrent.futures import ProcessPoolExecutor, as_completed
import psycopg2
# =========================================================
# Logging
# =========================================================
logging.basicConfig(
level=os.getenv("LOG_LEVEL", "INFO").upper(),
format="%(asctime)s | %(levelname)s | %(message)s",
handlers=[logging.StreamHandler()],
)
log = logging.getLogger("pangu_joined_runner")
# =========================================================
# Config (env only)
# =========================================================
PG_DSN = os.getenv(
"PG_DSN",
"host=127.0.0.1 port=5432 dbname=test user=test password=test",
)
TEMP_ROOT = Path(os.getenv("TEMP_ROOT", "/tmp/pangu_join"))
MAX_WORKERS = int(os.getenv("MAX_WORKERS", "2"))
COSCMD_BIN = os.getenv("COSCMD_BIN", "coscmd")
COSCMD_TIMEOUT = int(os.getenv("COSCMD_TIMEOUT", "3600"))
COS_ENDPOINT = os.getenv("COS_ENDPOINT", "")
COS_BUCKET = os.getenv("COS_BUCKET", "")
COS_REGION = os.getenv("COS_REGION", "")
MERGED_PREFIX = os.getenv("MERGED_PREFIX", "joined")
AUTO_FIX = os.getenv("AUTO_FIX", "0") == "1"
# 固定表结构(你已确认)
BAG_TABLE = "bag_list"
JOINED_BAGS_TABLE = "joined_bags"
JOINED_PANGU_TABLE = "joined_pangu"
# =========================================================
# Helpers
# =========================================================
def safe_name(s: str) -> str:
s = (s or "").strip().replace("\\", "/")
s = re.sub(r"/+", "/", s)
s = s.replace("..", "__")
return s.replace("/", "__") or "empty"
def run_cmd(cmd: list[str], *, timeout: int | None = None):
log.info("CMD: %s", " ".join(cmd))
subprocess.run(cmd, check=True, timeout=timeout)
def make_cos_url(key: str) -> str:
k = key.lstrip("/")
if COS_ENDPOINT:
return f"https://{COS_ENDPOINT.rstrip('/')}/{k}"
if COS_BUCKET and COS_REGION:
return f"https://{COS_BUCKET}.cos.{COS_REGION}.myqcloud.com/{k}"
return key
def cos_download(key: str, local: Path):
local.parent.mkdir(parents=True, exist_ok=True)
cos_path = "/" + key.lstrip("/")
run_cmd([COSCMD_BIN, "download", cos_path, str(local)], timeout=COSCMD_TIMEOUT)
def cos_upload(local: Path, key: str) -> str:
cos_path = "/" + key.lstrip("/")
run_cmd([COSCMD_BIN, "upload", str(local), cos_path], timeout=COSCMD_TIMEOUT)
return make_cos_url(key)
# =========================================================
# DB helpers
# =========================================================
def db_fetchall(sql: str, args=()):
with psycopg2.connect(PG_DSN) as conn:
with conn.cursor() as cur:
cur.execute(sql, args)
return cur.fetchall()
def db_execute(sql: str, args=()):
with psycopg2.connect(PG_DSN) as conn:
with conn.cursor() as cur:
cur.execute(sql, args)
conn.commit()
def fetch_parent_ids() -> list[int]:
rows = db_fetchall(
f"SELECT DISTINCT parent_id FROM {JOINED_BAGS_TABLE} ORDER BY parent_id"
)
return [int(r[0]) for r in rows]
def fetch_children_ids(parent_id: int) -> list[int]:
rows = db_fetchall(
f"SELECT child_id FROM {JOINED_BAGS_TABLE} WHERE parent_id=%s",
(parent_id,),
)
return [int(r[0]) for r in rows]
def fetch_bag_meta(bag_id: int) -> tuple[str, str]:
rows = db_fetchall(
f"SELECT name, data_path FROM {BAG_TABLE} WHERE id=%s",
(bag_id,),
)
if not rows:
raise RuntimeError(f"bag_list not found: id={bag_id}")
name, path = rows[0]
if not path:
raise RuntimeError(f"bag data_path empty: id={bag_id}")
return str(name), str(path)
def is_parent_done(parent_name: str) -> bool:
rows = db_fetchall(
f"""
SELECT 1 FROM {JOINED_PANGU_TABLE}
WHERE name=%s AND data_path IS NOT NULL AND data_path<>''
LIMIT 1
""",
(parent_name,),
)
return bool(rows)
def upsert_joined_pangu(name: str, data_path: str):
db_execute(
f"""
INSERT INTO {JOINED_PANGU_TABLE} (name, data_path)
VALUES (%s, %s)
ON CONFLICT (name)
DO UPDATE SET data_path=EXCLUDED.data_path
""",
(name, data_path),
)
# =========================================================
# ROS helpers
# =========================================================
def ros_fix(src: Path) -> Path:
if not AUTO_FIX:
return src
fixed = src.with_suffix(src.suffix + ".fixed.bag")
run_cmd(["rosbag", "fix", str(src), str(fixed)], timeout=COSCMD_TIMEOUT)
return fixed
def ros_merge(out_bag: Path, inputs: list[Path]):
run_cmd(
["/app/merge_ros1.sh", str(out_bag)] + [str(p) for p in inputs],
timeout=COSCMD_TIMEOUT,
)
# =========================================================
# Worker
# =========================================================
def work_one(parent_id: int):
start = time.time()
parent_name, parent_key = fetch_bag_meta(parent_id)
if is_parent_done(parent_name):
log.info(
"[SKIP] parent already done | parent_id=%s name=%s", parent_id, parent_name
)
return
log.info("[START] parent | parent_id=%s name=%s", parent_id, parent_name)
children = fetch_children_ids(parent_id)
log.info("[CHILDREN] parent_id=%s count=%d", parent_id, len(children))
if not children:
log.warning("[EMPTY] no children | parent_id=%s", parent_id)
return
wd = TEMP_ROOT / f"parent_{parent_id}_{safe_name(parent_name)}"
wd.mkdir(parents=True, exist_ok=True)
try:
local_inputs = []
for cid in children:
cname, ckey = fetch_bag_meta(cid)
lp = wd / safe_name(ckey)
log.info("[DOWNLOAD] parent_id=%s child_id=%s key=%s", parent_id, cid, ckey)
cos_download(ckey, lp)
local_inputs.append(ros_fix(lp))
merged_local = wd / f"{safe_name(parent_name)}.bag"
log.info("[MERGE] start | parent_id=%s", parent_id)
ros_merge(merged_local, local_inputs)
log.info("[MERGE] done | parent_id=%s", parent_id)
merged_key = f"{MERGED_PREFIX}/{parent_name}.bag"
log.info("[UPLOAD] parent_id=%s key=%s", parent_id, merged_key)
url = cos_upload(merged_local, merged_key)
upsert_joined_pangu(parent_name, url)
cost = time.time() - start
log.info(
"[DONE] parent | parent_id=%s name=%s cost=%.2fs",
parent_id,
parent_name,
cost,
)
except Exception as e:
log.exception(
"[FAILED] parent | parent_id=%s name=%s error=%s", parent_id, parent_name, e
)
raise
finally:
shutil.rmtree(wd, ignore_errors=True)
# =========================================================
# Main
# =========================================================
def main():
TEMP_ROOT.mkdir(parents=True, exist_ok=True)
log.info(
"runner start | workers=%s TEMP_ROOT=%s AUTO_FIX=%s",
MAX_WORKERS,
TEMP_ROOT,
AUTO_FIX,
)
run_cmd([COSCMD_BIN, "--version"], timeout=30)
run_cmd(["rosbag", "info", "--help"], timeout=30)
parents = fetch_parent_ids()
log.info("parents found: %d", len(parents))
if not parents:
return
with ProcessPoolExecutor(max_workers=MAX_WORKERS) as pool:
futures = {pool.submit(work_one, pid): pid for pid in parents}
for fu in as_completed(futures):
pid = futures[fu]
try:
fu.result()
except Exception:
log.error("parent failed | parent_id=%s", pid)
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,5 @@
FROM alpine:latest
RUN apk add --no-cache bash rsync
COPY fst_data_pipeline/pipelines/volc/bag-copy.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,3 @@
FROM python:3.12-alpine
COPY fst_data_pipeline/pipelines/volc/bag_scanner.py /bag_scanner.py
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ requests

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

99
infra/volc/nginx/nav.html Normal file
View File

@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>FST ToolKit</title>
<style>
/* --- 基础样式 --- */
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial;background:linear-gradient(135deg,#0f172a 0%,#1e293b 100%);padding:20px;min-height:100vh;color:#e2e8f0}
.container{max-width:1200px;margin:0 auto}
h1{text-align:center;margin-bottom:40px;font-size:2.5rem;text-shadow:0 2px 4px rgba(0,0,0,.2)}
.icon-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:30px;padding:20px}
.icon-item{background:rgba(30,41,59,.7);backdrop-filter:blur(10px);border-radius:16px;padding:20px;text-align:center;transition:all .3s ease;cursor:pointer;box-shadow:0 8px 32px rgba(2,8,20,.4);border:1px solid rgba(255,255,255,.08)}
.icon-item:hover{transform:translateY(-8px);box-shadow:0 12px 36px rgba(7,112,219,.25);background:rgba(30,41,59,.9);border-color:rgba(59,130,246,.3)}
.icon-img{width:120px;height:120px;object-fit:contain;margin-bottom:15px;border-radius:16px;background:transparent;padding:12px;box-shadow:0 4px 6px rgba(0,0,0,.1)}
.icon-title{font-size:16px;font-weight:600;color:#f1f5f9;margin-bottom:8px}
.icon-description{font-size:14px;color:#94a3b8;line-height:1.4}
.offline-indicator{position:fixed;top:20px;right:20px;background:rgba(30,41,59,.7);backdrop-filter:blur(10px);color:#94a3b8;padding:10px 20px;border-radius:20px;font-size:14px;display:none;box-shadow:0 4px 6px rgba(0,0,0,.1);border:1px solid rgba(255,255,255,.08);z-index:100}
.offline .offline-indicator{display:block}
/* --- 分割线 --- */
.section-divider{grid-column:1/-1;height:1px;background:linear-gradient(90deg,transparent,rgba(59,130,246,.6),transparent);margin:30px 0 10px;position:relative}
.section-divider::after{content:attr(data-label);position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#0f172a;color:#94a3b8;font-size:calc(13px * var(--divider-scale);padding:0 12px;white-space:nowrap}
@media(max-width:768px){.icon-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:20px}h1{font-size:2rem}}
</style>
</head>
<body>
<div class="offline-indicator">离线模式</div>
<div class="container">
<h1>FST ToolKit</h1>
<div class="icon-grid" id="iconGrid"></div>
</div>
<script>
// 图标配置新增就加一行group 相同即同组
const iconConfig = [
{title:"FST Data Factory", description:"FST annotate factory", iconUrl:"http://10.204.22.130/logo/fst_an.png", link:"http://10.204.22.142:5221/", group:"Cooperation"},
{title:"VLM Portal (TBD)", description:"Search coner case by text & pic", iconUrl:"http://10.204.22.130/logo/vlm.png", link:"", group:"Cooperation"},
{title:"MB Viz (TBD)", description:"MB self-developed Rosbag Viz tools", iconUrl:"http://10.204.22.130/logo/mbviz.png", link:"", group:"Cooperation"},
{title:"Rosbag Data Browser (TBD)", description:"Search all Rosbags by condition", iconUrl:"http://10.204.22.130/logo/browser.png", link:"", group:"Cooperation"},
{title:"Rosetta", description:"Helix annotate platform", iconUrl:"http://10.204.22.130/logo/rosetta.png", link:"http://rosetta.helix.cn.bg.corpintra.net/", group:"Cooperation"},
{title:"ROOT_DB_API", description:"ROOT DB API Swagger Docs", iconUrl:"http://10.204.22.130/logo/API.png", link:"http://10.204.22.135:30000/apidocs/", group:"Tools"},
{title:"pgAdmin4", description:"Postgres web client", iconUrl:"http://10.204.22.130/logo/pg.png", link:"http://10.204.22.135:30001/", group:"Tools"},
{title:"Grafana", description:"Date monitoring & DashBoard", iconUrl:"http://10.204.22.130/logo/grafana.png", link:"http://10.204.22.135:30002/", group:"Tools"},
{title:"Portainer", description:"Docker manager with UI", iconUrl:"http://10.204.22.130/logo/docker.png", link:"http://10.204.22.135:30003/", group:"Tools"},
{title:"TileServer", description:"Offline map provider", iconUrl:"http://10.204.22.130/logo/tile.png", link:"http://10.204.22.135:30005/", group:"Tools"},
{title:"Vault (TBD)", description:"All accounts & password", iconUrl:"http://10.204.22.130/logo/vault.png", link:"", group:"Tools"},
{title:"FST Test Platform", description:"Algorithm & Models testing", iconUrl:"http://10.204.22.130/logo/test.png", link:"http://10.204.22.130:8080/", group:"Cooperation"}
];
function createIconElement(cfg){
const div = document.createElement('div');
div.className = 'icon-item';
div.onclick = () => window.open(cfg.link, '_blank', 'noopener');
div.innerHTML = `
<img class="icon-img" src="${cfg.iconUrl}" alt="${cfg.title}" onerror="this.src='assets/fallback.svg'"/>
<div class="icon-title">${cfg.title}</div>
<div class="icon-description">${cfg.description}</div>`;
return div;
}
function insertDivider(grid, label){
const div = document.createElement('div');
div.className = 'section-divider';
div.setAttribute('data-label', label);
grid.appendChild(div);
}
function initializePage(){
const grid = document.getElementById('iconGrid');
const groups = {};
iconConfig.forEach(item => {
groups[item.group] = groups[item.group] || [];
groups[item.group].push(item);
});
let first = true;
Object.entries(groups).forEach(([name, arr]) => {
insertDivider(grid, name); // 每条组都先插分割线
arr.forEach(cfg => grid.appendChild(createIconElement(cfg)));
});
}
/* 离线提示 & SW 缓存(可选) */
function updateOnlineStatus(){
document.body.classList.toggle('offline', !navigator.onLine);
}
window.addEventListener('load', () => {
initializePage();
updateOnlineStatus();
});
window.addEventListener('online', updateOnlineStatus);
window.addEventListener('offline', updateOnlineStatus);
if ('serviceWorker' in navigator) {
// 如果本地没有 /sw.js 就把下一行注释掉
//navigator.serviceWorker.register('/sw.js').catch(()=>{});
}
</script>
</body>
</html>