Skip to content

Commit

Permalink
Merge pull request #353 from simonsobs/mhasse/hostman-overhaul
Browse files Browse the repository at this point in the history
Overhaul HostManager
  • Loading branch information
BrianJKoopman authored Sep 20, 2023
2 parents 00f5731 + 5b3cb97 commit d75c972
Show file tree
Hide file tree
Showing 9 changed files with 688 additions and 344 deletions.
2 changes: 0 additions & 2 deletions docs/agents/host_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,4 @@ Agent API
Supporting APIs
---------------

.. automethod:: ocs.agents.host_manager.agent.HostManager._process_target_states

.. automethod:: ocs.agents.host_manager.agent.HostManager._reload_config
46 changes: 31 additions & 15 deletions docs/user/centralized_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ block would become:
'arguments': [['--serial-number', 'LSA22BB'],
['--mode', 'acq']]},
{'agent-class': 'HostManager',
'instance-id': 'hm-host-1',
'arguments': [['--initial-state', 'up']],
'instance-id': 'hm-host-1'},
},
]
}
Expand Down Expand Up @@ -205,9 +204,14 @@ in ocsbow or ocs-web, will show up as simply "[docker]".
Advanced host config
~~~~~~~~~~~~~~~~~~~~

In some cases you might want to temporarily exclude an agent from
HostManager control. You can do this by setting ``'manage':
'no'``.
The ``manage`` setting in the instance description can be used to
fine-tune the treatment of each Agent instance by HostManager. For
example, to exclude an instance from HostManager tracking and control,
specify ``'manage': 'ignore'``. It is also possible to specify that
certain instances should not be started automatically (for example
``"host/down"`` or ``"docker/down"``). For information on the
available settings for "manage", see the description in
:meth:`ocs.site_config.InstanceConfig.from_dict`.

It is possible to mix host- and docker-based agents in a single host
config block, and control them all with a single HostManager instance.
Expand Down Expand Up @@ -291,18 +295,28 @@ The agent in host-1-docker has the annotation [d] beside its class
name, indicating this is an agent managed through a docker container.
(The docker service name, in this example, would be ocs-LSARR00.)

A managed docker container that has not been associated with a
specific agent will show up with agent-class "[docker]" and an
instance-id corresponding to the service name; for example::
If an Agent has been configured with ``'manage': 'ignore'``, it will
be marked with suffix ``[unman]`` and will have question marks in the
state and target fields, e.g.::

[instance-id] [agent-class] [state] [target]
influxdb [docker] up up
[instance-id] [agent-class] [state] [target]
registry RegistryAgent[unman] ? ?

Note that if an Agent has been configured with ``'manage': 'no'``, it
will show with question marks in the state and target fields, e.g.::
If the SCF seen by ocsbow and the information in HostManager are not
in agreement, then the agent-class will include two values, connected
with a slash. For example, if the local SCF expects the instance to
be managed through docker, but the HostManager reports it running on
the host, then the line might look like this::

[instance-id] [agent-class] [state] [target]
registry RegistryAgent ? ?
[instance-id] [agent-class] [state] [target]
LSARR00 Lakeshore372Agent[d]/Lakeshore372Agent up up

A managed docker container that has not been associated with a
specific instance will show up with agent-class "?/[docker]" and an
instance-id corresponding to the service name. For example::

[instance-id] [agent-class] [state] [target]
influxdb ?/[docker] up up


``state`` and ``target``
Expand All @@ -312,7 +326,9 @@ The ``state`` column shows whether the Agent is currently running
(``up``) or not (``down``). This column may also show the value
``unstable``, which indicates that an Agent keeps restarting (this
usually indicates a code, configuration, or hardware error that is
causing the agent to crash shortly after start-up).
causing the agent to crash shortly after start-up). The value may
also be ``?``, indicating that the agent is marked to be run through
Docker, but no corresponding docker service has been identified.

For the non-HostManager agents, the ``target`` column shows the state
that HostManager will try to achieve for that Agent. So if
Expand Down
3 changes: 1 addition & 2 deletions docs/user/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ structure.
# on the host
'agent-instances': [
{'agent-class': 'HostManager',
'instance-id': 'hm-1',
'arguments': ['--initial-state', 'up']},
'instance-id': 'hm-1'},
]
}

Expand Down
Loading

0 comments on commit d75c972

Please sign in to comment.