Skip to content

Conversation

@renereimann
Copy link
Contributor

Purpose: While operation several scripts and running conditions are set. Usually we keep track of the settings, scripts etc in an ELOG. However figuring out the exact start and end of such a script from an ELOG and the database can be difficult.
Therefore we implement a run state service.
The run state is defined by

  • run number: a unique increasing number
  • run comment: a user defined comment that describes the purpose of the run
  • run is active: a boolean showing if a run is currently on-going.

In a setup with multiple user it is important that not two users run a run script concurrently. Therefore, the run is active variable can indicate if a script is already running and if it is okay to start a new run.

The RunStateService containing a state dict with these three properties. The state is saved locally in a file to continue even if the container goes down.

Runs can e.g. be started with the dl-agent and returns the run number of the started run.
dl-agent -b rabbit-broker cmd run_state -s start_run "Test Run"
The run can be stopped with the dl-agent and returns the run number of the stopped run.
dl-agent -b rabbit-broker cmd run_state -s stop_run

Endpoints can be defined to get the individual parameters of the state dict via the StateGetEntity.

An example config file for the service is attached.
This service is especially good to use in python scripts using the dripline.core.interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants