ersilia.publish package

Subpackages

Submodules

ersilia.publish.deploy module

ersilia.publish.dockerhub module

class ersilia.publish.dockerhub.DockerHubUploader(model_id: str, config_json=None)[source]

Bases: ErsiliaBase

Class for uploading Docker images to DockerHub.

Parameters:
  • model_id (str) – The ID of the model to be uploaded.

  • config_json (str, optional) – Path to the configuration JSON file.

Examples

uploader = DockerHubUploader(
    model_id="model_id",
    config_json="path/to/config.json",
)
uploader.set_credentials(
    docker_user="username", docker_pwd="password"
)
uploader.upload()
build_image()[source]

Build the Docker image for the model.

set_credentials(docker_user: str, docker_pwd: str)[source]

Set DockerHub credentials.

Parameters:
  • docker_user (str) – DockerHub username.

  • docker_pwd (str) – DockerHub password.

upload()[source]

Upload the Docker image to DockerHub.

ersilia.publish.publish module

ersilia.publish.rebase module

class ersilia.publish.rebase.TemplateRebaser(model_id: str, template_repo='eos-template', config_json=None, credentials_json=None)[source]

Bases: ErsiliaBase

Class for rebasing model repositories with a template repository.

Parameters:
  • model_id (str) – The ID of the model to be rebased.

  • template_repo (str, optional) – The name of the template repository. Default is ‘eos-template’.

  • config_json (str, optional) – Path to the configuration JSON file.

  • credentials_json (str, optional) – Path to the credentials JSON file.

clean()[source]

Clean up temporary directories.

clone_current_model()[source]

Clone the current model repository.

clone_template()[source]

Clone the template repository.

dvc_part()[source]

Set up DVC (Data Version Control) for the model repository.

rebase()[source]

Rebase the model repository with the template repository.

ersilia.publish.s3 module

class ersilia.publish.s3.S3BucketRepoUploader(model_id: str, config_json=None)[source]

Bases: ErsiliaBase

Class for uploading model repositories to an S3 bucket.

Parameters:
  • model_id (str) – The ID of the model to be uploaded.

  • config_json (str, optional) – Path to the configuration JSON file.

Examples

uploader = S3BucketRepoUploader(
    model_id="model_id",
    config_json="path/to/config.json",
)
uploader.set_credentials(
    aws_access_key_id="access_key",
    aws_secret_access_key="secret_key",
)
uploader.upload()
set_credentials(aws_access_key_id: str, aws_secret_access_key: str)[source]

Set AWS credentials.

Parameters:
  • aws_access_key_id (str) – AWS access key ID.

  • aws_secret_access_key (str) – AWS secret access key.

upload(repo_path=None)[source]

Upload the model repository to the S3 bucket.

Parameters:

repo_path (str, optional) – Path to the local repository. If not provided, the repository will be cloned from GitHub.

upload_zip(repo_path=None)[source]

Upload the zipped model repository to the S3 bucket.

Parameters:

repo_path (str, optional) – Path to the local repository. If not provided, the repository will be cloned from GitHub.

ersilia.publish.store module

Class used to store model when done developing it.

This functionality is used when developing of a model is done.

class ersilia.publish.store.ModelRemover(config_json=None, credentials_json=None)[source]

Bases: ErsiliaBase

Class for removing models from OSF.

Parameters:
  • config_json (str, optional) – Path to the configuration JSON file.

  • credentials_json (str, optional) – Path to the credentials JSON file.

Examples

remover = ModelRemover(
    config_json="path/to/config.json",
    credentials_json="path/to/credentials.json",
)
remover.remove(model_id="model_id")
remove(model_id: str)[source]

Remove model from OSF.

Parameters:

model_id (str) – The ID of the model to be removed.

class ersilia.publish.store.ModelStorager(config_json=None, credentials_json=None, overwrite=True)[source]

Bases: ErsiliaBase

Class for storing models in the local data directory and in OSF.

Parameters:
  • config_json (str, optional) – Path to the configuration JSON file.

  • credentials_json (str, optional) – Path to the credentials JSON file.

  • overwrite (bool, optional) – Whether to overwrite existing files. Default is True.

store(path: str, model_id: str)[source]

Store model in the local data directory and in OSF.

Parameters:
  • path (str) – Path to the model directory.

  • model_id (str) – The ID of the model to be stored.

Module contents