Skip to content

Commit e2c6f99

Browse files
Merge pull request #556 from Hyperloop-UPV/develop
Prepare v11.1.0
2 parents 795abe5 + 2779f0a commit e2c6f99

205 files changed

Lines changed: 12655 additions & 3721 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.

.github/workflows/frontend-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
cache: "pnpm"
3030

3131
- name: Install dependencies
32-
run: pnpm install --frozen-lockfile --filter=testing-view --filter=ui --filter=core
32+
run: pnpm install --frozen-lockfile --filter=testing-view --filter=flashing-view --filter=competition-view --filter=ui --filter=core
3333

3434
- name: Build frontend
3535
run: pnpm build --filter="./frontend/**"

.github/workflows/release.yaml

Lines changed: 151 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@ on:
1010
description: "Create as draft release"
1111
type: boolean
1212
default: true
13+
include-testing:
14+
description: "Include Testing View"
15+
type: boolean
16+
default: true
17+
include-competition:
18+
description: "Include Competition View"
19+
type: boolean
20+
default: true
21+
include-flashing:
22+
description: "Include Flashing View"
23+
type: boolean
24+
default: true
1325

14-
env:
15-
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1626

1727
jobs:
1828
determine-version:
@@ -21,12 +31,18 @@ jobs:
2131
outputs:
2232
version: ${{ steps.get_version.outputs.version }}
2333
is_draft: ${{ steps.get_version.outputs.is_draft }}
34+
include_testing: ${{ steps.get_version.outputs.include_testing }}
35+
include_competition: ${{ steps.get_version.outputs.include_competition }}
36+
include_flashing: ${{ steps.get_version.outputs.include_flashing }}
2437
steps:
2538
- name: Determine version
2639
id: get_version
2740
run: |
2841
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
2942
echo "is_draft=${{ github.event.inputs.draft }}" >> $GITHUB_OUTPUT
43+
echo "include_testing=${{ github.event.inputs.include-testing }}" >> $GITHUB_OUTPUT
44+
echo "include_competition=${{ github.event.inputs.include-competition }}" >> $GITHUB_OUTPUT
45+
echo "include_flashing=${{ github.event.inputs.include-flashing }}" >> $GITHUB_OUTPUT
3046
3147
create-draft-release:
3248
name: Create Draft Release
@@ -62,20 +78,46 @@ jobs:
6278

6379
- uses: actions/setup-node@v4
6480
with:
65-
node-version: "20"
81+
node-version: "24"
6682

6783
- name: Install dependencies
6884
run: pnpm install --frozen-lockfile
6985

