exasol / notebook-connector

Connection configuration management and additional tools for Jupyter notebooks.
MIT License
0 stars 0 forks source link

Reconnect/Disconnect the Ai-Lab container from the Docker-DB during start/stop Docker-DB #89

Closed tkilias closed 3 months ago

tkilias commented 4 months ago

Background

We recognized that we don't reconnect or disconnect during start and stop of the Docker-DB container. This can lead to issue with the connectivity of the ai-lab container to the docker-db. Especially, if the AI-Lab container is a new container with an existing volume.

Example of current usage:

Connect in bring_itde_up: https://github.com/exasol/notebook-connector/blob/c91ce68e64e28807445b304ce94fade982521073/exasol/nb_connector/itde_manager.py#L64

Disconnect in take_itde_down https://github.com/exasol/notebook-connector/blob/c91ce68e64e28807445b304ce94fade982521073/exasol/nb_connector/itde_manager.py#L179

Acceptance Criteria

ahsimb commented 3 months ago

My observations:

When the container is stopped it gets disconnected from all networks it was connected to but the connection info is persisted. When the container is started it gets connected to all these networks again, unless they have been deleted.

If the Docker DB is stopped then, after it is restarted, both containers should be connected to the network. I cannot see a scenario when it is not the case. This is because if we see the Docker DB as existing but stopped it means it has been running before together with the current instance of the AI-Lab container (see the next paragraph). At that point, both were connected to the network and since then not disconnected explicitly. So, if the UI shows an option to restart an existing Docker DB it means the AI-Lab container is already connected to its network, even if the Docker DB itself is not.

The Docker DB container name is saved in the secret store after the container is created and started. Here is an issue: when we check if the Docker DB exists and running we first read its name from the secret store. If we have a fresh instance of the AI-Lab container it won't be there, though the Docker DB may actually exist and even be running. In that case, all we suggest is creating the Docker DB, not giving a warning that the data will be lost. Re-creating the container works, but of course with the loss of all data.