Resource
| CLASS | DESCRIPTION |
|---|---|
ResourceRead |
Schema for resources in API response bodies. |
ResourceType |
Enum for the possible resource types. |
ValidResourceBase |
Base resource schema. |
ValidResourceLocal |
Valid local resource. |
ValidResourceSlurmSSH |
Valid SLURM-SSH resource. |
ValidResourceSlurmSudo |
Valid SLURM-sudo resource. |
| FUNCTION | DESCRIPTION |
|---|---|
cast_serialize_pixi_settings |
Cast/serialize round trip for |
cast_serialize_resource |
Cast/serialize round-trip for |
| ATTRIBUTE | DESCRIPTION |
|---|---|
ResourceCreate |
Schema for resources in API request bodies.
|
Attributes¶
ResourceCreate = Annotated[Annotated[ValidResourceLocal, Tag(ResourceType.LOCAL)] | Annotated[ValidResourceSlurmSudo, Tag(ResourceType.SLURM_SUDO)] | Annotated[ValidResourceSlurmSSH, Tag(ResourceType.SLURM_SSH)], Discriminator(get_discriminator_value)]
module-attribute
¶
Schema for resources in API request bodies.
Classes¶
ResourceRead
pydantic-model
¶
Bases: BaseModel
Schema for resources in API response bodies.
Fields:
-
id(int) -
name(str) -
type(str) -
prevent_new_submissions(bool) -
timestamp_created(AwareDatetime) -
host(str | None) -
jobs_local_dir(str) -
jobs_runner_config(dict[str, Any]) -
jobs_slurm_python_worker(str | None) -
jobs_poll_interval(int) -
tasks_local_dir(str) -
tasks_python_config(dict[str, Any]) -
tasks_pixi_config(dict[str, Any])
Source code in fractal_server/app/schemas/v2/resource.py
ResourceType
¶
Bases: StrEnum
Enum for the possible resource types.
| ATTRIBUTE | DESCRIPTION |
|---|---|
LOCAL |
Enum entry for resource type
|
SLURM_SSH |
Enum entry for resource type
|
SLURM_SUDO |
Enum entry for resource type
|
Source code in fractal_server/app/schemas/v2/resource.py
Attributes¶
LOCAL = 'local'
class-attribute
instance-attribute
¶
Enum entry for resource type local.
SLURM_SSH = 'slurm_ssh'
class-attribute
instance-attribute
¶
Enum entry for resource type slurm_ssh.
SLURM_SUDO = 'slurm_sudo'
class-attribute
instance-attribute
¶
Enum entry for resource type slurm_sudo.
ValidResourceBase
pydantic-model
¶
Bases: BaseModel
Base resource schema.
Fields:
-
type(ResourceType) -
name(NonEmptyStr) -
tasks_python_config(TasksPythonSettings) -
tasks_pixi_config(dict[NonEmptyStr, Any]) -
tasks_local_dir(AbsolutePathStr) -
jobs_local_dir(AbsolutePathStr) -
jobs_runner_config(dict[NonEmptyStr, Any]) -
jobs_poll_interval(int) -
prevent_new_submissions(bool)
Validators:
-
_pixi_slurm_config
Source code in fractal_server/app/schemas/v2/resource.py
ValidResourceLocal
pydantic-model
¶
Bases: ValidResourceBase
Valid local resource.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Resource name.
TYPE:
|
type |
Resource type. |
prevent_new_submissions |
When set to true: Prevent new job submissions and stop execution of ongoing jobs as soon as the current task is complete.
TYPE:
|
tasks_python_config |
Configuration of Python interpreters used for task collection.
TYPE:
|
tasks_pixi_config |
Configuration of
TYPE:
|
tasks_local_dir |
Local base folder for task environments.
TYPE:
|
jobs_local_dir |
Local base folder for job folders.
TYPE:
|
jobs_runner_config |
Runner configuration.
TYPE:
|
Fields:
-
name(NonEmptyStr) -
tasks_python_config(TasksPythonSettings) -
tasks_pixi_config(dict[NonEmptyStr, Any]) -
tasks_local_dir(AbsolutePathStr) -
jobs_local_dir(AbsolutePathStr) -
jobs_poll_interval(int) -
prevent_new_submissions(bool) -
type(Literal[LOCAL]) -
jobs_runner_config(JobRunnerConfigLocal) -
jobs_slurm_python_worker(None) -
host(None)
Validators:
-
_pixi_slurm_config
Source code in fractal_server/app/schemas/v2/resource.py
ValidResourceSlurmSSH
pydantic-model
¶
Bases: ValidResourceBase
Valid SLURM-SSH resource.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Resource name
TYPE:
|
type |
Resource type. |
prevent_new_submissions |
When set to true: Prevent new job submissions and stop execution of ongoing jobs as soon as the current task is complete.
TYPE:
|
tasks_python_config |
Configuration of Python interpreters used for task collection.
TYPE:
|
tasks_pixi_config |
Configuration of
TYPE:
|
tasks_local_dir |
Local base folder for task environments.
TYPE:
|
jobs_local_dir |
Local base folder for job folders.
TYPE:
|
jobs_runner_config |
Runner configuration.
TYPE:
|
jobs_poll_interval |
TYPE:
|
jobs_slurm_python_worker |
Python worker to be used in SLURM jobs.
TYPE:
|
host |
Hostname or IP address of remote SLURM cluster.
TYPE:
|
Fields:
-
name(NonEmptyStr) -
tasks_python_config(TasksPythonSettings) -
tasks_pixi_config(dict[NonEmptyStr, Any]) -
tasks_local_dir(AbsolutePathStr) -
jobs_local_dir(AbsolutePathStr) -
jobs_poll_interval(int) -
prevent_new_submissions(bool) -
type(Literal[SLURM_SSH]) -
host(NonEmptyStr) -
jobs_slurm_python_worker(AbsolutePathStr) -
jobs_runner_config(JobRunnerConfigSLURM)
Validators:
-
_pixi_slurm_config
Source code in fractal_server/app/schemas/v2/resource.py
ValidResourceSlurmSudo
pydantic-model
¶
Bases: ValidResourceBase
Valid SLURM-sudo resource.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Resource name.
TYPE:
|
type |
Resource type.
TYPE:
|
prevent_new_submissions |
When set to true: Prevent new job submissions and stop execution of ongoing jobs as soon as the current task is complete.
TYPE:
|
tasks_python_config |
Configuration of Python interpreters used for task collection.
TYPE:
|
tasks_pixi_config |
Configuration of
TYPE:
|
tasks_local_dir |
Local base folder for task environments.
TYPE:
|
jobs_local_dir |
Local base folder for job folders.
TYPE:
|
jobs_runner_config |
Runner configuration.
TYPE:
|
jobs_poll_interval |
TYPE:
|
jobs_slurm_python_worker |
Python worker to be used in SLURM jobs.
TYPE:
|
Fields:
-
name(NonEmptyStr) -
tasks_python_config(TasksPythonSettings) -
tasks_pixi_config(dict[NonEmptyStr, Any]) -
tasks_local_dir(AbsolutePathStr) -
jobs_local_dir(AbsolutePathStr) -
jobs_poll_interval(int) -
prevent_new_submissions(bool) -
type(Literal[SLURM_SUDO]) -
jobs_slurm_python_worker(AbsolutePathStr) -
jobs_runner_config(JobRunnerConfigSLURM) -
host(None)
Validators:
-
_pixi_slurm_config
Source code in fractal_server/app/schemas/v2/resource.py
Functions:¶
cast_serialize_pixi_settings(value)
¶
Cast/serialize round trip for tasks_pixi_config through the
TasksPixiSettings schema.
| PARAMETER | DESCRIPTION |
|---|---|
|
Current
TYPE:
|
Source code in fractal_server/app/schemas/v2/resource.py
cast_serialize_resource(_data)
¶
Cast/serialize round-trip for Resource data.
We use @validate_call because ResourceCreate is a Union type and it
cannot be instantiated directly.
| PARAMETER | DESCRIPTION |
|---|---|
|
TYPE:
|
Return
Serialized version of a valid resource object.