Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.py in 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_account and network_interface used to run the job.
      • Allocate a persistent disk for temp files.
      • Add dependency to other jobs (GCP Batch public preview feature).
  • 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 a and b and the second runnable python script takes arguments c and d. 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)
      

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gbatchkit-1.0a8.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gbatchkit-1.0a8-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file gbatchkit-1.0a8.tar.gz.

File metadata

  • Download URL: gbatchkit-1.0a8.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gbatchkit-1.0a8.tar.gz
Algorithm Hash digest
SHA256 b452edbf6327a96711834de60f6d935fd1c742da04a6480b035a62b789fb4514
MD5 894997625b17da03fbf4f18c126e96dd
BLAKE2b-256 8521dba07db469541821d1e126e45f5c37a1693813451921c687d1e95281698e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gbatchkit-1.0a8.tar.gz:

Publisher: publish.yml on rwc-io/gbatchkit-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gbatchkit-1.0a8-py3-none-any.whl.

File metadata

  • Download URL: gbatchkit-1.0a8-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gbatchkit-1.0a8-py3-none-any.whl
Algorithm Hash digest
SHA256 eb6747affd3894267c8c27e0540783de0da40fae7dad5ae1e3641d812bfa7d8c
MD5 5442aef773d8c543dac39a515edf8771
BLAKE2b-256 078c00f95881c6f04dfb2180b2eb8b110da1bb00bcd826c65f73bfa16057da19

See more details on using hashes here.

Provenance

The following attestation bundles were made for gbatchkit-1.0a8-py3-none-any.whl:

Publisher: publish.yml on rwc-io/gbatchkit-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0a8 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page