Commit Graph
351 Commits
Author SHA1 Message Date
jschoubben 1e2c1b898f Keep Jolpica schedules, pace the requests, never keep a failure
A Kometa YAML request asks Jolpica for every season at once; Jolpica
(4 requests a second, 500 an hour) answered 429 for 24 seasons on
2026-11-27 09:28, and lru_cache kept each failure as an empty schedule,
so every poster and thumb of those seasons answered 404 until a restart.
The service also ran two Jolpica clients, so the race lookup and the
posters held different schedules.

Now one client serves the whole service; a season that is over is kept
on disk in the cache volume for good, one not yet over is asked again
after six hours; requests are paced under the limit, a 429 is asked
again after its Retry-After; a failure is never kept. The Kometa
endpoint runs in the threadpool, as its first fill takes minutes.

Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh
2026-11-27 09:46:56 +01:00
jschoubben e976f1d8f5 Remove copies, backups and caches from the repository
Nothing reads them, and each is a copy of what stays or can be fetched
again:
- cache/: FastF1's download cache (93 files, 562 MB) of the trace
  generator; it fetches it again when run.
- circuits_bak/: the circuit tree before its move to lowercase slugs; 117
  of its 118 traces are identical in circuits/, the last is a FastF1
  sketch in metres, not a GPS trace.
- Grand Prix/: 18 traces filed by race name, all identical in circuits/.
- Data/circuits.json: the circuit list in its first format.
- __pycache__/, .idea/: bytecode and editor settings.
- fast_f1_service.py: an empty file.

.gitignore had ".nova__pycache__/" on one line, so neither applied; it now
ignores .nova, __pycache__/, cache/ and .idea/.

Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh
2026-11-27 09:40:28 +01:00
jschoubben 6352eea892 Serve each track format's own file
/png and /geojson answered the SVG file under a PNG or GeoJSON media
type, so the GPS-traced GeoJSON of a layout was never served at all.
Each format now serves its own file; a layout without one answers 404.

Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh
2026-11-27 09:40:28 +01:00
jschoubben 11c17cb9ad Match a race's circuit on Jolpica's circuitId, not its name
Jolpica renamed Losail to Lusail International Circuit, so the name match
found no circuit and every Qatar Grand Prix poster, thumb and track image
answered 404 (reported by Brad Johnston for 2025 and 2026; every season
since 2021 failed). Names drift, ids do not: each circuit in circuits.json
now carries its ergastId, the lookup keys on it, and the poster's zoom
fallback resolves our circuit slug the same way. The name match also sent
Caesars Palace (1981-82) to the Las Vegas Strip circuit; by id it resolves
to nothing, as there is no layout of it.

tests/ checks every circuit has one unique ergastId and that a race
resolves by id; the merge check runs it.

Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh
2026-11-27 09:40:27 +01:00
jschoubben 60c4f20158 Declare the written directory in data.own (cache class)
mesh/merge-gate waiting in the build queue since 08:56
mesh/delivery-group group feat/47-G-join11 checking: composed again for its members' new heads
mesh/delivery ready: it is merged on the Approve
Builds: design 47 G, lead answer A-338, ADR 0233

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-13 08:52:46 +01:00
jschoubben fe17ae7d96 Join G's version form: version 0.1
No version is published for it (builder_versions answers none), so §583 gives 0.1.

