Session

Interactive session engine.

class renku.domain_model.session.ISessionProvider[source]

Bases: object

Abstract class for a interactive session provider.

abstract build_image(image_descriptor, image_name, config)[source]

Builds the container image.

Parameters
  • image_descriptor – Path to the container image descriptor file.

  • image_name – Container image name.

  • config – Path to the session provider specific configuration YAML.

abstract find_image(image_name, config)[source]

Search for the given container image.

Parameters
  • image_name – Container image name.

  • config – Path to the session provider specific configuration YAML.

Returns

True if the given container images is available locally.

Return type

bool

abstract get_name()[source]

Return session provider’s name.

pre_start_checks()[source]

Perform any required checks on the state of the repository prior to starting a session.

The expectation is that this method will abort the session start if the checks are not successful or will take corrective actions to make sure that the session launches successfully. By default this method does not do any checks.

abstract session_list(project_name, config)[source]

Lists all the sessions currently running by the given session provider.

Parameters
  • project_name – Renku project name.

  • config – Path to the session provider specific configuration YAML.

Returns

a list of sessions.

abstract session_provider()[source]

Supported session provider.

Returns

a reference to self.

abstract session_start(image_name, project_name, config, cpu_request=None, mem_request=None, disk_request=None, gpu_request=None)[source]

Creates an interactive session.

Parameters
  • image_name (str) – Container image name to be used for the interactive session.

  • project_name (str) – The project identifier.

  • config (Optional[Dict[str, Any]]) – Path to the session provider specific configuration YAML.

  • cpu_request (Optional[float]) – CPU request for the session.

  • mem_request (Optional[str]) – Memory size request for the session.

  • disk_request (Optional[str]) – Disk size request for the session.

  • gpu_request (Optional[str]) – GPU device request for the session.

Returns

a unique id for the created interactive session.

Return type

str

abstract session_stop(project_name, session_name, stop_all)[source]

Stops all or a given interactive session.

Parameters
  • project_name – Project’s name.

  • session_name – The unique id of the interactive session.

  • stop_all – Specifies whether or not to stop all the running interactive sessions.

Returns

True in case session(s) has been successfully stopped

Return type

bool

abstract session_url(session_name)[source]

Get the given session’s URL.

Parameters

session_name – The unique id of the interactive session.

Returns

URL of the interactive session.

class renku.domain_model.session.Session(id, status, url)[source]

Bases: object

Interactive session.