storage

alchemiscale.storage.models — data models for storage components

class alchemiscale.storage.models.ComputeServiceID

Bases: str

class alchemiscale.storage.models.ComputeServiceRegistration(*args: Any, **kwargs: Any)

Bases: BaseModel

Registration for AlchemiscaleComputeService instances.

class alchemiscale.storage.models.Mark(*args: Any, **kwargs: Any)

Bases: GufeTokenizable

class alchemiscale.storage.models.NetworkMark(*args: Any, **kwargs: Any)

Bases: Mark

Mark object for AlchemicalNetworks.

network

ScopedKey of the AlchemicalNetwork this NetworkMark corresponds to. Used to ensure that there is only one NetworkMark for a given AlchemicalNetwork using neo4j constraints.

Type:

str

state

State of the AlchemicalNetwork, stored on this NetworkMark.

Type:

NetworkStateEnum

class alchemiscale.storage.models.NetworkStateEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

class alchemiscale.storage.models.ObjectStoreRef(*args: Any, **kwargs: Any)

Bases: GufeTokenizable

class alchemiscale.storage.models.ProtocolDAGResultRef(*args: Any, **kwargs: Any)

Bases: ObjectStoreRef

class alchemiscale.storage.models.Task(*args: Any, **kwargs: Any)

Bases: GufeTokenizable

A Task that can be used to generate a ProtocolDAG on a compute node.

status

Status of the task.

Type:

alchemiscale.storage.models.TaskStatusEnum

priority

Priority of the task; 1 is highest, larger values indicate lower priority.

Type:

int

claim

Identifier of the compute service that has a claim on this task.

Type:

Optional[str]

datetime_created
Type:

Optional[datetime.datetime]

class alchemiscale.storage.models.TaskArchive(*args: Any, **kwargs: Any)

Bases: GufeTokenizable

class alchemiscale.storage.models.TaskHub(*args: Any, **kwargs: Any)

Bases: GufeTokenizable

network

ScopedKey of the AlchemicalNetwork this TaskHub corresponds to. Used to ensure that there is only one TaskHub for a given AlchemicalNetwork using neo4j constraints.

Type:

str

weight

Value between 0.0 and 1.0 giving the weight of this TaskHub. This number is used to allocate attention to this TaskHub relative to others by a ComputeService. TaskHub with equal weight will be given equal attention; a TaskHub with greater weight than another will receive more attention.

Setting the weight to 0.0 will give the TaskHub no attention, effectively disabling it.

Type:

float

class alchemiscale.storage.models.TaskProvenance(*args: Any, **kwargs: Any)

Bases: BaseModel

class alchemiscale.storage.models.TaskStatusEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum


alchemiscale.storage.objectstore — object store interface

class alchemiscale.storage.objectstore.S3ObjectStore(session: boto3.Session, bucket: str, prefix: str, endpoint_url=None)

Bases: object

Object storage for use with AWS S3.

check()

Check consistency of object store.

initialize()

Initialize object store.

Creates bucket if it does not exist.

iter_contents(prefix='')

Iterate over the labels in this storage.

Parameters:

prefix (str) – Only iterate over paths that start with the given prefix.

Returns:

Contents of this storage, which may include items without metadata.

Return type:

Iterator[str]

pull_protocoldagresult(protocoldagresult: Optional[ScopedKey] = None, transformation: Optional[ScopedKey] = None, location: Optional[str] = None, return_as='gufe', ok=True) Union[gufe.protocols.ProtocolDAGResult, dict, str]

Pull the ProtocolDAGResult corresponding to the given ProtocolDAGResultRef.

Parameters:
  • protocoldagresult – ScopedKey for ProtocolDAGResult in the object store. Must be provided if location is None.

  • transformation – The ScopedKey of the Transformation this ProtocolDAGResult corresponds to. Must be provided if location is None.

  • location – The full path in the object store to the ProtocolDAGResult. If provided, this will be used to retrieve it.

  • return_as (['gufe', 'dict', 'json']) – Form in which to return result; this is provided to avoid unnecessary deserializations where desired.

Returns:

The ProtocolDAGResult corresponding to the given ProtocolDAGResultRef.

Return type:

ProtocolDAGResult

push_protocoldagresult(protocoldagresult: gufe.protocols.ProtocolDAGResult, transformation: ScopedKey, creator: Optional[str] = None) ProtocolDAGResultRef

Push given ProtocolDAGResult to this ObjectStore.

Parameters:
  • protocoldagresult – ProtocolDAGResult to store.

  • transformation – The ScopedKey of the Transformation this ProtocolDAGResult corresponds to.

Returns:

Reference to the serialized ProtocolDAGResult in the object store.

Return type:

ProtocolDAGResultRef

reset()

Remove all data from object store.

Deletes all objects, including the bucket itself.

exception alchemiscale.storage.objectstore.S3ObjectStoreError

Bases: Exception

alchemiscale.storage.objectstore.get_s3os(settings: S3ObjectStoreSettings, endpoint_url=None) S3ObjectStore

Convenience function for getting an S3ObjectStore directly from settings.