This config resides in
/etc/lithos/processes/NAME.yaml (by default).
NAME is the name of a sandbox.
It mainly contains three things:
imagethe process is run from
configfile name inside the image that specifies command-line and other process execution parameters
instancesof the process to run
django: image: django.v3.5.7 config: /config/worker_process.yaml instances: 3 redis: image: redix.v1 config: /config/redis.yaml instances: 1
This will start three python
django worker processes and one redis.
There is also a way to create ad-hoc commands. For example:
manage: kind: Command image: django.v3.5.7 config: /config/manage_py.yaml
This will allow to start a
manage.py command with:
$ lithos_cmd SANDBOX_NAME manage syncdb
This runs command in the same sandbox like the worker process itself but
the command is actually attached to current shell. The commands may be freely
Daemon items (which is default
kind) in same config. The
only limitation is that names must not be duplicated
Command is occasionally useful, but should be used with care. To start
a command you need root privileges on host system, so it’s only useful for
SysOp tasks or may be for cron tasks but not for normal operation of
Number of instances to run
Identifier of the image to run container from
Configuration file name (absolute name in container) to run
A mapping of variable: value for variables that can be used in process config.
You can also add variables for specific config:
django: image: django.v3.5.7 config: /config/worker_process.yaml variables: tcp_port: 10001 instances: 3
Only variables that are declared in container config can be substituted. Extra variables are ignored. If there is a declared variable but it’s not present in process config, it doesn’t pass configuration check.