Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Process Scripts

All process startup bash lives in scripts/processes/*.sh. Shared helpers are in scripts/lib/.

Process Scripts

ScriptServiceDependencies
aeron-driver.shAeron IPC transportNone
gaius-engine.shgRPC engine daemonAeron, PostgreSQL
gaius-worker.shBackground workerEngine
metabase.shAnalytics dashboardsPostgreSQL
metaflow-bootstrap.shMetaflow K8s setupKubernetes
metaflow-db-setup.shMetaflow databasePostgreSQL
metaflow-port-forwards.shK8s port forwardingKubernetes
metaflow-ui.shMetaflow UIMetaflow service
nifi.shData ingestionPostgreSQL

Shared Helpers

scripts/lib/process-helpers.sh

Common functions used by all process scripts:

FunctionPurpose
bannerPrint startup banner with service name
check_disabledSkip if service is disabled via env var
wait_for_postgresBlock until PostgreSQL is accepting connections
wait_for_aeronBlock until Aeron driver is ready

scripts/lib/gpu-helpers.sh

GPU cleanup functions shared by gaius-engine.sh and the justfile:

FunctionPurpose
gpu_cleanupKill orphan vLLM/CUDA processes

Script Pattern

Every process script follows the same structure:

#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/process-helpers.sh"

banner "Service Name"
check_disabled "SERVICE_NAME"

# Wait for dependencies
wait_for_postgres

# Set KUBECONFIG unconditionally (not from enterShell)
export KUBECONFIG="$HOME/.config/kube/rke2.yaml"

# Start the service
exec some-command --flags

Adding a New Process

  1. Create scripts/processes/<name>.sh with the pattern above
  2. Add process block to devenv.nix with one-liner exec
  3. Pass any Nix-only values as env vars in the exec block
  4. Set dependency ordering with process-compose.depends_on