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.0a7.tar.gz (10.4 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.0a7-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gbatchkit-1.0a7.tar.gz
Algorithm Hash digest
SHA256 fb47b8789ba56b18e400317f9c0226e0cb857645daac0aede1aa5e40c5640de2
MD5 cd5734b34825580a5a14c4a0196313a6
BLAKE2b-256 1392fa362e601a3ad8cf38362192cb41ed06982cfd0258a9693c707701301d48

See more details on using hashes here.

Provenance

The following attestation bundles were made for gbatchkit-1.0a7.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.0a7-py3-none-any.whl.

File metadata

  • Download URL: gbatchkit-1.0a7-py3-none-any.whl
  • Upload date:
  • Size: 9.8 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.0a7-py3-none-any.whl
Algorithm Hash digest
SHA256 ed4d9ba35e9aaff7cb58976a615488c90787159b7c1846567d98ca57f3e4b012
MD5 0bd3ea5ae484dff25fd048d51511c1e9
BLAKE2b-256 6f4b55a3d08d87d5dfd06da63605ad2510985cacb6917bad8f9ae093627a055a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gbatchkit-1.0a7-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.0a7 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