pudl.scripts.batch_config#
Generate a Google Batch Job configuration file.
This runs on bare GitHub Actions runners, without the full pixi/pudl environment – the
inline script metadata above lets uv run install just the handful of dependencies
this script actually needs (stdlib plus click) into an ephemeral environment, rather
than requiring a full pudl install first.
The --container-* flags are named after their equivalents in gcloud compute
instances update-container.
Attributes#
Functions#
|
Parse --container-env KEY=VALUE pairs into a dict. |
|
Return |
|
Munge arguments into a configuration dictionary. |
|
Generate a Batch configuration file. |
Module Contents#
- pudl.scripts.batch_config._parse_container_env(container_env: tuple[str, ...]) dict[str, str][source]#
Parse –container-env KEY=VALUE pairs into a dict.
Raises if the same key is given more than once.
- pudl.scripts.batch_config._lookup_machine_spec(machine_type: str) tuple[int, int][source]#
Return
(cpuMilli, memoryMib)for a real GCE machine type, viagcloud.Batch’s
computeResource.cpuMilli/memoryMibdefault to 2000/2000 (2 vCPU, 2 GB) if left unset – regardless of the machine type pinned inallocationPolicy. This looks up the real values and fills them in so the job doesn’t lie about the resources it has available.
- pudl.scripts.batch_config.to_config(*, container_image: str, container_env: tuple[str, ...], container_command: str, container_arg: tuple[str, ...], machine_type: str, cpu_milli: int, memory_mib: int, disk_gb: int, disk_type: str, batch_job_id: str, pipeline: str) dict[str, Any][source]#
Munge arguments into a configuration dictionary.