mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Add local tablebase path config, fetch and check tasks (#31)
Read the local Syzygy directory from TABLEBASE_PATH so a dev machine and a VPS can point at their own copies. Add mix tablebase.fetch (downloads the 3/4/5 WDL+DTZ set, resumable) and mix tablebase.check (verifies it loads), plus a boot log reporting whether local tablebases are ready and the largest piece count. Covers the codeable part of #31; installing on the VPS and setting TABLEBASE_PATH there remains a manual step.
This commit is contained in:
@@ -10,6 +10,30 @@ Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
|
||||
|
||||
Ready to run in production? Please [check our deployment guides](https://phoenix.hexdocs.pm/deployment.html).
|
||||
|
||||
## Local tablebases (optional)
|
||||
|
||||
Positions with five or fewer pieces are answered locally from Syzygy
|
||||
tablebases when `TABLEBASE_PATH` points at a directory of `.rtbw`/`.rtbz`
|
||||
files. When it is unset the trainer falls back to the Lichess API.
|
||||
|
||||
`TABLEBASE_PATH` lets each environment point at its own copy — it differs on a
|
||||
dev machine and a VPS:
|
||||
|
||||
```sh
|
||||
# Fetch the complete 3/4/5-piece WDL+DTZ set (~939 MB) once per host.
|
||||
mix tablebase.fetch --path /path/to/syzygy/3-4-5
|
||||
mix tablebase.check --path /path/to/syzygy/3-4-5
|
||||
|
||||
# Dev
|
||||
TABLEBASE_PATH=/path/to/syzygy/3-4-5 mix phx.server
|
||||
|
||||
# Production
|
||||
TABLEBASE_PATH=/data/syzygy/3-4-5 bin/chesstrainer start
|
||||
```
|
||||
|
||||
On boot the app logs whether the local tablebases loaded and the largest piece
|
||||
count they cover, so a wrong path shows up immediately.
|
||||
|
||||
## Learn more
|
||||
|
||||
* Official website: https://www.phoenixframework.org/
|
||||
|
||||
Reference in New Issue
Block a user