Skip to main content

Plugin for Airflow to connect to slurm clusters

Project description

PyPI PyPI - Downloads

Slurm Executor

The Slurm executor is based on work done by Hanno Holties in https://git.astron.nl/eosc/slurmexecutorplugin, this one extends the use of parameters to be passed to the Slurm cluster so one can control the partition, the account, and other details about the jobs submission.

It was changed from srun to sbatch as a default command to interact with the cluster, so multiple jobs can be submitted at a time.

To use the plugin after installing the package change the AIRFLOW configuration file as such:

# The executor class that airflow should use. Choices include
# SequentialExecutor, LocalExecutor, CeleryExecutor, DaskExecutor, KubernetesExecutor
executor = airflow_slurm_executor.SlurmExecutor

Custom Use

One can pass the executor_config parameter in the default_args attribute to any DAG to customize some aspects of the job.

with DAG(
    dag_id="my_dag",
    start_date=pendulum.datetime(2016, 1, 1),
    schedule="@daily",
    default_args={"executor_config": {"SlurmExecutor: {"attribute": "value"}}},
):

The attributes implemented so far are:

  • cpu_nodes: Gives one control on which nodes to run this DAG, used as nodelist in slurm.
  • gpu_config: Gives one control on which gpu parameters can be used. The current supported schema is: {'gres': GPU_REQUIRED, 'queue': SPECIAL_GPU_PARTITION} If the queue/partition where the DAG task will be executed matches the parameter sent here, cpu_nodes will be ignored in favor of the gres node selecton.
  • output_path: Gives one control over where the slurm output log will be generated, remember the slurm nodes should have access to this location.
  • account: Gives one control over which account the jobs are going to be linked to.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow_slurm_executor-0.0.8.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file airflow_slurm_executor-0.0.8.tar.gz.

File metadata

  • Download URL: airflow_slurm_executor-0.0.8.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for airflow_slurm_executor-0.0.8.tar.gz
Algorithm Hash digest
SHA256 f634f01e5156f811489e860ba414e880d7876506de0b88a08f533ca5b76c3241
MD5 446b94a89a48c73e3e2cfb8e1ebc8970
BLAKE2b-256 c91d1e21435d185b322d9ae7095dffb11766a3a9feb96213a341dc4df5f72cf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page