Artifact storage
****************

Storage backends for experiment artifacts such as export backups and
deployment status files. See Deployment monitor.

class psynet.artifact.LocalArtifactStorage(root=os.path.expanduser('~/psynet-data/artifacts'))

   Bases: "ArtifactStorage"

   Manage the storage of artifacts in a local directory; the default
   "artifact_storage".

   Parameters:
      **root** (*str*) -- Directory for artifacts, created if missing.
      Defaults to "~/psynet-data/artifacts".

class psynet.artifact.S3ArtifactStorage(root, bucket_name)

   Bases: "ArtifactStorage"

   Manage the storage of artifacts in an S3 bucket.

   Set it as the experiment's "artifact_storage" class attribute to
   share export backups and deployment status across servers. Uses the
   AWS credentials and "aws_region" from the Dallinger config.

   Parameters:
      * **root** (*str*) -- Key prefix inside the bucket under which
        artifacts are stored.

      * **bucket_name** (*str*) -- Name of an existing S3 bucket.

   -[ Examples ]-

      class Exp(psynet.experiment.Experiment):
          artifact_storage = S3ArtifactStorage(root="artifacts", bucket_name="my-bucket")
