LT Service Local Installation¶
- class elg.local_installation.LTServiceLocalInstallation(id: int, image: str, sidecar_image: str, name: str, image_envvars: List[str], full_name: str, port: int, path: str, gui: bool, gui_image: str, gui_port: int, gui_path: str, record: Any)¶
Class that contains all the information to deploy an ELG-compatible service locally
- classmethod from_id(id: int, gui: bool = True, gui_image: str = 'registry.gitlab.com/european-language-grid/usfd/gui-ie:latest', gui_port: int = 80, image_envvars: List[str] = [], domain: str = 'live', use_cache: bool = True, cache_dir: str = '~/.cache/elg')¶
Class method to init a LTServiceLocalInstallation object from the id of an LT service deployed in the ELG cluster
- Parameters
id (int) – id of the LT service in the ELG cluster
gui (bool, optional) – boolean to indicate if yes or no the GUI should be deployed. Defaults to True.
gui_image (_type_, optional) – docker image of the GUI. Defaults to “registry.gitlab.com/european-language-grid/usfd/gui-ie:latest”.
gui_port (int, optional) – port exposed by the GUI docker container. Defaults to 80.
image_envvars (List[str], optional) – environment variables to pass to the LT service docker container. Defaults to [].
domain (str, optional) – domain of the ELG cluster. Defaults to “live”.
use_cache (bool, optional) – True if you want to use cached files. Defaults to True.
cache_dir (str, optional) – path to the cache_dir. Set it to None to not store any cached files. Defaults to “~/.cache/elg”.
- Returns
the LTServiceLocalInstallation object created
- Return type
- classmethod from_docker_image(image: str, execution_location: str, sidecar_image: str = '', name: Optional[str] = None, image_envvars: List[str] = [], full_name: Optional[str] = None, gui: bool = False, gui_image: str = 'registry.gitlab.com/european-language-grid/usfd/gui-ie:latest', gui_port: int = 80, gui_path: str = '', record: Any = {})¶
Class method to init a LTServiceLocalInstallation object from a docker image
- Parameters
image (str) – docker image of the LT service
execution_location (str) – execution location of the LT service in the LT service docker container (e.g. http://localhost:8000/process)
sidecar_image (str, optional) – docker image of the sidecar. Defaults to “”.
name (str, optional) – short name of the LT service used in the docker-compose. Defaults to None.
image_envvars (List[str], optional) – environment variables to pass to the LT service docker container. Defaults to [].
full_name (str, optional) – long name of the LT service used in the GUI. Defaults to None.
gui (bool, optional) – boolean to indicate if yes or no the GUI should be deplo. Defaults to False.
gui_image (str, optional) – docker image of the GUI. Defaults to “registry.gitlab.com/european-language-grid/usfd/gui-ie:latest”.
gui_port (int, optional) – port exposed by the GUI docker container. Defaults to 80.
gui_path (str, optional) – path to the GUI endpoint. Defaults to “”.
record (Any, optional) – metadata record of the LT service. Defaults to {}.
- Returns
the LTServiceLocalInstallation object created
- Return type
Local Installation¶
- class elg.local_installation.LocalInstallation(ltservices: List[LTServiceLocalInstallation], helpers: Optional[List[str]] = None)¶
Class that contains all the information to deploy ELG-compatible services with a small part of the ELG infrastructure locally
- classmethod from_ids(ids: List[int], gui: bool = True, gui_images: Union[str, List[str]] = 'registry.gitlab.com/european-language-grid/usfd/gui-ie:latest', gui_ports: Union[int, List[int]] = 80, helpers: Optional[List[str]] = None, images_envvars: Optional[List[List[str]]] = None, domain: str = 'live', use_cache: bool = True, cache_dir: str = '~/.cache/elg')¶
Class method to init a LocalInstallation object from multiple ids of LT services deployed in the ELG cluster
- Parameters
ids (List[int]) – list of ids od LT services in the ELG cluster
gui (bool, optional) – boolean to indicate if yes or no the GUI should be deployed. Defaults to True.
gui_images (Union[str, List[str], optional) – docker images of the GUI. If string, the same GUI docker image will be used for all the services. Otherwise, the number of GUI docker images needs to be the same as the number of LT services deployed. Defaults to “registry.gitlab.com/european-language-grid/usfd/gui-ie:latest”.
gui_ports (Union[int, List[int]], optional) – port exposed by the GUI docker container. If integer, the same port will be used for all the services. Otherwise, the number of port needs to be the same as the number of LT services deployed. Defaults to 80.
helpers (List[str], optional) – list of helpers to deploy. Currently only “temp-storage” is a valid helper and can be used to deploy a temporary storage needed for some services. Defaults to None.
images_envvars (List[List[str]], optional) – environment variables to pass to the LT services docker container. Defaults to None.
domain (str, optional) – domain of the ELG cluster. Defaults to “live”.
use_cache (bool, optional) – True if you want to use cached files. Defaults to True.
cache_dir (str, optional) – path to the cache_dir. Set it to None to not store any cached files. Defaults to “~/.cache/elg”.
- Returns
the LocalInstallation object created
- Return type
- create_docker_compose(expose_port: int = 8080, path: str = './elg_local_installation/')¶
Method to generate the docker compose file and all the configuration files to deploy the LocalInstallation
- Parameters
expose_port (int, optional) – port used to expose the GUI or the LT service execution server. Defaults to 8080.
path (str, optional) – path where to store the configuration files. Defaults to “./elg_local_installation/”.