install: check for docker #193

Closed
knoflook wants to merge 1 commits from knoflook/abra:installer into main
Owner

if you install abra when docker is not present on your local machine or your user isn't added to the docker group, it shows strange errors. This checks if docker is present on your local machine and proposes to install it if needed.

if you install abra when docker is not present on your local machine or your user isn't added to the docker group, it shows strange errors. This checks if docker is present on your local machine and proposes to install it if needed.
knoflook added 1 commit 2022-06-03 11:34:47 +00:00
continuous-integration/drone/pr Build is passing Details
7e280ee0c5
install: check for docker
Owner

@knoflook

if you install abra when docker is not present on your local machine or your user isn't added to the docker group, it shows strange errors.

That's strange, could you also copy/pasta in some of the errors?

This checks if docker is present on your local machine and proposes to install it if needed.

I thought we only needed to install Docker on the server-side, not on the local machine?

Also, I would guess that some people who use abra won't ever drop down into the more fine-grained Docker command-line commands, so unsure if we should have this check as default?

@knoflook > if you install abra when docker is not present on your local machine or your user isn't added to the docker group, it shows strange errors. That's strange, could you also copy/pasta in some of the errors? > This checks if docker is present on your local machine and proposes to install it if needed. I thought we only needed to install Docker on the server-side, not on the local machine? Also, I would guess that some people who use `abra` won't ever drop down into the more fine-grained Docker command-line commands, so unsure if we should have this check as default?
Author
Owner

That's strange, could you also copy/pasta in some of the errors?

sorry i was rushing to put this issue here. this happens when you run abra server add

? are you sure you trust this host key? Yes
INFO[0006] successfully added server SSH host key for [redacted] 
WARN[0007] cleaning up context for [redacted]           
WARN[0007] cleaning up server directory for [redacted]  
FATA[0007] 
Failed to add server [redacted].

This could be caused by two things.

Abra isn't picking up your SSH configuration or you need to specify it on the
command-line (e.g you use a non-standard port or username to connect). Run
"server add" with "-d/--debug" to learn more about what Abra is doing under the
hood.

Docker is not installed on your server. You can pass "-p/--provision" to
install Docker and initialise Docker Swarm mode. See help output for "server
add"

See "abra server add -h" for more. 

I thought we only needed to install Docker on the server-side, not on the local machine?

AFAIU abra can only control docker, not replace it. Which means it still needs the docker engine to run on the local machine. It's actual docker that manages contexts and makes connections to the servers, and we're just talking to it.

Also, I would guess that some people who use abra won't ever drop down into the more fine-grained Docker command-line commands, so unsure if we should have this check as default?

you can't add a server if the daemon is not present on your local machine.

>That's strange, could you also copy/pasta in some of the errors? sorry i was rushing to put this issue here. this happens when you run `abra server add` ``` ? are you sure you trust this host key? Yes INFO[0006] successfully added server SSH host key for [redacted] WARN[0007] cleaning up context for [redacted] WARN[0007] cleaning up server directory for [redacted] FATA[0007] Failed to add server [redacted]. This could be caused by two things. Abra isn't picking up your SSH configuration or you need to specify it on the command-line (e.g you use a non-standard port or username to connect). Run "server add" with "-d/--debug" to learn more about what Abra is doing under the hood. Docker is not installed on your server. You can pass "-p/--provision" to install Docker and initialise Docker Swarm mode. See help output for "server add" See "abra server add -h" for more. ``` > I thought we only needed to install Docker on the server-side, not on the local machine? AFAIU abra can only control docker, not replace it. Which means it still needs the docker engine to run on the local machine. It's actual docker that manages contexts and makes connections to the servers, and we're just talking to it. > Also, I would guess that some people who use abra won't ever drop down into the more fine-grained Docker command-line commands, so unsure if we should have this check as default? you can't add a server if the daemon is not present on your local machine.
Owner

AFAIU abra can only control docker, not replace it. Which means it still needs the docker engine to run on the local machine. It's actual docker that manages contexts and makes connections to the servers, and we're just talking to it.

abra largely re-uses upstream Docker CLI libs, so it is basically a drop-in replacement for a bunch of functionality. abra makes calls to the remote Docker daemon, not a local one. When you abra server add ..., abra runs the same code that the Docker CLI would run, to create the local context.

you can't add a server if the daemon is not present on your local machine.

I can on my machine:

➜ ~ which docker
docker not found
➜ ~ ls ~/.docker
ls: cannot access '/home/x/.docker': No such file or directory
➜ ~ abra server add x.autonomic.zone x 123 -p
INFO[0000] successfully created /home/x/.abra/servers/x.autonomic.zone
INFO[0017] swarm mode already initialised on x.autonomic.zone 
INFO[0019] swarm overlay network already created on x.autonomic.zone 
➜ ~ abra server ls
+----------------------+----------------------+--------------+------+
|         NAME         |         HOST         |     USER     | PORT |
+----------------------+----------------------+--------------+------+
| x.autonomic.zone     |    x.autonomic.zone  |      x       |  123 |
+----------------------+----------------------+--------------+------+
➜ ~ ls ~/.docker/contexts/meta 
675058db32fff0787e22db2c34dc00501b66ab283f0d907a853eddff0440a993

The error you posted above could have a number of causes but I don't think it is about a missing local Docker daemon. So many things can go wrong when dealing with a new server from abra side, anything SSH, provisioning fails, user permissions and the list goes on... if you can smoke out your issue, then we can improve the error message or try to handle it in abra?

> AFAIU abra can only control docker, not replace it. Which means it still needs the docker engine to run on the local machine. It's actual docker that manages contexts and makes connections to the servers, and we're just talking to it. `abra` largely re-uses upstream Docker CLI libs, so it is basically a drop-in replacement for a bunch of functionality. `abra` makes calls to the remote Docker daemon, not a local one. When you `abra server add ...`, `abra` runs the same code that the Docker CLI would run, to create the local context. > you can't add a server if the daemon is not present on your local machine. I can on my machine: ``` ➜ ~ which docker docker not found ➜ ~ ls ~/.docker ls: cannot access '/home/x/.docker': No such file or directory ➜ ~ abra server add x.autonomic.zone x 123 -p INFO[0000] successfully created /home/x/.abra/servers/x.autonomic.zone INFO[0017] swarm mode already initialised on x.autonomic.zone INFO[0019] swarm overlay network already created on x.autonomic.zone ➜ ~ abra server ls +----------------------+----------------------+--------------+------+ | NAME | HOST | USER | PORT | +----------------------+----------------------+--------------+------+ | x.autonomic.zone | x.autonomic.zone | x | 123 | +----------------------+----------------------+--------------+------+ ➜ ~ ls ~/.docker/contexts/meta 675058db32fff0787e22db2c34dc00501b66ab283f0d907a853eddff0440a993 ``` The error you posted above could have a number of causes but I don't think it is about a missing local Docker daemon. So many things can go wrong when dealing with a new server from `abra` side, anything SSH, provisioning fails, user permissions and the list goes on... if you can smoke out your issue, then we can improve the error message or try to handle it in `abra`?
Owner

Let's re-group to discuss this, closing off for now.

Let's re-group to discuss this, closing off for now.
decentral1se closed this pull request 2022-12-05 08:34:15 +00:00
All checks were successful
continuous-integration/drone/pr Build is passing

Pull request closed

Sign in to join this conversation.
No description provided.