7086
- name: Build with Turbo
71-
run: pnpm turbo build --filter=testing-view
87+
run: |
88+
FILTERS=""
89+
if [ "${{ needs.determine-version.outputs.include_testing }}" = "true" ]; then
90+
FILTERS="$FILTERS --filter=testing-view"
91+
fi
92+
if [ "${{ needs.determine-version.outputs.include_competition }}" = "true" ]; then
93+
FILTERS="$FILTERS --filter=competition-view"
94+
fi
95+
if [ "${{ needs.determine-version.outputs.include_flashing }}" = "true" ]; then
96+
FILTERS="$FILTERS --filter=flashing-view"
97+
fi
98+
pnpm turbo build $FILTERS
7299
73100
- uses: actions/upload-artifact@v4
101+
if: needs.determine-version.outputs.include_testing == 'true'
74102
with:
75103
name: frontend-dist
76104
path: frontend/testing-view/dist/**
77105
retention-days: 1
78106

107+
- uses: actions/upload-artifact@v4
108+
if: needs.determine-version.outputs.include_competition == 'true'
109+
with:
110+
name: competition-dist
111+
path: frontend/competition-view/dist/**
112+
retention-days: 1
113+
114+
- uses: actions/upload-artifact@v4
115+
if: needs.determine-version.outputs.include_flashing == 'true'
116+
with:
117+
name: flashing-dist
118+
path: frontend/flashing-view/dist/**
119+
retention-days: 1
120+
79121
build-backend:
80122
name: Build Backend - ${{ matrix.os }}
81123
needs: determine-version
@@ -121,22 +163,103 @@ jobs:
121163
path: electron-app/binaries/${{ matrix.binary }}
122164
retention-days: 1
123165

166+
build-blcu:
167+
name: Build BLCU - ${{ matrix.os }}
168+
needs: determine-version
169+
runs-on: ${{ matrix.os }}
170+
strategy:
171+
fail-fast: true
172+
matrix:
173+
include:
174+
- os: windows-latest
175+
binary: blcu-programming-windows-amd64.exe
176+
binary-base: blcu-programming-windows-amd64
177+
- os: ubuntu-latest
178+
binary: blcu-programming-linux-amd64
179+
binary-base: blcu-programming-linux-amd64
180+
- os: macos-latest
181+
binary: blcu-programming-darwin-arm64
182+
binary-base: blcu-programming-darwin-arm64
183+
- os: macos-15-intel
184+
binary: blcu-programming-darwin-amd64
185+
binary-base: blcu-programming-darwin-amd64
186+
steps:
187+
- uses: actions/checkout@v4
188+
189+
- uses: actions/setup-python@v5
190+
with:
191+
python-version: "3.11"
192+
193+
- name: Create virtual environment
194+
working-directory: blcu-programming
195+
run: python -m venv .venv-build
196+
197+
- name: Install dependencies
198+
working-directory: blcu-programming
199+
shell: bash
200+
run: |
201+
if [ "${{ runner.os }}" = "Windows" ]; then
202+
.venv-build/Scripts/pip install -r requirements-build.txt
203+
else
204+
.venv-build/bin/pip install -r requirements-build.txt
205+
fi
206+
207+
- name: Build with PyInstaller
208+
working-directory: blcu-programming
209+
shell: bash
210+
run: |
211+
if [ "${{ runner.os }}" = "Windows" ]; then
212+
PYTHON=".venv-build/Scripts/python"
213+
else
214+
PYTHON=".venv-build/bin/python"
215+
fi
216+
if [ "${{ runner.os }}" = "Windows" ]; then
217+
PATH_SEP=";"
218+
else
219+
PATH_SEP=":"
220+
fi
221+
"$PYTHON" -m PyInstaller \
222+
--clean \
223+
--noconfirm \
224+
--onefile \
225+
--name "${{ matrix.binary-base }}" \
226+
--distpath "../electron-app/binaries" \
227+
--hidden-import uvicorn.loops.auto \
228+
--hidden-import uvicorn.protocols.http.auto \
229+
--hidden-import uvicorn.protocols.websockets.auto \
230+
--hidden-import uvicorn.lifespan.on \
231+
--hidden-import multipart \
232+
--hidden-import multipart.multiparser \
233+
--paths "." \
234+
--add-data "BLCU-config.json${PATH_SEP}." \
235+
api/main.py
236+
237+
- uses: actions/upload-artifact@v4
238+
with:
239+
name: blcu-${{ matrix.os }}
240+
path: electron-app/binaries/${{ matrix.binary }}
241+
retention-days: 1
242+
124243
package-and-upload:
125244
name: Package & Upload - ${{ matrix.os }}
126-
needs: [determine-version, create-draft-release, build-frontend, build-backend]
245+
needs: [determine-version, create-draft-release, build-frontend, build-backend, build-blcu]
127246
runs-on: ${{ matrix.os }}
128247
strategy:
129248
fail-fast: true
130249
matrix:
131250
include:
132251
- os: windows-latest
133252
binary: backend-windows-amd64.exe
253+
blcu-binary: blcu-programming-windows-amd64.exe
134254
- os: ubuntu-latest
135255
binary: backend-linux-amd64
256+
blcu-binary: blcu-programming-linux-amd64
136257
- os: macos-latest
137258
binary: backend-darwin-arm64
259+
blcu-binary: blcu-programming-darwin-arm64
138260
- os: macos-15-intel
139261
binary: backend-darwin-amd64
262+
blcu-binary: blcu-programming-darwin-amd64
140263
steps:
141264
- uses: actions/checkout@v4
142265

@@ -146,23 +269,44 @@ jobs:
146269
name: backend-${{ matrix.os }}
147270
path: electron-app/binaries
148271

272+
- name: Download BLCU binary
273+
uses: actions/download-artifact@v4
274+
with:
275+
name: blcu-${{ matrix.os }}
276+
path: electron-app/binaries
277+
149278
- name: Set executable permissions (Unix)
150279
if: runner.os != 'Windows'
151280
run: chmod +x electron-app/binaries/*
152281

153282
- name: Download frontend dist
283+
if: needs.determine-version.outputs.include_testing == 'true'
154284
uses: actions/download-artifact@v4
155285
with:
156286
name: frontend-dist
157287
path: electron-app/renderer/testing-view
158288

289+
- name: Download competition-view dist
290+
if: needs.determine-version.outputs.include_competition == 'true'
291+
uses: actions/download-artifact@v4
292+
with:
293+
name: competition-dist
294+
path: electron-app/renderer/competition-view
295+
296+
- name: Download flashing-view dist
297+
if: needs.determine-version.outputs.include_flashing == 'true'
298+
uses: actions/download-artifact@v4
299+
with:
300+
name: flashing-dist
301+
path: electron-app/renderer/flashing-view
302+
159303
- uses: pnpm/action-setup@v4
160304
with:
161305
version: 10.26.0
162306

163307
- uses: actions/setup-node@v4
164308
with:
165-
node-version: "20"
309+
node-version: "24"
166310

167311
- name: Update version in package.json
168312
working-directory: electron-app
@@ -186,7 +330,7 @@ jobs:
186330
run: |
187331
find electron-app/dist -maxdepth 1 -type f \
188332
\( -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" \
189-
-o -name "*.dmg" -o -name "*.zip" -o -name "*.yml" -o -name "*.blockmap" \) \
333+
-o -name "*.rpm" -o -name "*.dmg" -o -name "*.zip" -o -name "*.yml" -o -name "*.blockmap" \) \
190334
| xargs gh release upload v${{ needs.determine-version.outputs.version }} --clobber
191335
env:
192336
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ node_modules/
99
.env
1010

1111
# Global binaries
12-
*.exe
12+
*.exe
13+
14+
# electron modules
15+
electron-app/python
16+
electron-app/logger

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ Before starting, ensure you have the following installed:
1313
- **PNPM** (v10.26.0+)
1414
- **Node.js** (v20+)
1515
- **Go** (for the backend)
16-
- **Rust/Cargo** (for the packet-sender)
16+
- **Python** (v3.11+, for the BLCU programming service)
17+
18+
`pnpm install` automatically creates the Python virtual environment and installs dependencies for the BLCU programming service on Windows, macOS, and Linux.
1719

1820
---
1921

@@ -25,8 +27,9 @@ Our `pnpm-workspace.yaml` defines the following workspaces:
2527
| :----------------------------- | :------- | :---------------------------------------------------- |
2628
| `testing-view` | TS/React | Web interface for telemetry testing |
2729
| `competition-view` | TS/React | UI for the competition |
30+
| `flashing-view` | TS/React | UI for flashing firmware to the BLCU board |
2831
| `backend` | Go | Data ingestion and pod communication server |
29-
| `packet-sender` | Rust | Utility for simulating vehicle packets |
32+
| `blcu-programming` | Python | FastAPI service that flashes firmware to the BLCU board via TFTP |
3033
| `hyperloop-control-station` | JS | The main Control Station electron desktop application |
3134
| `e2e` | TS | End-to-end tests for the whole app (Playwright) |
3235
| `@workspace/ui` | TS/React | Shared UI component library (frontend-kit) |
@@ -44,7 +47,7 @@ These commands should be executed from the root directory (`/software`).
4447
4548
#### Global Development Scripts
4649

47-
- `pnpm dev` – Runs both frontends, the backend (with `dev-config.toml`), and the packet-sender in a single terminal window.
50+
- `pnpm dev` – Runs both frontends and the backend (with `dev-config.toml`) in a single terminal window.
4851
- `pnpm dev:main` – Runs frontends and the backend using the standard `config.toml`.
4952

5053
#### Turbo Filtering
@@ -69,8 +72,14 @@ All Turbo scripts support filtering to target specific workspaces:
6972
- `pnpm build:linux` – Packages the Electron app for Linux.
7073
- `pnpm build:mac` – Packages the Electron app for macOS.
7174

75+
#### Frontend View Scripts
76+
77+
- `pnpm build:testing-view` – Builds only the Testing View frontend.
78+
- `pnpm build:competition-view` – Builds only the Competition View frontend.
79+
- `pnpm build:flashing-view` – Builds only the Flashing View frontend.
80+
7281
#### Utility Scripts
7382

7483
- `pnpm ui:add <component-name>` - To add shadcn/ui components
7584

76-
> Note: don't forget to also include it in frontend-kit/ui/src/components/shadcn/index.ts to be able to access it from @workspace/ui
85+
> Note: don't forget to also include it in frontend-kit/ui/src/components/shadcn/index.ts to be able to access it from @workspace/ui

backend/cmd/main.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/HyperloopUPV-H8/h9-backend/internal/flags"
1010
"github.com/HyperloopUPV-H8/h9-backend/internal/pod_data"
1111
"github.com/HyperloopUPV-H8/h9-backend/internal/update_factory"
12+
"github.com/HyperloopUPV-H8/h9-backend/pkg/logger"
1213
tracelogger "github.com/HyperloopUPV-H8/h9-backend/pkg/logger/trace"
1314

1415
vehicle_models "github.com/HyperloopUPV-H8/h9-backend/internal/vehicle/models"
@@ -34,12 +35,6 @@ func main() {
3435
flags.Init()
3536
handleVersionFlag()
3637

37-
// Configure trace
38-
traceFile := tracelogger.InitTrace(flags.TraceLevel)
39-
if traceFile != nil {
40-
defer traceFile.Close()
41-
}
42-
4338
// Set use to all available CPUs and setup CPU profiling if enabled
4439
cleanup := setupRuntimeCPU()
4540
defer cleanup()
@@ -50,12 +45,26 @@ func main() {
5045
trace.Fatal().Err(err).Msg("error unmarshaling toml file")
5146
}
5247

48+
// Configure BasePath before InitTrace and NewADJ so all "others" files land in the right place
49+
if err := logger.ConfigureLogger(config.Logging.TimeUnit, config.Logging.LoggingPath, ""); err != nil {
50+
trace.Fatal().Err(err).Msg("configuring logger")
51+
}
52+
53+
// Configure trace
54+
traceFile := tracelogger.InitTrace(flags.TraceLevel)
55+
if traceFile != nil {
56+
defer traceFile.Close()
57+
}
58+
5359
// <--- ADJ --->
5460
adj, err := adj_module.NewADJ(config.Adj)
5561
if err != nil {
5662
trace.Fatal().Err(err).Msg("setting up ADJ")
5763
}
5864

65+
// Now that we have the commit hash, update it in the logger
66+
logger.CommitHash = adj.Commit
67+
5968
// <--- pod data --->
6069
podData, err := pod_data.NewPodData(adj.Boards, adj.Info.Units)
6170
if err != nil {
@@ -75,7 +84,7 @@ func main() {
7584
updateFactory := update_factory.NewFactory(boardToPackets)
7685

7786
// <--- logger --->
78-
loggerHandler, subloggers := setUpLogger(config)
87+
loggerHandler, subloggers := setUpLogger()
7988

8089
// <-- connections & upgrader -->
8190
connections := make(chan *websocket.Client)

0 commit comments

Comments
 (0)