Skip to content

Commit 9bf2cf5

Browse files
committed
Merge main into dev, resolving conflicts in favor of dev
2 parents 64c80ea + 23ec254 commit 9bf2cf5

99 files changed

Lines changed: 5436 additions & 2027 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Offline Docker Bundle
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: 'Git ref to package (branch, tag, SHA)'
8+
required: true
9+
default: 'timescale-sync'
10+
11+
release:
12+
types: [published]
13+
14+
push:
15+
branches: [ timescale-sync, main, dev ]
16+
17+
env:
18+
REGISTRY: ghcr.io
19+
IMAGE_NAME: ${{ github.repository }}
20+
21+
jobs:
22+
package-offline:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
packages: read
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.event.inputs.ref || github.ref }}
33+
34+
- name: Log in to Container Registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Build cloud-sync image
45+
run: |
46+
docker compose -f universal-telemetry-software/deploy/docker-compose.macbook-base.yml build cloud-sync
47+
48+
- name: Pull all required images
49+
run: |
50+
docker pull ghcr.io/western-formula-racing/daq-radio/universal-telemetry:latest
51+
docker pull ghcr.io/western-formula-racing/daq-radio/pecan:latest
52+
docker pull timescale/timescaledb:latest-pg16
53+
docker pull redis:8.2
54+
docker pull bluenviron/mediamtx:latest
55+
docker pull grafana/grafana:latest
56+
57+
- name: Save images as tarball
58+
run: |
59+
cd universal-telemetry-software/deploy
60+
docker save \
61+
ghcr.io/western-formula-racing/daq-radio/universal-telemetry:latest \
62+
ghcr.io/western-formula-racing/daq-radio/pecan:latest \
63+
timescale/timescaledb:latest-pg16 \
64+
redis:8.2 \
65+
bluenviron/mediamtx:latest \
66+
deploy-cloud-sync:latest \
67+
grafana/grafana:latest \
68+
-o offline/wfr-docker-images.tar
69+
70+
- name: Upload as workflow artifact
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: wfr-docker-images-offline
74+
path: universal-telemetry-software/deploy/offline/wfr-docker-images.tar
75+
retention-days: 30
76+
77+
- name: Upload to Release
78+
if: github.event_name == 'release'
79+
uses: softprops/action-gh-release@v1
80+
with:
81+
files: universal-telemetry-software/deploy/offline/wfr-docker-images.tar
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/telemetry-ci.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,15 @@ jobs:
150150
run: |
151151
pip install \
152152
pytest pytest-asyncio pytest-timeout \
153-
cantools influxdb-client \
154-
websockets redis requests \
155-
"slicks>=0.2.0"
153+
cantools \
154+
websockets redis requests
156155
157156
- name: Run unit tests
158157
working-directory: ./universal-telemetry-software
159158
run: |
160159
python -m pytest \
161160
tests/test_leds.py \
162-
tests/test_influx_bridge.py \
161+
tests/test_helpers.py \
163162
tests/test_car_mode.py \
164163
tests/test_dbc_consistency.py \
165164
tests/test_ws_relay.py \
@@ -193,7 +192,6 @@ jobs:
193192
# ── Pull heavy images in parallel ────────────────────────────────────
194193
- name: Pull base images
195194
run: |
196-
docker pull influxdb:3.5.0-core &
197195
docker pull redis:8.2 &
198196
wait
199197
echo "✓ Images pulled"
@@ -207,10 +205,9 @@ jobs:
207205
run: |
208206
pip install \
209207
pytest pytest-asyncio pytest-timeout \
210-
cantools influxdb-client \
208+
cantools \
211209
websockets redis requests aiohttp \
212-
playwright \
213-
"slicks>=0.2.0"
210+
playwright
214211
215212
- name: Install Playwright browsers
216213
run: playwright install chromium --with-deps
@@ -220,8 +217,9 @@ jobs:
220217
env:
221218
GIT_HASH: ${{ github.sha }}
222219
run: |
220+
docker compose -f deploy/docker-compose.test.yml down -v --remove-orphans || true
223221
docker compose -f deploy/docker-compose.test.yml up -d --build
224-
echo "Waiting for all services (InfluxDB3 needs ~15s)..."
222+
echo "Waiting for all services to become ready..."
225223
sleep 20
226224
227225
- name: Check container health
@@ -319,9 +317,8 @@ jobs:
319317
run: |
320318
pip install \
321319
pytest pytest-asyncio pytest-timeout \
322-
cantools influxdb-client \
323-
websockets redis requests \
324-
"slicks>=0.2.0"
320+
cantools \
321+
websockets redis requests
325322
326323
- name: Start vCAN test stack
327324
working-directory: ./universal-telemetry-software
@@ -653,7 +650,9 @@ jobs:
653650
deploy-pecan-internal-cloudflare:
654651
needs: [detect-changes, unit-tests, integration, vcan]
655652
runs-on: ubuntu-latest
656-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
653+
if: |
654+
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') &&
655+
needs.detect-changes.outputs.pecan == 'true'
657656
permissions:
658657
contents: read
659658
deployments: write

