idmtools.entities.iplatform_ops.iplatform_suite_operations module

IPlatformSuiteOperations defines suite item operations interface.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

class idmtools.entities.iplatform_ops.iplatform_suite_operations.IPlatformSuiteOperations(platform: IPlatform, platform_type: Type)[source]

Bases: ABC

IPlatformSuiteOperations defines suite item operations interface.

platform: IPlatform
platform_type: Type
abstract get(suite_id: str, **kwargs) Any[source]

Returns the platform representation of an Suite.

Parameters:
  • suite_id – Item id of Suites

  • **kwargs

Returns:

Platform Representation of an suite

batch_create(suites: List[Suite], display_progress: bool = True, **kwargs) List[Tuple[Any, str]][source]

Provides a method to batch create suites.

Parameters:
  • display_progress – Display progress bar

  • suites – List of suites to create

  • **kwargs

Returns:

List of tuples containing the create object and id of item that was created

pre_create(suite: Suite, **kwargs) NoReturn[source]

Run the platform/suite post creation events.

Parameters:
  • suite – Experiment to run post-creation events

  • **kwargs – Optional arguments mainly for extensibility

Returns:

NoReturn

post_create(suite: Suite, **kwargs) NoReturn[source]

Run the platform/suite post creation events.

Parameters:
  • suite – Experiment to run post-creation events

  • **kwargs – Optional arguments mainly for extensibility

Returns:

NoReturn

create(suite: Suite, do_pre: bool = True, do_post: bool = True, **kwargs) Tuple[Any, str][source]

Creates an simulation from an IDMTools suite object.

Also performs pre-creation and post-creation locally and on platform.

Parameters:
  • suite – Suite to create

  • do_pre – Perform Pre creation events for item

  • do_post – Perform Post creation events for item

  • **kwargs – Optional arguments mainly for extensibility

Returns:

Created platform item and the id of said item

abstract platform_create(suite: Suite, **kwargs) Tuple[Any, str][source]

Creates an suite from an IDMTools suite object.

Parameters:
  • suite – Suite to create

  • **kwargs – Optional arguments mainly for extensibility

Returns:

Created platform item and the id of said item

pre_run_item(suite: Suite, **kwargs)[source]

Trigger right before commissioning experiment on platform.

This ensures that the item is created. It also ensures that the children(simulations) have also been created.

Parameters:

suite – Experiment to commission

Returns:

None

post_run_item(suite: Suite, **kwargs)[source]

Trigger right after commissioning suite on platform.

Parameters:

suite – Experiment just commissioned

Returns:

None

run_item(suite: Suite, **kwargs)[source]

Called during commissioning of an item. This should create the remote resource.

Parameters:

suite – suite to run

Returns:

None

platform_run_item(suite: Suite, **kwargs)[source]

Called during commissioning of an item. This should perform what is needed to commission job on platform.

Parameters:

suite

Returns:

None

abstract get_parent(suite: Any, **kwargs) Any[source]

Returns the parent of item. If the platform doesn’t support parents, you should throw a TopLevelItem error.

Parameters:
  • suite

  • **kwargs

Returns:

Parent of suite

Raises:

TopLevelItem

abstract get_children(suite: Any, **kwargs) List[Any][source]

Returns the children of an suite object.

Parameters:
  • suite – Suite object

  • **kwargs – Optional arguments mainly for extensibility

Returns:

Children of suite object

to_entity(suite: Any, **kwargs) Suite[source]

Converts the platform representation of suite to idmtools representation.

Parameters:

suite – Platform suite object

Returns:

IDMTools suite object

abstract refresh_status(experiment: Suite, **kwargs)[source]

Refresh status of suite.

Parameters:

experiment

Returns:

None

get_assets(suite: Suite, files: List[str], **kwargs) Dict[str, Dict[str, Dict[str, bytearray]]][source]

Fetch assets for suite.

Parameters:
  • suite – suite to get assets for

  • files – Files to load

  • **kwargs

Returns:

Nested dictionaries in the structure experiment_id { simulation_id { files = content } } }

create_sim_directory_map(suite_id: str) Dict[source]

Build simulation working directory mapping. :param suite_id: suite id

Returns:

Dict

platform_delete(suite_id: str) None[source]

Delete platform suite. :param suite_id: suite id

Returns:

None

platform_cancel(suite_id: str) None[source]

Cancel platform suite. :param suite_id: suite id

Returns:

None

__init__(platform: IPlatform, platform_type: Type) None