Add StartOS 0.4 package scaffold (manifest, main, interfaces, 2 actions)

- package/Makefile + s9pk.mk + package.json + tsconfig.json
- startos/manifest: dockerBuild source pointing at ../image/Dockerfile
- startos/main: reads /data/config.yaml reactively, passes env vars to container
- startos/interfaces: binds port 9999 as HTTP UI
- startos/actions: showPublicKey (read /data/ssh/id_ed25519.pub), configureSparks
- TS + JS bundle compile clean (tsc --noEmit, ncc build)
This commit is contained in:
Grant
2026-05-12 09:36:15 -05:00
parent ae8efa1754
commit dd9d53060b
28 changed files with 931 additions and 0 deletions
@@ -0,0 +1,60 @@
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: 'Head node. Example: <spark-1-ip>',
required: true,
default: null,
placeholder: '<spark-1-ip>',
masked: false,
}),
spark1_user: Value.text({
name: 'Spark 1 SSH user',
description: 'Usually "<spark-user>".',
required: true,
default: '<spark-user>',
placeholder: '<spark-user>',
masked: false,
}),
spark2_host: Value.text({
name: 'Spark 2 hostname or IP',
description: 'Worker node. Example: <spark-2-ip>',
required: true,
default: null,
placeholder: '<spark-2-ip>',
masked: false,
}),
spark2_user: Value.text({
name: 'Spark 2 SSH user',
description: 'Usually "<spark-user>".',
required: true,
default: '<spark-user>',
placeholder: '<spark-user>',
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 }) => {
await sparkConfigYaml.merge(effects, input)
return null
},
)