27699a2469
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
25 lines
802 B
TypeScript
25 lines
802 B
TypeScript
import { FileHelper } from '@start9labs/start-sdk'
|
|
import { z } from 'zod'
|
|
import { sdk } from '../sdk'
|
|
|
|
export const sparkConfigSchema = z.object({
|
|
spark1_host: z.string().catch(''),
|
|
spark1_user: z.string().catch(''),
|
|
spark2_host: z.string().catch(''),
|
|
spark2_user: z.string().catch(''),
|
|
// Optional per-service overrides. Blank => use spark2_host / spark2_user.
|
|
parakeet_host: z.string().catch(''),
|
|
parakeet_user: z.string().catch(''),
|
|
parakeet_container: z.string().catch(''),
|
|
magpie_host: z.string().catch(''),
|
|
magpie_user: z.string().catch(''),
|
|
magpie_container: z.string().catch(''),
|
|
})
|
|
|
|
export type SparkConfig = z.infer<typeof sparkConfigSchema>
|
|
|
|
export const sparkConfigYaml = FileHelper.yaml(
|
|
{ base: sdk.volumes.main, subpath: 'config.yaml' },
|
|
sparkConfigSchema,
|
|
)
|