Bus Services

Start with one small service.

A Services stack is just a public stack file plus profiles. The stack names the services and dependencies; profiles describe how each service runs without putting private tokens or DSNs into the public file.

1. Install the Bus binary tools

Use the standard BusDK installer first. It installs the Bus binary tools needed for Bus Services, including the bus command and Services modules in the release.

curl -fsSL https://install.busdk.com | bash

Other downloads are available from github.com/busdk/busdk/releases.

2. Create a stack file

Put this in services.yml. It defines one service named demo and points it at a project-local profile.

version: "0"
services:
  demo:
    profile: demo-native

3. Add the profile

Put this in profiles/demo-native.yml. The example service stays alive until Services stops it.

id: demo-native
name: Demo native process
service_kind: example.demo
runtime:
  kind: native
  provider: local
  command: ["/bin/sh"]
  args: ["-c", "trap 'exit 0' TERM; while true; do sleep 1; done"]

4. Validate, start, inspect, stop

bus services stack validate
bus services stack plan
bus services up
bus services list
bus services down

list shows service ids, status, runtime kind, provider, PID, start time, and log path. It does not show resolved token values, DSNs, passwords, or private keys.

5. Put state where operations expect it

By default, Services state lives under .bus/services next to the stack. Use --state-dir for a dedicated host directory or container volume.

bus services up \
  --state-dir /var/lib/bus/services