{"id":24649079,"url":"https://github.com/ow2-proactive/proactive-python-client-codebase","last_synced_at":"2025-06-23T17:04:38.846Z","repository":{"id":229016724,"uuid":"775538988","full_name":"ow2-proactive/proactive-python-client-codebase","owner":"ow2-proactive","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-15T15:31:42.000Z","size":264,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-25T17:15:33.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ow2-proactive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-21T15:20:47.000Z","updated_at":"2024-10-15T15:31:47.000Z","dependencies_parsed_at":"2024-03-21T16:47:03.882Z","dependency_job_id":"2044034a-c2d6-4f77-8397-0b25ffc6d996","html_url":"https://github.com/ow2-proactive/proactive-python-client-codebase","commit_stats":null,"previous_names":["ow2-proactive/proactive-python-client-codebase"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fproactive-python-client-codebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fproactive-python-client-codebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fproactive-python-client-codebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ow2-proactive%2Fproactive-python-client-codebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ow2-proactive","download_url":"https://codeload.github.com/ow2-proactive/proactive-python-client-codebase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244675506,"owners_count":20491824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-25T17:15:43.123Z","updated_at":"2025-03-20T18:47:44.979Z","avatar_url":"https://github.com/ow2-proactive.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProActive Python Client Codebase\n\nThis repository hosts the ProActive Python Client and its examples, enabling seamless interaction with the ProActive Scheduler and Resource Manager for automating workflow submission and management tasks directly from Python scripts.\n\n## Repository Structure\n\n- **`proactive-python-client`**: Contains the source code for the ProActive Python Client (SDK), facilitating the integration with the ProActive Scheduler. This SDK allows you to connect, submit jobs, manage tasks, and handle data spaces directly through Python.\n- **`proactive-python-client-examples`**: A collection of examples demonstrating various features and capabilities of the ProActive Python Client. These examples serve as a practical guide to get started with the SDK.\n\n## Getting Started\n\n### Prerequisites\n\n- Python version 3.5 or later.\n- Java 8 or 11.\n- Access to a ProActive Scheduler instance.\n\n### Installation\n\nYou can install the ProActive Python Client directly from PyPI using pip:\n\n```bash\npip install --upgrade proactive\n```\n\nFor the latest features and bug fixes, you can also install directly from this repository:\n\n```bash\npip install --upgrade --pre proactive\n```\n\n### Creating a Job with the Proactive Python SDK\n\nThe Proactive Python SDK provides a convenient way to create and submit jobs to the ProActive Scheduler. Here's a step-by-step guide:\n\n#### 1. Import the SDK\n\n```python\nfrom proactive import getProActiveGateway\n```\n\n#### 2. Connect to the ProActive Server\n\n```python\ngateway = getProActiveGateway()\n```\n\nThis function automatically looks for a `.env` file with your ProActive credentials. If it doesn't exist, it will prompt you to enter the server URL, username, and password.\n\n#### 3. Create a Job\n\n```python\njob = gateway.createJob(\"MyJobName\")\n```\n\nReplace \"MyJobName\" with the desired name for your job.\n\n#### 4. Add Tasks to the Job\n\nYou can add various types of tasks to your job using the gateway.createTask or gateway.createPythonTask methods. Here's an example of adding a Python task:\n\n```python\ntask = gateway.createPythonTask(\"MyTaskName\")\ntask.setTaskImplementation(\"print('Hello from ProActive!')\")\njob.addTask(task)\n```\n\n#### 5. (Optional) Configure Additional Settings\n\n- Variables: You can add job-level or task-level variables using `job.addVariable` and `task.addVariable`.\n- Dependencies: Set dependencies between tasks using `task.addDependency`.\n- Fork Environment: Configure the execution environment using `task.setForkEnvironment`.\n- Selection Script: Control where the task runs using `task.setSelectionScript`.\n- Pre or Post scripts: Add scripts that will run before and after the task execution using `task.setPreScript` or `task.setPostScript`.\n\n#### 6. Submit the Job\n\n```python\njob_id = gateway.submitJob(job)\n```\n\nThis submits the job to the ProActive Scheduler and returns the job ID for tracking.\n\n#### 7. Monitor and Retrieve Results\n\nYou can monitor the job status using `gateway.getJobStatus(job_id)` and retrieve the job output using `gateway.getJobOutput(job_id)`.\n\n#### 8. Close the Connection\n\n```python\ngateway.close()\n```\n\nThis disconnects from the ProActive server and cleans up resources.\n\nRemember to replace the placeholders with your actual job and task names, and customize the task implementation with your desired Python code.\n\nFor more detailed examples and advanced features, refer to the Proactive Python Client documentation and the examples repository mentioned in the provided text.\n\n## Quick Start Example\n\nConnecting to a ProActive Scheduler and submitting a simple job:\n\n```python\nfrom proactive import ProActiveGateway\n\ngateway = ProActiveGateway('https://try.activeeon.com:8443')\ngateway.connect(username='admin', password='admin')\n\n# Creating a ProActive job\njob = gateway.createJob()\njob.setJobName(\"SimpleJob\")\n\n# Creating a Python task\ntask = gateway.createPythonTask()\ntask.setTaskName(\"SimpleTask\")\ntask.setTaskImplementation(\"\"\"\nprint('Hello from ProActive!')\n\"\"\")\n\n# Adding the task to the job and submitting the job\njob.addTask(task)\njobId = gateway.submitJob(job)\nprint(f\"Job submitted with id {jobId}\")\n\n# Disconnecting\ngateway.close()\n```\n\n## Documentation\n\nFor full documentation of the ProActive Python Client, visit [our documentation site](https://proactive-python-client.readthedocs.io).\n\n## Examples\n\nFor detailed examples, check the `proactive-python-client-examples` directory. Each example demonstrates different features and use cases of the ProActive Python Client.\n\n## Contributing\n\nContributions to both the SDK and the examples are welcome. Please refer to the README files in the respective directories for more information on contributing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fow2-proactive%2Fproactive-python-client-codebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fow2-proactive%2Fproactive-python-client-codebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fow2-proactive%2Fproactive-python-client-codebase/lists"}