panda_client

Panda API client for interacting with the Panda task management system.

Module Contents

Classes

PandaClient

A class to interact with the Panda API.

class panda_client.PandaClient

A class to interact with the Panda API.

SINGULARITY_JOB_TEMPLATE = "{singularity_job_entrypoint} {container_image} bash -c '{script}'"
logger
static add_to_job_definition(job_definition, *items, condition=True)

Append items to the job definition list.

static build_container_image(container_image)

Builds the container image from the workstep.

static build_cpu_required(cpu_cores)

Builds the CPU cores required string from the number of CPU cores. :param cpu_cores: :return: Number of CPU cores required, defaulting to 1 if not provided.

async static build_job_definition(workstep, metadata)

Build a Panda job definition from job parameters.

static build_jobs_count(provenance_json)

Builds the number of jobs from the provenance JSON.

static build_memory_required(memory_gb)

Builds the memory required string from the memory in GB. :param memory_gb: :return: Memory required in MB, rounded up to the nearest integer.

static build_no_build(provenance_json)

Builds the no_build flag from the provenance JSON.

static build_no_separate_log(provenance_json)

Builds the no_separate_log flag from the provenance JSON.

static build_out_ds(user)

Builds the output dataset path using the user name and a random identifier.

static build_panda_job_script(workstep)

Builds the complete script to be executed by combining the entrypoint and parameters.

static build_prod_source_label(provenance_json)

Builds the production source label from the provenance JSON.

static build_queue_name(metadata)

Builds the queue name from the metadata.

static build_vo(provenance_json)

Builds the VO (Virtual Organization) from the provenance JSON.

static build_working_group(provenance_json)

Builds the working group from the provenance JSON.

async get_task(jedi_task_id)

Retrieve a task by its Jedi Task ID.

static is_a_singularity_pilot(workstep)

Determines if the job is a Singularity pilot based on the workstep.

static is_container_image_required(workstep)

Determines if a container image is required for the job based on the workstep.

async static populate_workstep_with_panda_details(workstep, parameters)

Populate workstep dictionary with Panda job details.

async submit_task(job_definition, console_log=True)

Submit a task to the Panda API.

async test_connection()

Test connection to the Panda API.

async static total_cpu(parameters)

Calculate total CPU cores used by a list of worksteps.

async static total_memory(parameters)

Calculate total memory used by a list of worksteps.