One installation per project, and no login to reach it
Two things a local install should not have asked for. `fluksio serve` now signs you in. Logging in to your own machine was a formality — the password was printed by the same process that would have checked it, and the database it authenticates against sits in the directory the token goes into — so `serve` mints the token itself and says where it put it. `fluksio login` is left for an engine somewhere else. And an installation is `.fluksio` beside the code, found the way `.git` is, rather than one `~/.fluksio` for the machine. A repository with its own venv was already getting its own engine; it now gets its own flows, run history and token too, instead of three repositories sharing one database and fighting over one port. `--global` asks for the shared one, `--data-dir` still names any directory, and when both exist the banner says which you are looking at and how to reach the other. The directory ignores itself from within — a `.gitignore` of `*`, the way uv writes one into `.venv` — because it holds a credential and a database, and neither belongs in anybody's history. The token is written mode 600. A login an older version wrote to ~/.config/fluksio is still read, so nothing that worked stops working. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ue1tkFWB1bcGy3aWhCKpU
This commit is contained in:
@@ -6,36 +6,74 @@ answer to "what was the learning rate on the run that got 94%?", and the
|
||||
|
||||
This page adds Fluksio to what you already have. It takes about five minutes,
|
||||
installs one Python package, and does not ask you to restructure anything.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
cd my-research
|
||||
pip install fluksio
|
||||
fluksio serve
|
||||
```
|
||||
|
||||
That is the whole installation. No Docker, no database server, no ports to
|
||||
open. The first run prints something like:
|
||||
open, and no login. The first run prints something like:
|
||||
|
||||
```text
|
||||
Created the admin account admin@example.com
|
||||
password: k3Qm-8vTpLdX
|
||||
Shown once. Change it from the dashboard.
|
||||
Fluksio 0.1.0 — data in /home/you/.fluksio
|
||||
Fluksio 0.1.0 — data in /home/you/my-research/.fluksio
|
||||
API http://127.0.0.1:8000/api/v1
|
||||
Nodes /home/you/my-research/.venv/bin/python
|
||||
your environment, adopted. Add packages with pip.
|
||||
No portal. Pair this installation with:
|
||||
fluksio enroll <code> --portal https://hub.example.com
|
||||
Signed in as admin@example.com
|
||||
token in /home/you/my-research/.fluksio/client.json
|
||||
```
|
||||
|
||||
**Write that password down.** It is shown once and it is how you authenticate
|
||||
from here on.
|
||||
Read the last two lines: you are already signed in. Signing in to your own
|
||||
machine is a formality — the password was printed by the same process that
|
||||
would have checked it — so `serve` writes the token itself and every command
|
||||
below just works. `fluksio login` is for an engine somewhere *else*.
|
||||
|
||||
Everything the installation owns lives in `~/.fluksio`: a SQLite database, a
|
||||
git repository holding your flows, the artifact store, and a virtual
|
||||
environment your node code runs in. Move it with `--data-dir`, which is worth
|
||||
doing on a cluster where `$HOME` is a network filesystem — SQLite's
|
||||
write-ahead log does not work on NFS, and `fluksio serve` warns you when it
|
||||
notices.
|
||||
**Write that password down** anyway. It is shown once, and it is what the
|
||||
dashboard asks for.
|
||||
|
||||
### One installation per project
|
||||
|
||||
`.fluksio` sits beside your code, and is found the way `.git` is — from the
|
||||
directory you are standing in, or any directory above it. So two repositories
|
||||
on one machine are two engines: separate flows, separate run history,
|
||||
separate token, and no chance of one experiment's graph turning up in the
|
||||
other's.
|
||||
|
||||
```text
|
||||
~/research/protein-fold/
|
||||
.venv/ torch, fluksio
|
||||
.fluksio/ its own database, flows, artifacts, token
|
||||
myresearch/
|
||||
|
||||
~/research/climate-sim/
|
||||
.venv/ jax, fluksio
|
||||
.fluksio/ its own everything
|
||||
climate/
|
||||
```
|
||||
|
||||
It holds a database and a credential, so it ignores itself from within — a
|
||||
`.gitignore` of `*`, the same thing `uv` writes into `.venv`. Nothing to add
|
||||
to your project's own.
|
||||
|
||||
Give them different ports (`--port`) if you want two running at once.
|
||||
|
||||
!!! tip "One engine for the machine instead"
|
||||
|
||||
`fluksio serve --global` uses `~/.fluksio` — shared by every directory,
|
||||
which is what you want for a personal server rather than a project. When
|
||||
both exist, the banner says which one you are looking at and how to reach
|
||||
the other. `--data-dir` still names any directory outright, which is worth
|
||||
doing on a cluster where `$HOME` is a network filesystem: SQLite's
|
||||
write-ahead log does not work on NFS, and `fluksio serve` warns you when
|
||||
it notices.
|
||||
|
||||
!!! tip "Keep it running"
|
||||
|
||||
@@ -44,25 +82,23 @@ notices.
|
||||
orchestrator spends before it does anything. Leave it in a `tmux` window,
|
||||
or write a small `systemd --user` unit for it.
|
||||
|
||||
## Log in
|
||||
|
||||
```sh
|
||||
fluksio login --url http://127.0.0.1:8000
|
||||
```
|
||||
|
||||
It asks for the email and password printed above and keeps the token in
|
||||
`~/.config/fluksio/client.json`, so nothing below needs credentials again.
|
||||
## Talking to it over HTTP
|
||||
|
||||
Everything the commands do is the HTTP API, and some of this page shows it
|
||||
directly. For that, grab the same token as a shell variable:
|
||||
directly. For that, take the token `serve` already wrote:
|
||||
|
||||
```sh
|
||||
export FLUKSIO=http://127.0.0.1:8000/api/v1
|
||||
export TOKEN=$(jq -r .token ~/.config/fluksio/client.json)
|
||||
export TOKEN=$(jq -r .token .fluksio/client.json)
|
||||
```
|
||||
|
||||
While you are experimenting, the interactive schema at
|
||||
<http://127.0.0.1:8000/docs> is the fastest way to see what is available.
|
||||
|
||||
For an engine on another machine, `fluksio login --url https://…` asks for a
|
||||
password and stores the token the same way — in this project's `.fluksio`, or
|
||||
with `--global` in `~/.fluksio`.
|
||||
|
||||
## Your packages are already there
|
||||
|
||||
If you installed Fluksio into the environment you work in — the venv that
|
||||
@@ -492,7 +528,7 @@ every version of this thing I keep tweaking", note that **your flows are
|
||||
already a git repository**:
|
||||
|
||||
```sh
|
||||
cd ~/.fluksio/flows
|
||||
cd .fluksio/flows
|
||||
git log --oneline
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user