@neuroflame/vault
v1.0.2
Published
NeuroFLAME vault federated client
Downloads
33
Readme
NeuroFLAME Vault Federated Client
The vault federated client runs on a data provider machine and keeps one or more hosted datasets online for NeuroFLAME runs. It connects to the central API, reports dataset availability through heartbeat messages, and launches computation containers when central starts a run for one of its hosted vaults.
Install
Install the package globally on the vault host:
sudo npm install -g @neuroflame/vaultThe global command is:
neuroflame-vaultCreate A Vault Token
In the NeuroFLAME desktop app, use the admin vault page to create a vault user. Copy the returned token and use it as VAULT_ACCESS_TOKEN.
That token identifies this vault service to central. After the service starts and sends a heartbeat, central creates the vault server record and shows its reported datasets in the admin vault page.
Environment
The client is configured by environment variables.
Required:
VAULT_HTTP_URL=http://your-central-api.example.com:3001/graphql
VAULT_WS_URL=ws://your-central-api.example.com:3001/graphql
VAULT_ACCESS_TOKEN=your-vault-token
VAULT_BASE_DIR=/var/lib/neuroflame/vault/work
VAULT_DATASET_DIR=/path/to/your/datasetsUse http and ws when connecting directly to a raw central API port. Use https and wss only when the endpoint is behind TLS termination, such as a reverse proxy or load balancer with a certificate.
Optional:
VAULT_LOG_PATH=/var/log/neuroflame/vault
VAULT_CONTAINER_SERVICE=dockerVAULT_DATASET_DIR should contain one directory per dataset. Each child directory is reported to central as an available dataset key.
Data Discovery
Vault dataset discovery is directory based. On each heartbeat, the vault client scans the immediate child directories under VAULT_DATASET_DIR.
For example:
/data/neuroflame-vault/
freesurfer-site1/
vbm-data/With VAULT_DATASET_DIR=/data/neuroflame-vault, central receives two available dataset keys:
freesurfer-site1
vbm-dataThe scan is not recursive. Files directly inside VAULT_DATASET_DIR are ignored, and nested folders are treated as part of their parent dataset. Admins create hosted vault entries from these reported dataset keys in the NeuroFLAME admin vault page.
Commands
Validate required environment:
neuroflame-vault validatePrint the effective environment, with the access token masked:
neuroflame-vault envStart the vault service:
neuroflame-vault startWrite a systemd service template into the current directory:
neuroflame-vault systemd-templateOverwrite an existing local template:
neuroflame-vault systemd-template --forcesystemd
Generate a local template:
neuroflame-vault systemd-templateEdit ./neuroflame-vault.service and replace the inline Environment= examples with real values.
Install and start the service:
sudo cp ./neuroflame-vault.service /etc/systemd/system/neuroflame-vault.service
sudo systemctl daemon-reload
sudo systemctl enable neuroflame-vault
sudo systemctl start neuroflame-vaultView logs:
journalctl -u neuroflame-vault -fDataset Lifecycle
- Admin creates a vault user in the desktop app and copies the token.
- Operator installs
@neuroflame/vaulton the vault host. - Operator configures the systemd template with the central URLs, token, work directory, and dataset directory.
- Vault service starts and sends heartbeat with available dataset directories.
- Admin creates hosted vault entries from the reported datasets.
- Consortium leaders add those hosted vaults to consortia.
Local Development
For local repo development:
npm install
npm run compile
VAULT_HTTP_URL=http://localhost:4000/graphql \
VAULT_WS_URL=ws://localhost:4000/graphql \
VAULT_ACCESS_TOKEN=your-vault-token \
VAULT_BASE_DIR=/tmp/neuroflame-vault/work \
VAULT_DATASET_DIR=/tmp/neuroflame-vault/datasets \
npm start