Toolkit for running Google Cloud Batch jobs
Project description
gbatchkit-python
Google Cloud Platform Batch Kit (GBK)
Why GBatchKit?
GCP Batch is a powerful serverless computing platform. gbatchkit provides lightweight tools to use Batch more effectively.
Key features:
-
Create a straightforward job easily. This will run
my-script.pyin the given container on Batch.container_uri = "container_uri" runnable = ContainerRunnable( image_uri=container_uri, entrypoint="python", commands=["my-script.py"] ) task_count = 1 job = create_standard_job(region, compute_config, task_count, [runnable]) submit_job(job, "my_unique_job_id", region)
- Also supports:
- Customize the
service_accountandnetwork_interfaceused to run the job. - Allocate a persistent disk for temp files.
- Add dependency to other jobs (GCP Batch public preview feature).
- Customize the
- Also supports:
-
Create multi-task jobs (for one or multiple runnables).
- Uses Google Cloud Storage to store task arguments.
task_arguments = [{"a": 1, "b": 2}, {"a": 3, "b": 4}] job = create_standard_job(region, compute_config, len(task_arguments), runnable) working_directory = "gs://a-bucket/a-directory/jobs" prepare_multitask_job(job, working_directory, tasks=task_arguments) submit_job(job, "my_unique_job_id", region)
-
Supports different arguments per runnable. In this example, the 1st runnable python script takes arguments
aandband the second runnable python script takes argumentscandd. Note that Batch requires all runnables to have the same number of tasks.container_uri = "container_uri" runnable1 = ContainerRunnable( image_uri=container_uri, entrypoint="python", commands=["script1.py"] ) runnable2 = ContainerRunnable( image_uri=container_uri, entrypoint="python", commands=["script2.py"] ) task_arguments = [ [{"a": 1, "b": 2}, {"a": 3, "b": 4}], [{"c": 1, "d": 2}, {"c": 3, "d": 4}], ] job = create_standard_job(region, compute_config, task_count=2, runnables=[runnable1, runnable2]) working_directory = "gs://a-bucket/a-directory/jobs" prepare_multitask_job(job, working_directory, tasks=task_arguments) submit_job(job, "my_unique_job_id", region)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gbatchkit-1.0a6.tar.gz.
File metadata
- Download URL: gbatchkit-1.0a6.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ca5e7d4033fdc04f7c97f84e1616feb6265dc00d053ffe695ad877a374968ea
|
|
| MD5 |
096512179a50b9c3840bc98bbfb8d6ab
|
|
| BLAKE2b-256 |
a436a312c4a8fde85d60c9d6b4508dddc5713a2d4c422418d60af4dc769d1767
|
File details
Details for the file gbatchkit-1.0a6-py3-none-any.whl.
File metadata
- Download URL: gbatchkit-1.0a6-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d465a985364e0c6c2ae99cd7e3c27359b1872d5e94b400c1c4a3edef4295af4c
|
|
| MD5 |
08bee41dbeef91d934b9d87946a8a8d2
|
|
| BLAKE2b-256 |
eb77eb97bfb9826447572d8831c20462117190a3b904aaddd901b2639aab3fa6
|