idmtools.entities.iplatform_ops.iplatform_workflowitem_operations module

class idmtools.entities.iplatform_ops.iplatform_workflowitem_operations.IPlatformWorkflowItemOperations(platform: ‘IPlatform’, platform_type: Type)

Bases: idmtools.core.cache_enabled.CacheEnabled, abc.ABC

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

Returns the platform representation of an WorkflowItem

Parameters
  • workflow_item_id – Item id of WorkflowItems

  • **kwargs

Returns

Platform Representation of an workflow_item

batch_create(workflow_items: List[idmtools.entities.iworkflow_item.IWorkflowItem], display_progress: bool = True, **kwargs) → List[Any]

Provides a method to batch create workflow items

Parameters
  • workflow_items – List of worfklow items to create

  • display_progress – Whether to display progress bar

  • **kwargs

Returns

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

pre_create(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **kwargs) → NoReturn

Run the platform/workflow item post creation events

Parameters
  • workflow_item – IWorkflowItem to run post-creation events

  • **kwargs – Optional arguments mainly for extensibility

Returns

NoReturn

post_create(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **kwargs) → NoReturn

Run the platform/workflow item post creation events

Parameters
  • workflow_item – IWorkflowItem to run post-creation events

  • **kwargs – Optional arguments mainly for extensibility

Returns

NoReturn

create(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, do_pre: bool = True, do_post: bool = True, **kwargs) → Any

Creates an workflow item from an IDMTools IWorkflowItem object. Also performs pre-creation and post-creation locally and on platform

Parameters
  • workflow_item – 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(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **kwargs) → Tuple[Any, uuid.UUID]

Creates an workflow_item from an IDMTools workflow_item object

Parameters
  • workflow_item – WorkflowItem to create

  • **kwargs – Optional arguments mainly for extensibility

Returns

Created platform item and the UUID of said item

pre_run_item(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **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

workflow_item – Experiment to commission

Returns:

post_run_item(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **kwargs)

Trigger right after commissioning workflow item on platform.

Parameters

workflow_item – Experiment just commissioned

Returns:

run_item(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **kwargs)

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

Parameters

workflow_item

Returns:

abstract platform_run_item(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **kwargs)

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

Parameters

workflow_item

Returns:

abstract get_parent(workflow_item: Any, **kwargs) → Any

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

Parameters
  • workflow_item

  • **kwargs

Returns:

Raise:

TopLevelItem

abstract get_children(workflow_item: Any, **kwargs) → List[Any]

Returns the children of an workflow_item object

Parameters
  • workflow_item – WorkflowItem object

  • **kwargs – Optional arguments mainly for extensibility

Returns

Children of workflow_item object

to_entity(workflow_item: Any, **kwargs)idmtools.entities.iworkflow_item.IWorkflowItem

Converts the platform representation of workflow_item to idmtools representation

Parameters

workflow_item – Platform workflow_item object

Returns

IDMTools workflow_item object

abstract refresh_status(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **kwargs)

Refresh status for workflow item :param workflow_item: Item to refresh status for

Returns

None

abstract send_assets(workflow_item: Any, **kwargs)

Send assets for workflow item to platform

Parameters

workflow_item – Item to send assets for

Returns:

abstract get_assets(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, files: List[str], **kwargs) → Dict[str, bytearray]

Load assets for workflow item :param workflow_item: Item :param files: List of files to load :param **kwargs:

Returns

Dictionary with filename as key and value as binary content

abstract list_assets(workflow_item: idmtools.entities.iworkflow_item.IWorkflowItem, **kwargs) → List[idmtools.assets.asset.Asset]

List available assets for a workflow item

Parameters

workflow_item – workflow item to list files for

Returns

List of filenames