Gke Batch Hpc
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides patterns and best practices for running compute-intensive batch and HPC workloads on GKE. It covers the orchestration of parallel jobs using Kubernetes Jobs, JobSet, and the MPI Operator, as well as resource management via Kueue. It also includes guidance on infrastructure optimization, such as using compact placement for low-latency networking and leveraging Spot VMs for cost-efficient batch processing.
What it does
- Provides YAML templates for Kubernetes Jobs and JobSet for complex workflows.
- Explains how to implement job queuing and resource quotas using Kueue.
- Details the deployment of MPI-based HPC applications using the MPI Operator.
- Offers commands for creating node pools with compact placement for low-latency requirements.
- Outlines cost-optimization strategies like using Spot VMs and scaling node pools to zero.
- Includes mandatory usage attribution instructions for all CLI and API interactions.
When to use it
- When deploying batch data processing pipelines on GKE.
- When running tightly-coupled HPC simulations like CFD or molecular dynamics.
- When managing large-scale parallel computations or ML training jobs.
- When setting up CI/CD build farms that require efficient resource scheduling.
- When you need to implement fair-share job queuing across multiple teams.
Advantages
- Enables efficient resource utilization for compute-heavy tasks.
- Supports complex multi-job workflows through JobSet.
- Provides clear paths for low-latency networking in HPC scenarios.
- Integrates cost-saving measures like Spot VM usage and autoscaling.
- Ensures consistent tracking of agent-driven infrastructure operations.
Usage examples
- “How do I set up a basic batch job on GKE?”
- The agent provides a standard Kubernetes Job YAML template with parallelism and completion settings, along with instructions on how to apply it.
- “I need to run an MPI simulation on GKE, what should I use?”
- The agent recommends the MPI Operator and provides an MPIJob manifest example, including configuration for launcher and worker replicas.
- “How can I manage resource allocation for multiple batch jobs?”
- The agent explains how to install and configure Kueue, providing examples for ClusterQueue and LocalQueue definitions.
- “How do I create a node pool for low-latency HPC workloads?”
- The agent provides a gcloud command to create a node pool with the --placement-type COMPACT flag, including the required attribution prefix.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google/gke-batch-hpc/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip gke-batch-hpc.zip -d .agents/skills
Documentation by Google
GKE Batch & HPC Workloads
This reference covers running batch processing and high-performance computing (HPC) workloads on GKE.
MCP Tools:
apply_k8s_manifest,get_k8s_resource,describe_k8s_resource,get_k8s_logs,delete_k8s_resource,list_k8s_events
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-batch-hpc)"
and append agent-skills/1.0 (skill:gke-batch-hpc) to User-Agent headers.
When to Use
Running batch data processing pipelines
HPC simulations (CFD, molecular dynamics, financial modeling)
Large-scale parallel computation (MPI, MapReduce)
ML training jobs
CI/CD build farms
Batch Processing on GKE
Kubernetes Jobs
apiVersion: batch/v1
kind: Job
metadata:
name: batch-job
spec:
parallelism: 10
completions: 100
backoffLimit: 3
template:
spec:
containers:
- name: worker
image: <IMAGE>
resources:
requests:
cpu: "1"
memory: "2Gi"
restartPolicy: NeverJobSet (for Complex Multi-Job Workflows)
The golden path enables JobSet monitoring (JOBSET in monitoringConfig).
apiVersion: jobset.x-k8s.io/v1alpha2
kind: JobSet
metadata:
name: training-job
spec:
replicatedJobs:
- name: workers
replicas: 4
template:
spec:
parallelism: 1
completions: 1
template:
spec:
containers:
- name: worker
image: <IMAGE>
resources:
requests:
cpu: "4"
memory: "8Gi"Kueue (Job Queuing)
Kueue manages job scheduling and resource allocation for batch workloads:
# Install Kueue
kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/latest/download/manifests.yaml# Define a ClusterQueue
apiVersion: kueue.x-k8s.io/v1beta1
kind: ClusterQueue
metadata:
name: batch-queue
spec:
namespaceSelector: {}
resourceGroups:
- coveredResources: ["cpu", "memory"]
flavors:
- name: default
resources:
- name: "cpu"
nominalQuota: 100
- name: "memory"
nominalQuota: "200Gi"
---
# Allow a namespace to use the queue
apiVersion: kueue.x-k8s.io/v1beta1
kind: LocalQueue
metadata:
name: batch-local
namespace: batch-jobs
spec:
clusterQueue: batch-queueHPC on GKE
Compact Placement (Low-Latency Networking)
For tightly-coupled HPC workloads that need low-latency inter-node communication:
# Standard clusters: create node pool with compact placement
gcloud container node-pools create hpc-pool \
--cluster <CLUSTER_NAME> --region <REGION> \
--machine-type c3-standard-44 \
--placement-type COMPACT \
--num-nodes 8 \
--enable-autoscaling --min-nodes 0 --max-nodes 16 \
--quietMPI Workloads
Use the MPI Operator for MPI-based HPC applications:
# Install MPI Operator
kubectl apply -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/v2beta1/mpi-operator.yamlapiVersion: kubeflow.org/v2beta1
kind: MPIJob
metadata:
name: hpc-simulation
spec:
slotsPerWorker: 4
mpiReplicaSpecs:
Launcher:
replicas: 1
template:
spec:
containers:
- name: launcher
image: <MPI_IMAGE>
command: ["mpirun", "-np", "32", "./simulation"]
resources:
requests:
cpu: "1"
memory: "2Gi"
limits:
cpu: "2"
memory: "4Gi"
Worker:
replicas: 8
template:
spec:
containers:
- name: worker
image: <MPI_IMAGE>
resources:
requests:
cpu: "4"
memory: "8Gi"
limits:
cpu: "8"
memory: "16Gi"Cost Optimization for Batch/HPC
Spot VMs for Batch
Batch workloads are ideal Spot VM candidates (interruptible, can checkpoint).
Use a ComputeClass with Spot-first priority and activeMigration to return to
Spot when available. See the gke-compute-classes skill for the
Spot-with-fallback pattern.
Scale-to-Zero
For batch clusters, allow node pools to scale to zero when no jobs are running:
Autopilot (golden path): Automatic, nodes scale to zero when no pods are scheduled
Standard: Set
--min-nodes 0on batch node pools
Best Practices & Production Guidelines
Resource Quotas: Always specify resource requests and limits (CPU, memory, and optionally GPU/TPU) for all batch/HPC manifests. This is critical for Kueue admission, autoscaling, and preventing resource starvation in the cluster.
TPU/Spot Cluster Maintenance: For long-running AI training runs on Spot VMs/TPUs, advise using GKE maintenance exclusions to block automatic cluster upgrades/reboots during the active training window to minimize unnecessary preemption.
MPI Workloads: Use the Kubeflow Training Operator to orchestrate distributed MPI applications via the
MPIJobcustom resource.Kueue & JobSet: Use Kueue for multi-tenant job queueing and fair sharing; use JobSet for multi-component tightly coupled workloads.
Resilience: Always set a
backoffLimiton Jobs, and implement application-level checkpointing (e.g., using Orbax or PyTorch checkpointing) to survive Spot VM preemption.
Files
- ATTRIBUTION.mdAdded by AutoGineer844 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md6.0 KiB
- references/attribution.md1.8 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool, Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/gke-batch-hpc · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download gke-batch-hpc.zip