Skip to content

Run a Hydra Job

Call function.run(action="job", ...) to execute a Hydra function as a one-off job.

Parameters

Name Type Required Description
action str ✓ Action to execute. Must be job.
volumes list[dict] List of volumes.
resources dict Resource limits and requests. Applied to a single subtask, not the orchestrating launcher.
envs list[dict] Environment variables.
secrets list[str] List of secret names.
profile str Profile template. Applied to a single subtask, not the orchestrating launcher.
local_execution bool Execute locally instead of remotely. Defaults to False. Local dependencies must already be installed.
parameters dict Hydra configuration overrides passed to the function.
init_parameters dict Parameters supplied to the init function.
workers int Number of workers available for parallel execution.

Example

run = function.run(
    action="job",
    parameters={
        "trainer.max_epochs": 1,
        "hydra.sweeper.storage": "sqlite:///hpo.db",
    },
    workers=5,
    local_execution=False,
)