Builds: design 47 G A-335, §583

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-13 02:29:52 +01:00
mesh-admin c0ea2c949c Merge pull request 'A merge check of its own (hq ADR 0238)' (#4) from feat/a-merge-check-of-its-own into master 2026-10-06 21:00:49 +00:00
jochen 3c8a927218 Check f1-circuits' service code before a change merges into what the mesh builds (hq ADR 0237)
The repository's layer of the mesh's merge check (mesh/repo-check): every Python file
the image ships, parsed; what cannot run is said.
2026-10-06 22:23:29 +02:00
mesh-admin 101bf2e040 Merge pull request 'f1-circuits: become a nox mesh module' (#4) from nox-mesh into master
mesh/delivery delivered
2026-09-30 15:32:07 +00:00
jschoubben 6eb693203d f1-circuits: become a nox mesh module
The mesh builds the CDN from this repository and a commit (novox/hq ADR
0069); registry-api.novox.be, where HAL's image came from, is retired, so
the running container can no longer be re-pulled. The HAL module.yml and
service/docker-compose.yml retire with HAL.

The Kometa metadata links every poster to this service's own address,
which was the literal https://f1-circuits.zurag.be. It is now
F1_CIRCUITS_BASE_URL, written by the mesh from the route's name
(${bound:route:name}, mesh-controller #149) - falling back to the old
address, so HAL's deployment behaves as before. The tile user agent
follows it.

The poster cache is a placed directory mounted at /app/cache, as HAL's
/services/f1-circuits/cache was. The image was built from unpinned pip
installs; service/requirements.txt now pins the exact set the running
container has (pip freeze), and the base is python 3.12.13-alpine3.24 by
digest (a later alpine 3.24 patch than the running build's 3.24.0 - the
older digest is no longer tagged). The slug "f1" keeps the route login
within 20 characters on any machine.

Verified: the manifest parses on mesh-controller main and #149 and
renders for a zurag.be node (F1_CIRCUITS_BASE_URL=https://f1-circuits.
zurag.be). Built from this commit and run on an empty cache: /circuits,
/circuits/<country> and a rendered Spa track are byte-identical to what
ace serves today; the base URL comes from the variable, and without it
falls back to the old address.

Depends on mesh-controller #149.
2026-09-30 12:05:36 +02:00
jschoubben 71feafa345 Merge pull request 'Add session thumbs + episode-level url_poster in Kometa YAML' (#3) from feat/session-thumbs into master 2026-06-15 09:29:12 +02:00
jschoubben 6474e109f1 Add 1920x1080 session thumbs with track overlay + episode YAML entries
posters_service:
- Standard / sprint episode-index → (label, slug) maps mirroring Kometa's
  F1 builder numbering
- _fetch_map_landscape: aerial tile stitcher in 1920x1080
- render_session_thumb: GP aerial bg + projected track outline + GP name
  + session label with red accent bar
- _draw_track_projected now takes canvas_w / geo_center_y so it can be
  reused for both 2:3 posters and 16:9 thumbs
- render_kometa_metadata now emits an episodes: block per Plex season
  pointing every Kometa-numbered episode at the matching session thumb;
  sprint vs standard format is detected from the Jolpica race entry

cdn-api:
- GET /posters/session/{name}/{year}/{slug}.png returns the thumb
2026-06-15 02:28:03 +02:00
jschoubben 4a2e9f5d63 Merge pull request 'Season hero photo as poster bg + switch to Alpine image' (#2) from feat/season-poster-bg into master 2026-06-14 17:42:49 +02:00
jschoubben 9430d499cc Map backgrounds (aerial/osm/dark/light), bbox zoom, world locator, kometa YAML endpoint
posters_service:
- BackgroundStyle enum + tile stitcher for race posters
  (Esri aerial / OSM Carto / CartoDB dark / CartoDB light / none)
- _resolve_circuit_geo: GeoJSON bbox centre + auto-zoom (no hand tuning),
  falls back to Jolpica lat/lon + f1-locations.json zoom
- _draw_track_projected: project the layout's GeoJSON points into the
  same window as the tile background, so the white outline aligns with
  the actual track (the hand-drawn SVGs had arbitrary orientations)
- _render_world_locator: 140x140 CartoDB Dark inset at zoom 5 with a
  red marker pinning the circuit on the continent
- _race_dark_overlay: dimming so the heading + footer stay legible
  against any underlying tiles
- render_kometa_metadata: emits a Kometa-compatible YAML covering
  every season 1950..current+1 with per-show + per-round url_poster

cdn-api:
- GET /posters/race/{name}/{year}.png supports ?bg= query param
- GET /kometa/formula-1-metadata.yml serves the generated config so
  Kometa pulls it via metadata_files.url (auto-updates with schedule)
2026-06-14 17:42:02 +02:00
jschoubben 99ac83c706 Use season hero photos as poster bg + switch image to Alpine
posters_service.render_season_poster() now fetches /dilbert/sports/
formula1/cars/{year}.jpg from the files-api CDN, centre-crops to 2:3,
and composites a vertical dark gradient so the FORMULA 1 / year /
WORLD CHAMPIONSHIP text stays legible over any photo.

Dockerfile:
  - python:3.12-slim → python:3.12-alpine (smaller, no fastf1 leftover)
  - fonts-dejavu-core → ttf-liberation: same font Arch dev ships, so
    posters render byte-identical on dev and in the container.
  - Drop fastf1 (unused in the served code path); add numpy explicitly
    because models/geo_json/geometry.py imports it at module load.
2026-06-13 22:42:16 +02:00
jschoubben f4c6a56d1c Merge pull request 'Add Plex-ready race + season poster endpoints' (#1) from feat/plex-posters into master 2026-06-13 21:51:42 +02:00
jschoubben 847ae2bae1 Add Plex-ready race + season poster endpoints
GET /posters/race/{grand_prix_name}/{season}.png
GET /posters/season/{season}.png

1000x1500 PNGs composed with Pillow + cairosvg:
checkered-flag strips top/bottom, F1 wordmark, round/year ribbon,
GP name, rasterised track outline (white), race date. Season poster
is wordmark + giant year + 'WORLD CHAMPIONSHIP'. Cached under
cache/posters/ so cold renders happen once.
2026-06-13 20:57:28 +02:00
jschoubben d74ece9680 Add Indianapolis oval (1950-1960) and Madring (2026) circuits
Indianapolis oval layout uses real OSM centerline data for the
2.5-mile oval used in the F1 championship from 1950-1960.
Madring is the new Madrid circuit for the 2026 Spanish Grand Prix,
track path extracted from Wikimedia SVG.
2026-05-08 15:29:55 +02:00
jschoubben 15af1627fb Replace FastF1 with Jolpica API for circuit resolution
FastF1's get_event() couldn't resolve several grand prix names
(Qatar, Brazilian, Mexican, Barcelona), causing 500/404 errors.
Now uses Jolpica's race schedule directly — slugifies circuitName
to match against circuits.json with ASCII fallback for unicode.
2026-05-08 14:54:02 +02:00
jschoubben 83311a6079 Fix circular reference recursion in JSON serialization
Dataclass models have parent back-references (TrackLayout→Circuit→
Locality→Country) causing infinite recursion in dataclasses.asdict().
Add to_dict() methods that exclude parent refs, use them in API endpoints.
2026-05-08 03:01:42 +02:00
jschoubben 40d92983ed trigger build — compose file fix deployed 2026-05-08 02:19:02 +02:00
jschoubben 58ecba8926 trigger build 2026-05-08 00:09:43 +02:00
jschoubben e741a14996 Trigger pipeline with updated coordinator 2026-05-07 20:19:50 +02:00
jschoubben 2e97a8bcd8 Remove docker: from manifest — auto-detected from service/Dockerfile 2026-05-07 17:37:58 +02:00
jschoubben 9587bdc5e8 Trigger pipeline with SSH clone URL 2026-05-07 12:39:04 +02:00
jschoubben 126d81331f Trigger initial build 2026-05-07 02:19:10 +02:00
jschoubben 618540e3ab Trigger build 2026-05-07 00:40:25 +02:00
jschoubben 0c5c87a9f3 Trigger build pipeline 2026-05-06 21:36:44 +02:00
jschoubben 9faf9f4041 Add HAL module structure for deployment as CDN service
Enables deploying f1-circuits as a HAL module on ace behind Traefik,
serving track SVGs at f1-circuits.zurag.be.
2026-05-06 21:31:37 +02:00
jschoubben c94ebcfb22 Add all local circuit work — year-by-year SVGs and tooling 2026-03-25 22:17:47 +01:00
Tomislav Bacinger 6ceeba7fb9 2025 F1™ World Championship 2024-12-11 18:27:14 +01:00
Tomislav Bacinger d27b6c11f5 Git Ignore File 2024-05-15 14:24:32 +02:00
Tomislav Bacinger fbdfdbb87b ReadMe file 2024-02-08 12:44:13 +01:00
Tomislav Bacinger 4fb47c4634 ReadMe file 2024-02-08 12:40:24 +01:00
Tomislav Bacinger bc0faf01dc ReadMe file 2024-02-08 12:38:52 +01:00
Tomislav Bacinger ced3ab13b0 The MIT License (MIT) 2024-02-08 12:38:34 +01:00
Tomislav Bacinger b8c7e17c52 Monaco - Circuit de Monaco 2024-01-16 10:21:27 +01:00
Tomislav Bacinger e840b7f8f1 Yas Marina - Yas Marina Circuit 2024-01-16 10:21:09 +01:00
Tomislav Bacinger 386a590eac 2024 F1™ World Championship 2024-01-16 10:20:36 +01:00
Tomislav Bacinger a208c4ca35 2023 F1™ World Championship 2024-01-16 10:20:27 +01:00
Tomislav Bacinger d4bdef4bdc 2022 F1™ World Championship 2024-01-16 10:18:39 +01:00
Tomislav Bacinger 739f2c3ada 2021 F1™ World Championship 2024-01-16 10:18:30 +01:00
Tomislav Bacinger 192da6cd9b 2020 F1™ World Championship 2024-01-16 10:18:19 +01:00
Tomislav Bacinger d8a2fe292c ReadMe file 2024-01-16 10:17:58 +01:00
Tomislav Bacinger eaccf9a86c List of F1™ circuits 2024-01-16 10:17:45 +01:00
Tomislav Bacinger c702d7b871 Points of F1™ circuits 2024-01-16 10:17:30 +01:00
Tomislav Bacinger dce66a7acc Formula 1™ circuits 2024-01-16 10:17:18 +01:00
Tomislav Bacinger 9351a8beb0 ReadMe file 2023-10-31 12:31:01 +01:00
Tomislav Bacinger 13b16dc105 Abu Dhabi - Yas Marina Circuit 2023-10-31 12:30:42 +01:00
Tomislav Bacinger c2e66128e6 Points of F1™ circuits 2023-10-31 12:27:05 +01:00