workbenchapp / solana-workbench

Your one-stop shop for developing on Solana
MIT License
63 stars 7 forks source link

Docker error messages #233

Closed sammanadh closed 2 years ago

sammanadh commented 2 years ago

Two cases for docker error handled with appropriate messages

  1. Docker not installed.
  2. docker.sock permission denied.
nathanleclaire commented 2 years ago

👏 Will look it over shortly

nathanleclaire commented 2 years ago

This will be a bit more complicated than this. The main things we want to detect for the user are --

  1. If Docker is not installed at all. Unfortunately, we won't be able to detect this by attempting to run the container because most Docker operations now use the Docker API directly via dockerode. So, we need to check for the client binary with something like this line to know if Docker is installed.
  2. If Docker is installed but not running. Docker needs to be running and available for the page to work.

I think you should do these checks in a useInterval that starts up when Validator page is loaded, and is cancelled when Docker is detected to be running (thus, exposing the real page). If Docker is not installed or detected, we'd show only a prompt which warns the user either "Docker is not installed, please install Docker", or "Docker is installed but not running, please start Docker".

Curious to know @SvenDowideit's thoughts on the matter

Does that all make sense?

sammanadh commented 2 years ago

@nathanleclaire I guess by docker not running you mean to check if the docker deamon is up or not. right?

nathanleclaire commented 2 years ago

@nathanleclaire I guess by docker not running you mean to check if the docker deamon is up or not. right?

Correct! The daemon should be up and ready to receive a request on the Docker socket.

nathanleclaire commented 2 years ago

going to close this one in favor of https://github.com/workbenchapp/solana-workbench/pull/252

SvenDowideit commented 2 years ago

replaced by #252