cerise package

Subpackages

Submodules

cerise.config module

class cerise.config.Config(config: Dict[str, Any], api_config: Dict[str, Any])[source]

Bases: object

Create a configuration object.

Parameters:
  • config (dict) – A main configuration dict.
  • api_config (dict) – An API configuration dict.
close_file_systems() → None[source]

Close any open connections and free resources.

This function is to be called on shutdown, to ensure that the remote file system managed by Config is shut down properly.

get_base_url() → str[source]

Returns the service’s base url.

This is the URL of the REST API, before the /jobs part, e.g. if listing jobs is done by a GET to http://localhost/jobs, then this should be set to http://localhost. Obtained from the configuration file or the CERISE_BASE_URL environment variable.

get_basedir() → cerulean.path.Path[source]

Returns the configured remote base directory to use.

Returns:The remote path to the base directory.
Return type:(str)
get_cores_per_node() → int[source]

Returns the number of cores per node.

This depends on the available compute hardware, and should be configured in the specialisation. The incoming workflow specifies a number of cores, but we reserve nodes, so we need to convert.

The default is 32, which is probably more than what you have, as a result of which we’ll allocate fewer nodes than the user specified if no value is given. That’ll slow things down, but at least we won’t be burning core hours needlessly.

Returns:The number of cores per node on this machine.
Return type:(int)
get_database_location() → str[source]

Returns the local path to the database file.

Returns:The path.
Return type:(str)
Raises:KeyError – No database path was set.
get_file_system() → cerulean.file_system.FileSystem[source]

Returns a remote file system as configured by the user.

Returns:(cerulean.FileSystem) A new filesystem
get_log_file() → str[source]

Returns the configured path for the log file. Use has_logging() to see if logging has been configured first.

Returns:The path.
Return type:(str)
get_log_level() → int[source]

Returns the configured log level. Use has_logging() to see if logging has been configured first.

Returns:The log level, following Python’s built-in logging library.
Return type:(int)
get_pid_file() → Optional[str][source]

Returns the location of the PID file, if any.

Returns:The configured path, or None
Return type:(Union[str,None])
get_queue_name() → Optional[str][source]

Returns the name of the queue to submit jobs to, or None if no queue name was configured.

Returns:The queue name.
Return type:(Union[str,None])
get_remote_cwl_runner() → str[source]

Returns the configured remote path to the CWL runner to use.

No macro substitution is done; this gives the configured path as-is.

Returns:The path.
Return type:(str)
get_remote_refresh() → float[source]

Returns the interval in between checks of the remote job status, in seconds.

Returns:How often to check remote job status.
Return type:(float)
get_scheduler(run_on_head_node: bool = False) → cerulean.scheduler.Scheduler[source]

Returns a scheduler as configured by the user.

Parameters:run_on_head_node (bool) – If True, will create a scheduler using the ssh adaptor instead of the configured one if the configured adaptor is a cluster scheduler (i.e. slurm, torque or gridengine).
Returns:A new scheduler
Return type:(cerulean.Scheduler)
get_scheduler_options() → Optional[str][source]

Returns the additional scheduler options to use.

Returns:The options as a single string.
Return type:(str)
get_service_host() → str[source]

Return the host interface Cerise should listen on.

Returns:The IP address of the interface to listen on.
Return type:str
get_service_port() → int[source]

Return the port on which Cerise should listen.

Returns:The port number to listen on.
Return type:int
get_slots_per_node() → int[source]

Returns the configured number of MPI slots per node.

Returns:The number of slots to use.
Return type:(int)
get_store_location_client() → str[source]

Returns the file exchange location access point for the client.

Returns:A URL.
Return type:(str)
Raises:KeyError – The location was not set.
get_store_location_service() → cerulean.path.Path[source]

Returns the file exchange location access point for the service.

Returns:The local base directory for file exchange with the client.
Raises:KeyError – The location was not set.
get_username(kind: str) → Optional[str][source]

Return the username used to connect to the specified kind of resource.

Parameters:kind (str) – Either ‘files’ or ‘jobs’
Returns:The configured username
Return type:(str)
has_logging() → bool[source]

Returns if logging is configured.

Returns:True iff a logging section is available in the configuration.
cerise.config.make_config() → cerise.config.Config[source]

Make a configuration object.

Uses the configuration files and environment variables to determine the configuration.

Returns:The Cerise configuration.
Return type:Config

cerise.run_back_end module

cerise.run_front_end module

cerise.util module

Module contents