The bulk of our client processes run within the client "VM", which has docker running as well:
```
$ docker exec "${CLIENT_CONTAINER_ID}" docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
00ba94025605 git.astron.nl:5000/lofar2.0/tango/grafana:latest "/run-wrapper.sh" 12 seconds ago Up 11 seconds grafana-de5690ec-219f-51d5-2946-f2f5133e9612
c30d367c387f git.astron.nl:5000/lofar2.0/tango/loki:latest "/usr/bin/loki -conf…" About a minute ago Up About a minute loki-e9073864-c281-7390-1b03-8c10fa072e73
7d1d7990031c envoyproxy/envoy:v1.26.4 "/docker-entrypoint.…" About a minute ago Up About a minute connect-proxy-loki-e9073864-c281-7390-1b03-8c10fa072e73
3f02415bd6f6 gcr.io/google_containers/pause-amd64:3.1 "/pause" About a minute ago Up About a minute nomad_init_e9073864-c281-7390-1b03-8c10fa072e73
02a644ecf279 git.astron.nl:5000/lofar2.0/tango/postgres:15.4 "docker-entrypoint.s…" About a minute ago Up About a minute postgres-4d957b81-0de1-0bc0-425b-743b28ba6a8e
[...]
```
You can interact with these containers by logging into the client VM, or directly by chaining docker calls:
This allows you to use the regular docker commands like ``attach``, ``logs``, and ``restart``. Note that any interactive use requires ``-it`` for in the top lin ``docker exec -it "${CLIENT_CONTAINER_ID}"``.
## Patching a device server live
Sometimes it is handy to modify the tangostationcontrol source code for a running device server. To do so:
1. Log into the client VM using ``docker exec -it "${CLIENT_CONTAINER_ID}" bash``
2. Find the docker container of the device server (f.e. stationmanager), using ``docker ps -a | grep stationmanager``
3. Enter the device server container with ``docker exec -it <container> bash``
4. Install an editor, f.e. ``sudo apt-get install -y vim``
5. Edit the relevant source file in ``/usr/local/lib/python3.10/dist-packages/tangostationcontrol`` (for Python 3.10)
6. Call the ``restart_device_server()`` command for any device in the changed device server
7. Once restarted, call the ``boot()`` command for all devices in the changed device server to reconfigure them
## Login to the server
The nomad and consul management processes run on the server, which
is actually a docker container in the development environment.
This container can be identified programmatically as follows. Use the additional
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b75f633c837e shipyardrun/nomad:1.6.1 "/usr/bin/supervisor…" 2 minutes ago Up 2 minutes [...] server.station.nomad.nomad-cluster.jumppad.dev
$
```
## Using nomad: Manage jobs on the client
The server allows you to manage the jobs on the client through Nomad. Each *job* consists of one or more *tasks* that are collectively managed. The tasks are (typically) the docker containers. A job is run inside an *allocation*, which represents an execution instance of a job.
The nomad server spins up on http://localhost:4646, allowing interactive browsing and control. There is also a CLI however, accessed through