Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
17 stars 4 forks source link

Gracefully handle the default Jupyter port being in use #395

Closed WillEngler closed 5 months ago

WillEngler commented 7 months ago

Let's say you have a running notebook start session. Then in another terminal tab you open another. You will see something like ...

APIError: 500 Server Error for
http+docker://localhost/v1.43/containers/6412bc1e0bf85b9377c09e5f4e4337518eb5aa20f8a8b8bae3ee
6180faa626d0/start: Internal Server Error ("driver failed programming external connectivity
on endpoint mystifying_diffie
(0fe999f9f0a389a75574671d76a962d487289200ad21ae3eb8154aca9ac36536): Bind for 0.0.0.0:8888
failed: port is already allocated")

This will be another good one to handle. For one, we should pick a higher default port. (Not the standard 8888 that is normally used for Jupyter.) And then at minimum we should print a helpful/informative error when this happens instead of the big stack trace. Even better is if we could dynamically try another port, say normal_port_number + 1.

Assumptions:

1. 2.

Acceptance Criteria

Given..., when..., then...