Skip to content

Add function to start the ITDE and add its credentials to a configuration #44

@tkilias

Description

@tkilias

ITDE has an API for spawning a DockerDB:

https://github.com/exasol/integration-test-docker-environment/blob/cbceeed7d4fb53872751b0dee74f7ec3dc1aa517/exasol_integration_test_docker_environment/lib/api/spawn_test_environment.py#L35

Port-Forwards won't work with DockerDB Image of the AI-Lab.

Users might want to configure the parameters:
db_mem_size: str = "2 GiB",
db_disk_size: str = "2 GiB",
nameserver: Tuple[str, ...] = tuple(),
create_certificates: bool = False,
additional_db_parameter: Tuple[str, ...] = tuple(), # Maybe hidden

The API returns an EnvironmentInfo object, besides other things. The EnvironmentInfo object contains IP and Ports of the DB and the DB Credentials.

The bucketfs credentials are hard-coded to r:read and w:write.

What happens, if the user runs the start ITDE again. For example, he stopped all docker containers and restart them now.

We need to check during connect if the docker-db is running and, if not, start it. When the user uses the function for initial start, we need a warning that this will create a new docker-db and that data will get lost. The user confirms this before we proceed.

Checking if the dockerdb is running:

The EnvironmentInfo contains a DatabaseInfo which contains a ContainerInfo with the name of the docker container of the DB. We store the container-name in the secret store when creating the docker-db and during connect we get the container-name from the secret store, ask docker if the container with this name exists, if not error message. Then we ask if it is running, if not we restart.

start a docker-container from python: https://docker-py.readthedocs.io/en/stable/containers.html#docker.models.containers.Container.start

determine of a container exists: https://docker-py.readthedocs.io/en/stable/containers.html#docker.models.containers.ContainerCollection.get

found if it exists: https://docker-py.readthedocs.io/en/stable/containers.html#docker.models.containers.Container.status

Some diagrams:

ai-lab-docker-db drawio

Metadata

Metadata

Assignees

Labels

featureProduct feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions