proactive package

Submodules

proactive.ProactiveBuilder module

class proactive.ProactiveBuilder.ProactiveBuilder(proactive_factory=None)

Bases: object

Represent a generic builder

  • proactive_factory (ProactiveFactory)

getProactiveFactory()

Get the used Proactive factory

Returns

A ProactiveFactory object

setProactiveFactory(proactive_factory)

Set the Proactive factory

Parameters

proactive_factory – A valid ProactiveFactory object

class proactive.ProactiveBuilder.ProactiveJobBuilder(proactive_factory, proactive_job_model=None, debug=False, log4py_props_file=None)

Bases: proactive.ProactiveBuilder.ProactiveBuilder

Represent a proactive job builder

  • proactive_factory (ProactiveFactory)

  • proactive_job (ProactiveJob)

  • job (org.ow2.proactive.scheduler.common.job.TaskFlowJob)

create()

Create the Proactive java job

Returns

self

getProactiveFactory()

Get the used Proactive factory

Returns

A ProactiveFactory object

getProactiveJob()

Get the Proactive java job

Returns

The Proactive java job object

getProactiveJobModel()

Get the Proactive job model

Returns

The Proactive Python job model

setProactiveFactory(proactive_factory)

Set the Proactive factory

Parameters

proactive_factory – A valid ProactiveFactory object

setProactiveJobModel(proactive_job)

Set the Proactive Python job model

Parameters

proactive_job – A valid job model

class proactive.ProactiveBuilder.ProactiveTaskBuilder(proactive_factory, proactive_task_model=None, debug=False, log4py_props_file=None)

Bases: proactive.ProactiveBuilder.ProactiveBuilder

Represent a proactive task builder

  • proactive_task (ProactiveTask)

  • script (jvm.org.ow2.proactive.scripting.SimpleScript)

  • task_script (jvm.org.ow2.proactive.scripting.TaskScript)

  • script_task (jvm.org.ow2.proactive.scheduler.common.task.ScriptTask)

create()

Create a Proactive java task

Returns

The Proactive java task object

getProactiveTaskModel()

Get the Proactive task model

Returns

The Proactive Python task model

setProactiveTaskModel(proactive_task_model)

Set the Proactive Python task model

Parameters

proactive_job – A valid task model

proactive.ProactiveFactory module

class proactive.ProactiveFactory.ProactiveFactory(runtime_gateway=None)

Bases: object

https://www.activeeon.com/public_content/documentation/javadoc/latest/index.html

create_connection_info(url, username, password, credentials_file, insecure)

Create a ProActive connection info https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/authentication/ConnectionInfo.html

Parameters
  • url – The ProActive server URL

  • username – A valid username

  • password – A valid password

  • credentials_file – A credentials file path

  • insecure – If set True, the connection is set to the insecure mode

Returns

A ConnectionInfo object

create_flow_script(script)

Create a ProActive flow script https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/task/flow/FlowScript.html

Parameters

script – A valid flow action

Returns

A FlowScript object

create_fork_environment()

Create a ProActive fork environment https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/task/ForkEnvironment.html

Returns

A ForkEnvironment object

create_job()

Create a ProActive job https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/job/TaskFlowJob.html

Returns

A TaskFlowJob object

create_job2xml_transformer()

Create a ProActive job to XML transformer https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/job/factories/Job2XMLTransformer.html

Returns

A Job2XMLTransformer object

create_job_variable()

Create a ProActive job variable https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/job/JobVariable.html

Returns

A JobVariable object

create_script_task()

Create a ProActive script task https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/task/ScriptTask.html

Returns

A ScriptTask object

create_selection_script(script_code, script_language, is_dynamic)

Create a ProActive selection script https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scripting/SelectionScript.html

Parameters
  • script_code – The selection script implementation

  • script_language – The selection script language

  • is_dynamic – If set True, the selection script will be set as dynamic

Returns

A SelectionScript object

create_simple_script(script_code, script_language)

Create a ProActive simple script https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scripting/SimpleScript.html

Parameters
  • script_code – The script implementation

  • script_language – The script language

Returns

A SimpleScript object

create_smart_proxy()

Create a ProActive smart proxy https://doc.activeeon.com/javadoc/latest/org/ow2/proactive_grid_cloud_portal/smartproxy/RestSmartProxyImpl.html

Returns

A RestSmartProxyImpl object

create_task_script(simple_script)

Create a ProActive task script https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scripting/TaskScript.html

Parameters

simple_script – A valid simple script

Returns

A TaskScript object

create_task_variable()

Create a task variable https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/task/TaskVariable.html

Returns

A TaskVariable object

getRuntimeGateway()

Get the java runtime gateway

Returns

The java runtime gateway

get_flow_block()

Get the ProActive flow block Class https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/task/flow/FlowBlock.html

Returns

The FlowBlock Class

get_flow_script()

Get the ProActive flow script Class https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/task/flow/FlowScript.html

Returns

The FlowScript Class

get_input_access_mode()

Get the ProActive input access mode Class https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/task/dataspaces/InputAccessMode.html

Returns

The InputAccessMode Class

get_output_access_mode()

Get the ProActive output access mode Class https://www.activeeon.com/public_content/documentation/javadoc/latest/org/ow2/proactive/scheduler/common/task/dataspaces/OutputAccessMode.html

Returns

The OutputAccessMode Class

setRuntimeGateway(runtime_gateway=None)

Set the Proactive java runtime gateway

Parameters

runtime_gateway – A valid java runtime gateway

proactive.ProactiveGateway module

class proactive.ProactiveGateway.ProActiveGateway(base_url, debug=False, javaopts=[], log4j_props_file=None, log4py_props_file=None)

Bases: object

Simple client for the ProActive scheduler REST API See also https://try.activeeon.com/doc/rest/

buildJob(job_model, debug=False)

Build the Proactive job to be submitted to the scheduler

Parameters
  • job_model – A valid job model

  • debug – If set True, the submitted job will be printed for a debugging purpose

Returns

A Proactive job ready to be submitted

connect(username=None, password=None, credentials_path=None, insecure=True)

Connect to a Proative server

Parameters
  • username – A valid username

  • password – A valid password

  • credentials_path – A credentials file path

  • insecure – If set True, the gateway will connect in insecure mode

createBranchFlowScript(script_implementation, target_if, target_else, target_continuation, script_language='javascript')

Create a branch flow script

Parameters
  • script_implementation – The script implementation

  • target_if – The if target task

  • target_else – The else target task

  • target_continuation – The continuationn target task

  • script_language – The script language

Returns

A branch ProactiveFlowScript object

createDefaultForkEnvironment()

Create a default fork environment

Returns

A default ProactiveForkEnv object

createDefaultSelectionScript()

Create a default selection script

Returns

A default ProactiveSelectionScript object

createFlowScript(script_language=None)

Create a flow script

Parameters

script_language – The script language

Returns

A ProactiveFlowScript object

createForkEnvironment(language=None)

Create a Proactive fork environment

Parameters

language – The script language

Returns

A ProactiveForkEnv object

createJob()

Create a Proactive Job

Returns

A ProactiveJob object

createLoopFlowScript(script_implementation, target, script_language='javascript')

Create a loop flow script

Parameters
  • script_implementation – The script implementation

  • target – The loop target

  • script_language – The script language

Returns

A loop ProactiveFlowScript object

createPostScript(language=None)

Create a Proactive post-script

Parameters

language – The script language

Returns

A ProactivePostScript object

createPreScript(language=None)

Create a Proactive pre-script

Parameters

language – The script language

Returns

A ProactivePreScript object

createPythonForkEnvironment()

Create a Python fork environment

Returns

A Python ProactiveForkEnv object

createPythonSelectionScript()

Create a Python selection script

Returns

A Python ProactiveSelectionScript object

createPythonTask()

Create a workflow Python task

Returns

A Python ProactiveTask object

createReplicateFlowScript(script_implementation, script_language='javascript')

Create a replicate flow script

Parameters
  • script_implementation – The script implementation

  • script_language – The script language

Returns

A replicate ProactiveFlowScript object

createSelectionScript(language=None)

Create a Proactive selection script

Parameters

language – The script language

Returns

A ProactiveSelectionScript object

createTask(language=None)

Create a workflow task

Parameters

language – The script language

Returns

A ProactiveTask object

disconnect()

Disconnect the gateway from the ProActive server

exportJob2XML(job_model, debug=False)

Export the job to an XML file

Parameters
  • job_model – A valid job model

  • debug – If set True, the created job will be printed for a debugging purpose

Returns

The created job as an XML script

getAllJobs(max_number_of_jobs=1000)

Get all jobs from the ProActive scheduler

Parameters

max_number_of_jobs – The maximal number of retrieved jobs

Returns

A list of jobs

getJobInfo(job_id)

Get the job info

Parameters

job_id – A valid job ID

Returns

The job info

getJobResult(job_id, timeout=60000)

Get the job result

Parameters
  • job_id – A valid job ID

  • timeout – A timeout in milliseconds

Returns

The job results

getJobState(job_id)

Get the job state

Parameters

job_id – A valid job ID

Returns

The job state

getProactiveClient()

Get the Proactive gateway

Returns

A smart proxy object

getProactiveFlowBlockType()

Get the Proactive flow block

Returns

The ProactiveFlowBlock object

getProactiveScriptLanguage()

Get Proactive script languages

Returns

The ProactiveScriptLanguage object

getTaskResult(job_id, task_name, timeout=60000)

Get the task result

Parameters
  • job_id – A valid job ID

  • task_name – A valid task name

  • timeout – A timeout in milliseconds

Returns

The task results

isConnected()

Verify if the gateway is connected to the ProActive server

Returns

True or False

isJobFinished(job_id)

Verify if a job is finished

Parameters

job_id – A valid job ID

Returns

True or False

printJobOutput(job_id, timeout=60000)

Get the job output

Parameters
  • job_id – A valid job ID

  • timeout – A timeout in milliseconds

Returns

The job outputs

printTaskOutput(job_id, task_name, timeout=60000)

Get the task outputs

Parameters
  • job_id – A valid job ID

  • task_name – A valid task name

  • timeout – A timeout in milliseconds

Returns

The task outputs

reconnect()

Reconnect the gateway to the ProActive server

saveJob2XML(job_model, xml_file_path, debug=False)

Save a job to an external XML file

Parameters
  • job_model – A valid job model

  • xml_file_path – A valid XML file path

  • debug – If set True, the created job will be printed for a debugging purpose

submitJob(job_model, debug=False)

Submit a job to the Proactive Scheduler

Parameters
  • job_model – A valid job model

  • debug – If set True, the submitted job will be printed for a debugging purpose

Returns

The submitted job ID

submitJobWithInputsAndOutputsPaths(job_model, input_folder_path='.', output_folder_path='.', debug=False)

Submit a job to the Proactive Scheduler with input and output paths

Parameters
  • job_model – A valid job model

  • input_folder_path – Path to the directory containing input files

  • output_folder_path – Path to the local directory which will contain output files

  • debug – If set True, the submitted job will be printed for a debugging purpose

Returns

The submitted job ID

submitWorkflowFromCatalog(bucket_name, workflow_name, workflow_variables={})

Submit a job from the catalog to the scheduler

Parameters
  • bucket_name – The bucket in which the workflow is saved

  • workflow_name – The workflow name

  • workflow_variables – The workflow input variables

Returns

The submitted job id

submitWorkflowFromFile(workflow_xml_file_path, workflow_variables={})

Submit a job from an xml file to the scheduler

Parameters
  • workflow_xml_file_path – The workflow xml file path

  • workflow_variables – The workflow input variables

Returns

The submitted job id

submitWorkflowFromURL(workflow_url_spec, workflow_variables={})

Submit a job from an url to the scheduler

Parameters
  • workflow_url_spec – The workflow url

  • workflow_variables – The workflow input variables

Returns

The submitted job id

terminate()

Terminate the connection

Module contents