:py:mod:`panda_client` ====================== .. py:module:: panda_client .. autoapi-nested-parse:: Panda API client for interacting with the Panda task management system. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: panda_client.PandaClient .. py:class:: PandaClient A class to interact with the Panda API. .. py:attribute:: SINGULARITY_JOB_TEMPLATE :value: "{singularity_job_entrypoint} {container_image} bash -c '{script}'" .. py:attribute:: logger .. py:method:: add_to_job_definition(job_definition, *items, condition = True) :staticmethod: Append items to the job definition list. .. py:method:: build_container_image(container_image) :staticmethod: Builds the container image from the workstep. .. py:method:: build_cpu_required(cpu_cores) :staticmethod: 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. .. py:method:: build_job_definition(workstep, metadata) :staticmethod: :async: Build a Panda job definition from job parameters. .. py:method:: build_jobs_count(provenance_json) :staticmethod: Builds the number of jobs from the provenance JSON. .. py:method:: build_memory_required(memory_gb) :staticmethod: Builds the memory required string from the memory in GB. :param memory_gb: :return: Memory required in MB, rounded up to the nearest integer. .. py:method:: build_no_build(provenance_json) :staticmethod: Builds the no_build flag from the provenance JSON. .. py:method:: build_no_separate_log(provenance_json) :staticmethod: Builds the no_separate_log flag from the provenance JSON. .. py:method:: build_out_ds(user) :staticmethod: Builds the output dataset path using the user name and a random identifier. .. py:method:: build_panda_job_script(workstep) :staticmethod: Builds the complete script to be executed by combining the entrypoint and parameters. .. py:method:: build_prod_source_label(provenance_json) :staticmethod: Builds the production source label from the provenance JSON. .. py:method:: build_queue_name(metadata) :staticmethod: Builds the queue name from the metadata. .. py:method:: build_vo(provenance_json) :staticmethod: Builds the VO (Virtual Organization) from the provenance JSON. .. py:method:: build_working_group(provenance_json) :staticmethod: Builds the working group from the provenance JSON. .. py:method:: get_task(jedi_task_id) :async: Retrieve a task by its Jedi Task ID. .. py:method:: is_a_singularity_pilot(workstep) :staticmethod: Determines if the job is a Singularity pilot based on the workstep. .. py:method:: is_container_image_required(workstep) :staticmethod: Determines if a container image is required for the job based on the workstep. .. py:method:: populate_workstep_with_panda_details(workstep, parameters) :staticmethod: :async: Populate workstep dictionary with Panda job details. .. py:method:: submit_task(job_definition, console_log = True) :async: Submit a task to the Panda API. .. py:method:: test_connection() :async: Test connection to the Panda API. .. py:method:: total_cpu(parameters) :staticmethod: :async: Calculate total CPU cores used by a list of worksteps. .. py:method:: total_memory(parameters) :staticmethod: :async: Calculate total memory used by a list of worksteps.