car-simulate/persistent-broadcast/broadcast_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class StandardCanSimulator:
169169
- 512 BMS_Status
170170
- 768 Wheel_Speeds
171171
172-
Encoding follows the DBC scale/offset so PECAN and Influx decoding remain
172+
Encoding follows the DBC scale/offset so PECAN and backend decoding remain
173173
consistent with the rest of the system.
174174
"""
175175

flight-recorder/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ const FlightDataRecorder: React.FC = () => {
6161

6262
useEffect(() => {
6363
// Legacy cleanup
64-
localStorage.removeItem('influx-cfClientId');
65-
localStorage.removeItem('influx-cfClientSecret');
64+
localStorage.removeItem('cfClientId');
65+
localStorage.removeItem('cfClientSecret');
6666

6767
const handleStatusChange = (status: ConnectionStatus) => setWsStatus(status);
6868
webSocketService.on('status', handleStatusChange);

flight-recorder/src/services/LoggingHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class LoggingHandler {
1212

1313
// Stamp with wall-clock time at FDR receipt.
1414
// The car's msg.time is relative (ms since ECU boot) and has no
15-
// meaning as a Unix timestamp — InfluxDB needs absolute epoch ms.
15+
// meaning as a Unix timestamp — TimescaleDB expects absolute epoch ms.
1616
const receivedAt = Date.now();
1717
messages.forEach(msg => {
1818
if (msg?.signals) {

flight-recorder/src/services/SyncService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class SyncService {
2828

2929
/**
3030
* Sync recorded CAN frames to the server TimescaleDB via REST API.
31-
* Replaces the InfluxDB3 Line Protocol upload.
31+
* Replaces the legacy line protocol upload path.
3232
*/
3333
public async syncToServer(
3434
config: SyncConfig,

flight-recorder/src/utils/canProcessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ let dbcFile = import.meta.env.DEV ? localDbc : exampleDbc;
6363
let usingCache = false;
6464
const dbcDebugSeen = new Set<number>();
6565

66-
// Simple type definitions for our use, align with InfluxDB3 schema for consistency
67-
// InfluxDB3 Schema: id -> canId, name -> messageName, signalName, sensorReading, time
66+
// Simple type definitions for our use, aligned with TimescaleDB ingest schema
67+
// Schema mapping: id -> canId, name -> messageName, signalName, sensorReading, time
6868
interface DecodedMessage {
6969
canId: number;
7070
messageName: string;

grafana-worker/worker.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ export default {
88
"https://pecan-internal.westernformularacing.org",
99
];
1010

11-
const corsOrigin = allowedOrigins.includes(origin) ? origin : allowedOrigins[0];
11+
if (!allowedOrigins.includes(origin)) {
12+
return new Response("Forbidden", { status: 403 });
13+
}
1214

1315
const corsHeaders = {
14-
"Access-Control-Allow-Origin": corsOrigin,
16+
"Access-Control-Allow-Origin": origin,
1517
"Access-Control-Allow-Methods": "GET, HEAD, POST, OPTIONS",
1618
"Access-Control-Allow-Headers": "Content-Type, Authorization",
1719
};

0 commit comments

Comments
 (0)