smif.controller.run.dafni_run_scheduler module

Schedulers are used to run models.

The defaults provided allow model runs to be scheduled as subprocesses, or individual models to be called in series.

Future implementations may interface with common schedulers to queue up models to run in parallel and/or distributed.

The DAFNIRunScheduler currently only works while connected to the RAL vpn.

Posts all of the model run information to the DAFNI API so that a DAFNI worker can start the model run.

Summary

Data:

ACCESS_KEY str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
DAFNIRunScheduler The scheduler can run instances of smif as a subprocess and can provide information whether the modelrun is running, is done or has failed.
JOBSUBMISSION_API_URL str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
MINIO_CREDENTIALS_FILE str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
MINIO_IP str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
SECRET_KEY str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
URL_AUTH str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
URL_JOBS str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Reference

class smif.controller.run.dafni_run_scheduler.DAFNIRunScheduler(username, password)[source]

Bases: object

The scheduler can run instances of smif as a subprocess and can provide information whether the modelrun is running, is done or has failed.

add(model_run_name, args)[source]

Add a model_run to the Modelrun scheduler.

Parameters:
  • model_run_name (str) – Name of the modelrun
  • args (dict) – Arguments for the command-line interface
  • Exception
  • ---------
  • Exception – When the modelrun was already started

Notes

DAFNI’s queuing mechanism starts model runs in separate container. This means that it is possible to run multiple modelruns concurrently. This will not cause conflicts.

get_scheduler_type()[source]
get_yamls(model_run_name, args)[source]
get_dict_from_json(file_path)[source]

Given a JSON file, will return the dictionary of values within that file. Is developed to wait for a file to exist (for the case of reading vault secrets) to avoid the inherent race condition.

kill(model_run_name)[source]
get_status(model_run_name)[source]