tardis.adapters.batchsystems.htcondor module
- class tardis.adapters.batchsystems.htcondor.HTCondorAdapter[source]
Bases:
BatchSystemAdapterHTCondorAdapterimplements the TARDIS interface to dynamically integrate and manage opportunistic resources with the HTCondor Batch System.- async disintegrate_machine(drone_uuid: str) None[source]
HTCondor does not require any specific disintegration procedure.
- Parameters
drone_uuid – Uuid of the worker node, for some sites corresponding to the host name of the drone.
- async drain_machine(drone_uuid: str) None[source]
Drain a machine in the HTCondor batch system, which means that no new jobs will be accepted
- Parameters
drone_uuid – Uuid of the worker node, for some sites corresponding to the host name of the drone.
- async get_allocation(drone_uuid: str) float[source]
Get the allocation of a worker node in HTCondor, which is defined as maximum of the ratios of requested over total resources (CPU, Memory, Disk, etc.).
- Parameters
drone_uuid – Uuid of the worker node, for some sites corresponding to the host name of the drone.
- Returns
The allocation of a worker node as described above.
- async get_machine_status(drone_uuid: str) MachineStatus[source]
Get the status of a worker node in HTCondor (Available, Draining, Drained, NotAvailable)
- Parameters
drone_uuid – Uuid of the worker node, for some sites corresponding to the host name of the drone.
- Returns
The machine status in HTCondor (Available, Draining, Drained, NotAvailable)
- async get_resource_ratios(drone_uuid: str) Iterable[float][source]
Get the ratio of requested over total resources (CPU, Memory, Disk, etc.) for a worker node in HTCondor according to the HTCondor expressions defined in the adapter configuration.
- Parameters
drone_uuid – Uuid of the worker node, for some sites corresponding to the host name of the drone.
- Returns
Iterable of float containing the ratios
- async get_utilisation(drone_uuid: str) float[source]
Get the utilisation of a worker node in HTCondor, which is defined as minimum of the ratios of requested over total resources (CPU, Memory, Disk, etc.).
- Parameters
drone_uuid – Uuid of the worker node, for some sites corresponding to the host name of the drone.
- Returns
The utilisation of a worker node as described above.
- async integrate_machine(drone_uuid: str) None[source]
HTCondor does not require any specific integration procedure
- Parameters
drone_uuid – Uuid of the worker node, for some sites corresponding to the host name of the drone.
- property machine_meta_data_translation_mapping: AttributeDict
The machine metadata translation mapping is used to translate units of the machine metadata in
TARDISto values expected by the HTCondor batch system adapter.- Returns
Machine metadata translation mapping
- async tardis.adapters.batchsystems.htcondor.htcondor_get_collector_start_dates(options: AttributeDict, executor: Executor) dict[str, datetime.datetime][source]
Asynchronously retrieve the master daemon start times from HTCondor for machines running a collector daemon as well. Assuming both daemons have a similar start date. Due to potential bug/feature in HTCondor, the DaemonStartTime of the Collector can not be used directly. (see https://www-auth.cs.wisc.edu/lists/htcondor-users/2025-July/msg00092.shtml)
Runs
condor_status -master -af:t Machine DaemonStartTime(plus any additional formatted options) using the provided executor, and parses the tab-delimited output into a dictionary.- Parameters
options – Additional options for the
condor_statuscall, such as{'pool': 'htcondor.example'}, which will be formatted and appended to the command.executor – Executor used to run the
condor_statuscommand asynchronously.
- Returns
Returns a dictionary mapping hostnames to master daemon start times (as datetime objects) for hosts that are also running a collector.
- async tardis.adapters.batchsystems.htcondor.htcondor_get_collectors(options: AttributeDict, executor: Executor) list[str][source]
Asynchronously retrieve a list of HTCondor collector machine names.
Runs
condor_status -collector -af:t Machine(plus any additional formatted options) using the provided executor, then parses the tab-delimited output to extract and return the list of collector machine names.- Parameters
options – Additional options for the
condor_statuscall, such as{'pool': 'htcondor.example'}, which will be formatted and appended to the command.executor – Executor used to run the
condor_statuscommand asynchronously.
- Returns
List of collector machine names.
- async tardis.adapters.batchsystems.htcondor.htcondor_status_updater(options: AttributeDict, attributes: AttributeDict, executor: Executor, cached_data: mappingproxy) dict[source]
Helper function to call
condor_status -afasynchronously and to translate the output into a dictionary.If the HTCondor Collector has been running for less than 3600 seconds, previously cached status data is used for machines that were already available before the restart; otherwise, fresh status data is used.
- Parameters
options – Additional options for the condor_status call. For example
{'pool': 'htcondor.example'}will be translated intocondor_status -af ... -pool htcondor.exampleattributes – Additional fields to add to output of the
condor_status -afresponse.executor – Executor to run the
condor_statuscommand asynchronously.ro_cached_data – Cached output from previous
condor_status -afcall
- Returns
Dictionary containing the processed output of the
condor_statuscommand, possibly merged with cached data depending on collector uptime.