AmpelProject/Ampel-core

Emergency stop for a channel

jvansanten opened this issue · 2 comments

We just received a request to stop the OKC_LENSED channel immediately. This sort of thing might happen more often, and needs to be handled cleanly. There are a few options:

  • Manually edit plug-in channel config and set active=false. This only works if the config file is not frozen into a container.
  • Add an option to the alertprocessor entrypoint to disable certain channels, and pass these on the command line in the stack configuration. Since the stack configuration is always outside the container, this works in both cases.

Another option would be to instantiate the AlertProcessor using the channels parameter.

  • channels=None -> all (active) channels are loaded
  • channels=["HU_SN1", ...] -> the provided channels are loaded (regardless of their active state)

the channels parameter could be built using:

AmpelConfig.get_config("channels").keys() - channels_to_avoid

whereby:

  • AmpelConfig.get_config("channels").keys() returns all channel names known to the Ampel instance
    Note: actually the non-active channels should be filtered out
  • channels_to_avoid could be a list loaded from env variable (ex: ["CHAN_NOT_TO_LOAD", ...])

Yes, I think that is way you would implement the second option.