ersilia.hub.fetch.pack.bentoml_pack package

Submodules

ersilia.hub.fetch.pack.bentoml_pack.mode module

class ersilia.hub.fetch.pack.bentoml_pack.mode.PackModeDecision(model_id: str, config_json: dict)[source]

Bases: ErsiliaBase

A class used to decide the packaging mode for a model.

model_id

ID of the model.

Type:

str

config_json

Configuration settings in JSON format.

Type:

dict

versioner

Instance of Versioner for version checking.

Type:

Versioner

decide_from_config_file_if_available()[source]

Decide the packaging mode from the config file if available.

decide()[source]

Decide the packaging mode based on system and model requirements.

decide() str[source]

Decide the packaging mode based on system and model requirements.

Returns:

Decided packaging mode.

Return type:

str

decide_from_config_file_if_available() str[source]

Decide the packaging mode from the config file if available.

Returns:

Packaging mode if specified in the config file, None otherwise.

Return type:

str

ersilia.hub.fetch.pack.bentoml_pack.runners module

class ersilia.hub.fetch.pack.bentoml_pack.runners.CondaPack(model_id, config_json)[source]

Bases: BasePack

A class used to pack models with Conda environments.

run()

Run the Conda environment packer.

run(**kwargs)
class ersilia.hub.fetch.pack.bentoml_pack.runners.DockerPack(model_id, config_json)[source]

Bases: BasePack

A class used to pack models with Docker.

run()[source]

Run the Docker packer.

run()[source]

Run the Docker packer.

class ersilia.hub.fetch.pack.bentoml_pack.runners.SystemPack(model_id, config_json)[source]

Bases: BasePack

A class used to pack models with system installation.

run()[source]

Run the system packer.

Examples

packer = SystemPack(
    model_id="eosxxxx", config_json=config
)
packer.run()
run()[source]

Run the system packer.

class ersilia.hub.fetch.pack.bentoml_pack.runners.VenvPack(model_id, config_json)[source]

Bases: BasePack

A class used to pack models with virtual environments.

run()[source]

Run the virtual environment packer.

run()[source]

Run the virtual environment packer.

ersilia.hub.fetch.pack.bentoml_pack.runners.get_runner(pack_mode: str)[source]

Get the runner class based on the pack mode.

Parameters:

pack_mode (str) – Packaging mode.

Returns:

Runner class corresponding to the pack mode.

Return type:

type

Module contents

class ersilia.hub.fetch.pack.bentoml_pack.BasePack(model_id, config_json)[source]

Bases: _Deleter, _Symlinker, _Writer

Base class for handling BentoML model packs.

Parameters:
  • model_id (str) – Identifier of the model.

  • config_json (dict) – Configuration settings for the pack.