Modules and services

flux-batch can attach two kinds of extras to a batch job.

Services are started and stopped by lines in the wrapper script. Add one by name with spec.add_service("name"); an unknown name is treated as an existing systemd user unit and started with systemctl --user.

Modules run under the Flux broker of the batch job itself, through flux modprobe rc scripts. They start on chosen ranks when the instance boots and stop when it shuts down, so they can deploy something on every node before your work runs.

spec.add_module("usernetes", cluster_name="demo")

Keyword arguments to add_module and add_service become attributes of that module, on top of the batch job attributes.

How modules are wired in

At submit time flux-batch renders each module’s start and stop scripts into ~/.flux-batch/<job name>/rc1.d and rc3.d, and passes the job:

  • FLUX_MODPROBE_PATH_APPEND=~/.flux-batch/<job name>, so the broker finds them

  • --conf <module>=true, which the tasks require before they run

The scripts are rewritten on every submission, and the directory is scoped by job name, so two jobs with different module settings never share scripts.

Available modules

Module

What it does

usernetes

Deploys user space Kubernetes across the job, and bursts workers into an existing cluster.

flux-scribe

Records the job event journal of the instance to a database.