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)

Bases: abc.ABC

IPlatformSuiteOperations defines suite item operations interface.

platform: IPlatform
platform_type: Type
abstract get(suite_id: uuid.UUID, **kwargs) Any

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[idmtools.entities.suite.Suite], display_progress: bool = True, **kwargs) List[Tuple[Any, uuid.UUID]]

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: idmtools.entities.suite.Suite, **kwargs) NoReturn

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: idmtools.entities.suite.Suite, **kwargs) NoReturn

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: idmtools.entities.suite.Suite, do_pre: bool = True, do_post: bool = True, **kwargs) Tuple[Any, uuid.UUID]

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 UUID of said item

abstract platform_create(suite: idmtools.entities.suite.Suite, **kwargs) Tuple[Any, uuid.UUID]

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 UUID of said item

pre_run_item(suite: idmtools.entities.suite.Suite, **kwargs)

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: idmtools.entities.suite.Suite, **kwargs)

Trigger right after commissioning suite on platform.

Parameters:

suite – Experiment just commissioned

Returns:

None

run_item(suite: idmtools.entities.suite.Suite, **kwargs)

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

Parameters:

suite – suite to run

Returns:

None

platform_run_item(suite: idmtools.entities.suite.Suite, **kwargs)

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

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]

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) idmtools.entities.suite.Suite

Converts the platform representation of suite to idmtools representation.

Parameters:

suite – Platform suite object

Returns:

IDMTools suite object

abstract refresh_status(experiment: idmtools.entities.suite.Suite, **kwargs)

Refresh status of suite.

Parameters:

experiment

Returns:

None

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

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 } } }

__init__(platform: IPlatform, platform_type: Type) None