Data Models#
- class beaker.data_model.base.BaseModel(**data)[source]#
Bases:
BaseModelV2
The base class for all Beaker data models.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
Account#
Organization#
- class beaker.Organization(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.OrganizationRole(value)[source]#
Bases:
StrEnum
An enumeration.
- admin = 'admin'#
- member = 'member'#
- class beaker.OrganizationMember(**data)[source]#
Bases:
BaseModel
-
role:
OrganizationRole
#
-
organization:
Organization
#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
role:
Workspace#
- class beaker.Workspace(**data)[source]#
Bases:
BaseModel
-
size:
WorkspaceSize
#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
size:
- class beaker.WorkspaceSize(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.WorkspaceRef(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.Permission(value)[source]#
Bases:
StrEnum
Workspace permission levels.
- no_permission = 'none'#
- read = 'read'#
- write = 'write'#
- full_control = 'all'#
- class beaker.WorkspacePermissions(**data)[source]#
Bases:
BaseModel
-
authorizations:
Optional
[Dict
[str
,Permission
]]# A dictionary of account IDs to authorizations.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
authorizations:
Cluster#
- class beaker.Cluster(**data)[source]#
Bases:
BaseModel
-
status:
ClusterStatus
#
-
node_spec:
Optional
[NodeResources
]# The requested node configuration.
-
node_shape:
Optional
[NodeResources
]# The actual node configuration.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
status:
- class beaker.ClusterStatus(value)[source]#
Bases:
StrEnum
Current status of a cluster.
- pending = 'pending'#
- active = 'active'#
- terminated = 'terminated'#
- failed = 'failed'#
- class beaker.ClusterUtilization(**data)[source]#
Bases:
BaseModel
-
nodes:
Tuple
[NodeUtilization
,...
]#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
nodes:
Node#
- class beaker.Node(**data)[source]#
Bases:
BaseModel
-
limits:
NodeResources
#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
limits:
- class beaker.NodeResources(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.NodeUtilization(**data)[source]#
Bases:
BaseModel
-
limits:
NodeResources
#
-
used:
NodeResources
#
-
free:
NodeResources
#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
limits:
Dataset#
- class beaker.Dataset(**data)[source]#
Bases:
BaseModel
-
workspace_ref:
WorkspaceRef
#
-
storage:
Optional
[DatasetStorage
]#
- property workspace: WorkspaceRef#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
workspace_ref:
- class beaker.DatasetStorage(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.FileInfo(**data)[source]#
Bases:
BaseModel
- IGNORE_FIELDS: ClassVar[Set[str]] = {'url'}#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.Digest(*args, value: str, algorithm: DigestHashAlgorithm)[source]#
Bases:
BaseModel
A digest is a checksum / hash of a files contents. These are used to verify the integrity of files downloaded from Beaker datasets.
-
algorithm:
DigestHashAlgorithm
# The algorithm used to create and verify the digest.
- classmethod from_encoded(encoded)[source]#
Initialize a digest from a string encoding of the form
{ALGORITHM} {ENCODED_STRING}
, e.g.SHA256 iA02Sx8UNLYvMi49fDwdGjyy5ssU+ttuN1L4L3/JvZA=
.
- classmethod from_decoded(decoded, algorithm)[source]#
Initialize a digest from raw bytes.
- Parameters:
decoded (
bytes
) – The raw bytes of the digest.algorithm (
Union
[str
,DigestHashAlgorithm
]) – The algorithm used to produce the bytes of the digest from the contents of the corresponding file.
- Return type:
- encode()[source]#
Encode the digest into its string form.
This is the inverse of
from_encoded()
.- Return type:
- decode()[source]#
Decode a digest into its raw bytes form.
This is the inverse of
from_decoded()
.- Return type:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
algorithm:
Image#
- class beaker.Image(**data)[source]#
Bases:
BaseModel
-
workspace_ref:
WorkspaceRef
#
- property workspace: WorkspaceRef#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
workspace_ref:
Job#
- class beaker.Job(**data)[source]#
Bases:
BaseModel
A
Job
is an execution of aTask
.Tip
You can check a job’s exit code with
job.status.exit_code
.-
execution:
Optional
[JobExecution
]#
-
requests:
Optional
[JobRequests
]#
-
result:
Optional
[ExecutionResult
]#
- property is_done: bool#
Same as
is_finalized()
, kept for backwards compatibility.
- check()[source]#
- Raises:
JobFailedError – If the job failed or was canceled.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
execution:
- class beaker.JobKind(value)[source]#
Bases:
StrEnum
The kind of job.
- execution = 'execution'#
- session = 'session'#
- class beaker.CurrentJobStatus(value)[source]#
Bases:
StrEnum
The status of a job.
- created = 'created'#
- scheduled = 'scheduled'#
- running = 'running'#
- idle = 'idle'#
- exited = 'exited'#
- failed = 'failed'#
- finalized = 'finalized'#
- canceled = 'canceled'#
- preempted = 'preempted'#
- class beaker.CanceledCode(value)[source]#
Bases:
IntEnum
An enumeration.
- not_set = 0#
- system_preemption = 1#
- user_preemption = 2#
- idle = 3#
- manual_cancellation = 4#
- class beaker.JobStatus(**data)[source]#
Bases:
BaseModel
-
canceled_code:
Union
[CanceledCode
,int
,None
]#
- property current: CurrentJobStatus#
Get the
CurrentJobStatus
.- Raises:
ValueError – If status can’t be determined.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
canceled_code:
- class beaker.ExecutionResult(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.JobRequests(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.JobExecution(**data)[source]#
Bases:
BaseModel
-
result:
ExecutionResult
#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
result:
- class beaker.JobLimits(**data)[source]#
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class beaker.Session(**data)[source]#
Bases:
BaseModel
-
image:
Optional
[ImageSource
]#
-
result:
Optional
[ResultSpec
]#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
image:
Experiment#
- class beaker.Experiment(**data)[source]#
Bases:
BaseModel
-
workspace_ref:
WorkspaceRef
#
- property workspace: WorkspaceRef#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
workspace_ref:
Secret#
Group#
- class beaker.Group(**data)[source]#
Bases:
BaseModel
-
workspace_ref:
Optional
[WorkspaceRef
]#
- property workspace: WorkspaceRef | None#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
workspace_ref: