Session

Interactive session engine.

class renku.domain_model.session.IHibernatingSessionProvider[source]

Bases: ISessionProvider

Abstract class for an interactive session provider that supports hibernation.

abstract session_pause(project_name, session_name, **kwargs)[source]

Pause all or a given interactive session.

Parameters:
  • project_name (str) – Project’s name.

  • session_name (str, optional) – The unique id of the interactive session.

Returns:

The status of running and paused sessions

Return type:

SessionStopStatus

abstract session_resume(project_name, session_name, **kwargs)[source]

Resume a paused session.

Parameters:
  • project_name (str) – Renku project name.

  • session_name (Optional[str]) – The unique id of the interactive session.

class renku.domain_model.session.ISessionProvider[source]

Bases: object

Abstract class for an 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 (str) – 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

force_build_image(**kwargs)[source]

Whether we should force build the image directly or check for an existing image first.

abstract get_open_parameters()[source]

Returns parameters that can be set for session open.

abstract get_start_parameters()[source]

Returns parameters that can be set for session start.

abstract is_remote_provider()[source]

Return True for remote providers (i.e. not local Docker).

abstract property name

Return session provider’s name.

pre_start_checks(**kwargs)[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)[source]

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

Parameters:

project_name (str) – Renku project name.

Returns:

a list of sessions.

abstract session_open(project_name, session_name, **kwargs)[source]

Open a given interactive session.

Parameters:
  • project_name (str) – Renku project name.

  • session_name (Optional[str]) – The unique id of the interactive session.

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, **kwargs)[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:

Provider message and a possible warning message.

Return type:

Tuple[str, str]

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

Stops all or a given interactive session.

Parameters:
  • project_name (str) – Project’s name.

  • session_name (str, optional) – The unique id of the interactive session.

  • stop_all (bool) – Specifies whether to stop all the running interactive sessions.

Returns:

The status of running and stopped sessions

Return type:

SessionStopStatus

abstract session_url(session_name)[source]

Get the given session’s URL.

Parameters:

session_name (str) – The unique id of the interactive session.

Returns:

URL of the interactive session.

class renku.domain_model.session.Session(id, status, url, commit, branch, provider, start_time, ssh_enabled=False)[source]

Bases: object

Interactive session.

property name

Return session name which is the same as its id.

class renku.domain_model.session.SessionStopStatus(value)[source]

Bases: Enum

Status code returned when stopping/pausing sessions.