ProActive scheduler client module
Project description
ProActive Python Client
The ProActive Python Client enables seamless interaction with the ProActive Scheduler and Resource Manager, facilitating the automation of workflow submission and management tasks directly from Python.
Key Features
- Ease of Use: Simple API for interacting with the ProActive Scheduler.
- Workflow Management: Submit, monitor, and manage your ProActive workflows.
- Resource Management: Leverage the Resource Manager for efficient computing resource allocation.
Getting Started
Prerequisites
- Python version 3.5 or later is required.
- Java 8 SDK
Installation
You can easily install the ProActive Python Client using pip:
pip install --upgrade proactive
For access to the latest features and improvements, install the pre-release version:
pip install --upgrade --pre proactive
Building from Source
Linux or Mac
To build and install the package from source:
# Build the package
make clean_build
# or use gradlew
gradlew clean build
# Install the built package
pip install dist/proactive-XXX.zip # Replace XXX with the actual version
Windows
REM Build the package
build.bat CLEAN_BUILD
REM Install the built package
REM Replace XXX with the actual version
pip install dist\proactive-XXX.zip
Running Tests
With Gradle
Specify your ProActive credentials and run the tests:
./gradlew clean build -Pproactive_url=YOUR_URL -Pusername=YOUR_USERNAME -Ppassword=YOUR_PASSWORD
With Make
First, create a .env
file with your ProActive credentials:
PROACTIVE_URL=YOUR_URL
PROACTIVE_USERNAME=YOUR_USERNAME
PROACTIVE_PASSWORD=YOUR_PASSWORD
Then execute:
make test
Quickstart Example
This simple example demonstrates connecting to a ProActive server, creating a job, adding a Python task, and submitting the job:
import os
import getpass
from proactive import ProActiveGateway
proactive_url = "https://try.activeeon.com:8443"
print(f"Connecting to {proactive_url}...")
gateway = ProActiveGateway(proactive_url)
# Securely input your credentials
gateway.connect(username=input("Username: "), password=getpass.getpass("Password: "))
assert gateway.isConnected(), "Failed to connect to the ProActive server!"
# Job and task creation
print("Creating and configuring a ProActive job and task...")
proactive_job = gateway.createJob()
proactive_job.setJobName("SimpleJob")
proactive_task = gateway.createPythonTask("SimplePythonTask")
proactive_task.setTaskImplementation('print("Hello from ProActive!")')
proactive_task.addGenericInformation("PYTHON_COMMAND", "python3")
proactive_job.addTask(proactive_task)
# Job submission
job_id = gateway.submitJob(proactive_job)
print(f"Job submitted with ID: {job_id}")
# Retrieve job output
print("Job output:")
print(gateway.getJobOutput(job_id))
# Cleanup
gateway.disconnect()
gateway.terminate()
print("Disconnected and finished.")
Documentation
For more detailed usage and advanced functionalities, please refer to the ProActive Python Client Documentation.
Examples Repository
For practical examples showcasing various features of the ProActive Python Client, visit our examples repository.
Contributing
Contributions are welcome! If you have an improvement or a new feature in mind, feel free to fork the repository, make your changes, and submit a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file proactive-13.1.0.2403111725.dev0.zip
.
File metadata
- Download URL: proactive-13.1.0.2403111725.dev0.zip
- Upload date:
- Size: 23.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0175575a82020ca9f2165681b7f630585d4f4e9c6b1b5c94040666b1804936bb |
|
MD5 | 1a8bcd1f1b851f6d3ac473deed475092 |
|
BLAKE2b-256 | d9104e86372955f7b0837496ab4b3f5227a600da00b8cee1a12d9b28f46c145d |