Files
spark-control/package/startos/actions/configureSparks.ts
T
Grant 27699a2469 v0.2.0 - Always-on services panel with per-service host config
Dashboard:
- New 'Always-on services' section with cards for Parakeet and Magpie
- Each card: host:port, model loaded, status pill (Healthy/Unhealthy/Starting/Not configured)
- Start, Restart, Stop buttons. Buttons disabled when not applicable for current state
- Restart counter shown when > 1 (would have surfaced the old magpie crash loop)

Backend:
- New /api/services GET: docker container state + http health for each support service
- New POST /api/services/{name}/{action} for start | stop | restart
- services.py module: docker_state, run_action via SSH
- config.py: PARAKEET_HOST/USER/CONTAINER and MAGPIE_* env vars, default to spark2_*
- health.py: use per-service hosts (no longer hard-wired to spark2_host)

Package:
- sparkConfig.yaml.ts: add 6 new optional fields
- configureSparks action: optional 'Parakeet host', 'Parakeet container', 'Magpie host', 'Magpie container' fields; descriptions explain they default to Spark 2 when blank
- Handler normalizes nulls to empty strings before merge
- main.ts: pass new env vars to container
- bump to 0.2.0:0
2026-05-12 11:21:15 -05:00

105 lines
3.3 KiB
TypeScript

import { sdk } from '../sdk'
import { sparkConfigYaml } from '../fileModels/sparkConfig.yaml'
const { InputSpec, Value } = sdk
const inputSpec = InputSpec.of({
spark1_host: Value.text({
name: 'Spark 1 hostname or IP',
description:
'The head node of your DGX Spark cluster — the one that has ~/spark-vllm-docker cloned and runs the vLLM container. Enter its LAN IP (recommended) or hostname.',
required: true,
default: null,
placeholder: 'e.g. 192.168.1.10',
masked: false,
}),
spark1_user: Value.text({
name: 'Spark 1 SSH user',
description:
'The user account on Spark 1 to SSH in as — whatever you log in as when you ssh into it manually.',
required: true,
default: null,
placeholder: 'your SSH username',
masked: false,
}),
spark2_host: Value.text({
name: 'Spark 2 hostname or IP',
description:
'The worker node of your DGX Spark cluster (also runs always-on services like Parakeet/Magpie). Enter its LAN IP or hostname.',
required: true,
default: null,
placeholder: 'e.g. 192.168.1.11',
masked: false,
}),
spark2_user: Value.text({
name: 'Spark 2 SSH user',
description:
'The user account on Spark 2 to SSH in as. Usually the same as Spark 1.',
required: true,
default: null,
placeholder: 'your SSH username',
masked: false,
}),
parakeet_host: Value.text({
name: 'Parakeet host (optional)',
description:
'Override the host running the Parakeet STT container. Leave blank if Parakeet runs on Spark 2 — that\'s the default. Set this if you run Parakeet on Spark 1 or a different machine.',
required: false,
default: null,
placeholder: 'leave blank to use Spark 2',
masked: false,
}),
parakeet_container: Value.text({
name: 'Parakeet container name (optional)',
description:
'Docker container name for Parakeet. Defaults to "parakeet-asr" — change only if you named yours something else.',
required: false,
default: null,
placeholder: 'parakeet-asr',
masked: false,
}),
magpie_host: Value.text({
name: 'Magpie host (optional)',
description:
'Override the host running the Magpie TTS container. Leave blank if Magpie runs on Spark 2.',
required: false,
default: null,
placeholder: 'leave blank to use Spark 2',
masked: false,
}),
magpie_container: Value.text({
name: 'Magpie container name (optional)',
description:
'Docker container name for Magpie. Defaults to "magpie-tts".',
required: false,
default: null,
placeholder: 'magpie-tts',
masked: false,
}),
})
export const configureSparks = sdk.Action.withInput(
'configure-sparks',
async () => ({
name: 'Configure Sparks',
description: 'Set the hostnames and SSH users for your two Spark nodes.',
warning: null,
visibility: 'enabled',
allowedStatuses: 'any',
group: null,
}),
async () => inputSpec,
async ({ effects }) => {
const cfg = await sparkConfigYaml.read().once()
return cfg ?? null
},
async ({ effects, input }) => {
// Optional fields come through as `null`; coerce to empty string for the schema.
const normalized = Object.fromEntries(
Object.entries(input).map(([k, v]) => [k, v ?? '']),
) as Record<string, string>
await sparkConfigYaml.merge(effects, normalized)
return null
},
)