11version : ' 2.3'
22
3+ x-helios-image : &helios-image
4+ image : ghcr.io/balena-io/helios:0.25.21
5+
36services :
47 # This service can only be named `main`, `balena-supervisor` or `core`
58 # in a multi-container supervisor, the API `supervisor_release` needs to be able to
@@ -8,10 +11,76 @@ services:
811 core :
912 build : ./
1013 privileged : true
11- tty : true
14+ tty : false
1215 restart : always
1316 network_mode : host
1417 labels :
1518 io.balena.features.balena-api : ' 1'
1619 io.balena.features.dbus : ' 1'
1720 io.balena.features.balena-socket : ' 1'
21+
22+ # This is the next generation supervisor service. When started, it becomes a proxy
23+ # for calls between the existing supervisor and the balenaAPI and containers
24+ core-next :
25+ << : *helios-image
26+ restart : on-failure
27+ # required to distinguish between stderr/stdout, the supervisor defaults to true
28+ tty : false
29+ labels :
30+ # Needed to get access to supervisor api variables
31+ # and credentials
32+ io.balena.features.supervisor-api : ' 1'
33+ # Needed for access to DOCKER_HOST
34+ io.balena.features.balena-socket : ' 1'
35+ # Needed to stop the supervisor service
36+ io.balena.features.dbus : ' 1'
37+ # Needed to get access to the API credentials
38+ io.balena.features.balena-api : ' 1'
39+ # Needed to get Host OS metadata
40+ io.balena.features.host-os.board-rev : ' 1'
41+ environment :
42+ - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
43+ # Needed for locks and balenahup. This needs to match the device
44+ # used for the `runtime` volume
45+ - BALENA_HOST_RUNTIME_DIR=/tmp/balena-supervisor
46+ volumes :
47+ # Critical configurations
48+ - config:/config/helios
49+ # Request caching
50+ - cache:/cache/helios
51+ # Persistent system state data that can be reconstructed from
52+ # the target state
53+ - state:/local/helios
54+ # Runtime directory. Data here does not persist after reboots
55+ - runtime:/tmp/run
56+
57+ # The service below relays requests between tcp port 48484 and the socket exposed by
58+ # the core-next service
59+ service-relay :
60+ << : *helios-image
61+ command : socat TCP-LISTEN:48484,reuseaddr,fork UNIX-CONNECT:/tmp/run/helios.sock
62+ # required to distinguish between stderr/stdout, the supervisor defaults to true
63+ tty : false
64+ ports :
65+ - 48484
66+ depends_on :
67+ - core
68+ volumes :
69+ - runtime:/tmp/run
70+ healthcheck :
71+ test : ['CMD', 'wget', '-O', '-', '-q', 'http://127.0.0.1:48484/ping']
72+
73+ volumes :
74+ config :
75+ state :
76+ labels :
77+ # the database version, can be bumped to re-create the state
78+ io.balena.private.db-version : 0
79+ cache :
80+ runtime :
81+ driver : local
82+ driver_opts :
83+ type : none
84+ o : bind
85+ # XXX: this directory needs to exist on the host before the container is started
86+ device : /tmp/balena-supervisor
0 commit comments