Skip to content

Add attempt to connect to socket before selecting it as runtime#78

Merged
kcq merged 1 commit intomintoolkit:masterfrom
eharris128:check-socket
Oct 28, 2024
Merged

Add attempt to connect to socket before selecting it as runtime#78
kcq merged 1 commit intomintoolkit:masterfrom
eharris128:check-socket

Conversation

@eharris128
Copy link
Copy Markdown
Contributor

What

  • Ping sockets before designating it as runtime

Why

  • crt.AutoRuntime would tell the tui -> i images OnCommand invocation to use containerd as runtime. However, the application could not talk to this containerd socket due to permission issues. The socket was there from the perspective of Stat - but this did not guarantee sufficient access to communicate with the socket.

How Tested

mint images
mint tui -> i

New Experience

  • When a user's environment has podman & containerd, but the application does not have sufficient permissions to access these sockets, then fallback to docker:
    image

Signed-off-by: Evan Harris <echarris@smcm.edu>
}

return DockerRuntime
return DockerRuntime // Question -> This runtime may not necessarily be available?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is a good idea to check if the default/assumed runtime (when no explicit runtime param is specified) is available. A wishlist enhancement :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A future TODO

@kcq
Copy link
Copy Markdown
Contributor

kcq commented Oct 28, 2024

@eharris128 there might be another bug to investigate there... The "auto crt" logic shouldn't have picked containerd unless containerd is the only thing is installed. What's the docker socket you have in your environment? What's the docker context info?

@kcq kcq merged commit 46a2715 into mintoolkit:master Oct 28, 2024
@eharris128
Copy link
Copy Markdown
Contributor Author

What's the docker socket you have in your environment? What's the docker context info?

Will share these details next time I am on my dev machine.

@eharris128
Copy link
Copy Markdown
Contributor Author

@kcq

image

image

@kcq
Copy link
Copy Markdown
Contributor

kcq commented Oct 29, 2024

@eharris128 can you also run docker context ls and ls -lh /var/run/docker.sock

@kcq
Copy link
Copy Markdown
Contributor

kcq commented Oct 30, 2024

Either way, the /var/run/docker.sock socket should have been picked by the auto container runtime selection logic. With the Docker runtime detection it's supposed to go through these three stages:

  1. Try using the unix socket from docker context
  2. If there's no docker context configured try using /var/run/docker.sock
  3. Try using the user directory located docker socket (usually from Docker Desktop installs)

@eharris128
Copy link
Copy Markdown
Contributor Author

@kcq very delayed here, but I ruined the reproducibility as I upgraded to Ubuntu 24 LTS last week (in order to work with Podman - as the Ubuntu 22 LTS's installation of Podman does not work for mint).

With the Ubuntu 24 LTS default docker configuration, we no longer get the issue of defaulting to containerd (when docker is installed).

@kcq
Copy link
Copy Markdown
Contributor

kcq commented Nov 6, 2024

@eharris128 no worries :) can you create a GitHub issue with the notes from our discussion about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants