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.0a9.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.0a9-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gbatchkit-1.0a9.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.0a9.tar.gz
Algorithm Hash digest
SHA256 3ebcc4b1b9e424f4060214c507a58ef5225260f7d4a574120f6b5f19149677b0
MD5 598a08207650ea382a1d8572395ba410
BLAKE2b-256 c66738ae3853cf0c2067250db38f94f9a92e6468a1b680e5e126cdcb25c0c18d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gbatchkit-1.0a9-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.0a9-py3-none-any.whl
Algorithm Hash digest
SHA256 9c2ef0d262d3f2c820e2aaeb6f68bdcb4f7b3d4f005d25bb4594ac5855d0940a
MD5 aaa60ad182103946d1d171b4a97e2aa3
BLAKE2b-256 3f4bb115b6f6e75cdb6d37aee873d76b6883e3069ef0d0bc99f9da4480dde16c

See more details on using hashes here.

Provenance

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