Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show error message if docker is not running #3854

Conversation

msivasubramaniaan
Copy link
Collaborator

Fixes: #3638

Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 75 lines in your changes are missing coverage. Please review.

Comparison is base (da60441) 32.37% compared to head (606a72d) 45.32%.
Report is 35 commits behind head on main.

Files Patch % Lines
src/openshift/cluster.ts 18.75% 26 Missing ⚠️
src/serverlessFunction/functions.ts 27.27% 24 Missing ⚠️
.../webview/create-component/createComponentLoader.ts 36.36% 7 Missing ⚠️
src/registriesView.ts 78.26% 5 Missing ⚠️
src/util/loginUtil.ts 44.44% 5 Missing ⚠️
src/webview/devfile-registry/registryViewLoader.ts 57.14% 3 Missing ⚠️
src/deployment.ts 60.00% 2 Missing ⚠️
src/webview/common-ext/createComponentHelpers.ts 50.00% 2 Missing ⚠️
src/explorer.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3854       +/-   ##
===========================================
+ Coverage   32.37%   45.32%   +12.95%     
===========================================
  Files          85       85               
  Lines        6505     6526       +21     
  Branches     1349     1349               
===========================================
+ Hits         2106     2958      +852     
+ Misses       4399     3568      -831     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vrubezhny
Copy link
Contributor

@msivasubramaniaan If [on Fedora 38] I have docker installed, but disabled, I see:

$ docker info
Client: Docker Engine - Community
 Version:    25.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info

... but Build And Run invoked for a SL-function still runs:

Building function image
Still building
🙌 Function built: docker.io/jeremy/a-serverless-function:latest
Running on host port 8080
{"level":30,"time":1706622541354,"pid":23,"hostname":"f56df8f6d4ae","node_version":"v20.9.0","msg":"Server listening at http://[::]:8080"}
^C

@msivasubramaniaan
Copy link
Collaborator Author

@msivasubramaniaan If [on Fedora 38] I have docker installed, but disabled, I see:

$ docker info
Client: Docker Engine - Community
 Version:    25.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info

... but Build And Run invoked for a SL-function still runs:

Building function image
Still building
🙌 Function built: docker.io/jeremy/a-serverless-function:latest
Running on host port 8080
{"level":30,"time":1706622541354,"pid":23,"hostname":"f56df8f6d4ae","node_version":"v20.9.0","msg":"Server listening at http://[::]:8080"}
^C

Please let me know the response of docker ps

@vrubezhny
Copy link
Contributor

vrubezhny commented Jan 30, 2024

Some logs before I execute docker ps - stopping docker and looking for its status:

$ sudo systemctl stop docker
Warning: Stopping docker.service, but it can still be activated by:
  docker.socket

$ sudo systemctl status docker
○ docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead) since Tue 2024-01-30 15:51:04 CET; 9s ago
   Duration: 52min 46.938s
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 1321445 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=0/SUCCESS)
   Main PID: 1321445 (code=exited, status=0/SUCCESS)
        CPU: 973ms

Jan 30 14:58:17 redpad dockerd[1321445]: time="2024-01-30T14:58:17.135819902+01:00" level=info msg="Daemon has completed initialization"
Jan 30 14:58:17 redpad dockerd[1321445]: time="2024-01-30T14:58:17.204070576+01:00" level=info msg="API listen on /run/docker.sock"
Jan 30 14:58:17 redpad systemd[1]: Started docker.service - Docker Application Container Engine.
Jan 30 15:51:04 redpad systemd[1]: Stopping docker.service - Docker Application Container Engine...
Jan 30 15:51:04 redpad dockerd[1321445]: time="2024-01-30T15:51:04.145924902+01:00" level=info msg="Processing signal 'terminated'"
Jan 30 15:51:04 redpad dockerd[1321445]: time="2024-01-30T15:51:04.157758410+01:00" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=>
Jan 30 15:51:04 redpad dockerd[1321445]: time="2024-01-30T15:51:04.158410559+01:00" level=info msg="Daemon shutdown complete"
Jan 30 15:51:04 redpad dockerd[1321445]: time="2024-01-30T15:51:04.158493325+01:00" level=info msg="stopping event stream following graceful shutdown" error="context cancel>
Jan 30 15:51:04 redpad systemd[1]: docker.service: Deactivated successfully.
Jan 30 15:51:04 redpad systemd[1]: Stopped docker.service - Docker Application Container Engine.
lines 1-22/22 (END)

... then docker ps:

$ docker ps
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permission denied

$ sudo docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

maybe the problem is that my user has no rights to operate docker, so I have to execute it with the help of sudo ...?

@datho7561
Copy link
Collaborator

I don't have docker installed (just podman) and before this PR, I'm able to run serverless functions. Are you sure that docker is required to run serverless functions?

@msivasubramaniaan
Copy link
Collaborator Author

I don't have docker installed (just podman) and before this PR, I'm able to run serverless functions. Are you sure that docker is required to run serverless functions?

@datho7561 May I know which image you are using for build? Isn't it docker.io?

@vrubezhny
Copy link
Contributor

I don't have docker installed (just podman) and before this PR, I'm able to run serverless functions. Are you sure that docker is required to run serverless functions?

I'm not 100% sure, but having:

$ func build
A registry for function images is required. For example, 'docker.io/tigerteam'.
? Registry for function images: docker.io/jeremy
Note: building a function the first time will take longer than subsequent builds
Building function image

2024/01/30 16:40:04.184304 DEBUG:  Pulling image ghcr.io/knative/builder-jammy-base:latest

Error: failed to build the function: failed to fetch builder image 'ghcr.io/knative/builder-jammy-base:latest': permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=ghcr.io%2Fknative%2Fbuilder-jammy-base&tag=latest": dial unix /var/run/docker.sock: connect: permission denied

I think at least func build requires a docker to be installed and running.

@datho7561
Copy link
Collaborator

May I know which image you are using for build?

Right! I forgot that you need to build the serverless function before you can run it. I'll double check if I can run the serverless function without podman or docker installed.

Isn't it docker.io?

You can run container images from docker.io with podman instead of docker.

@msivasubramaniaan
Copy link
Collaborator Author

May I know which image you are using for build?

Right! I forgot that you need to build the serverless function before you can run it. I'll double check if I can run the serverless function without podman or docker installed.

Isn't it docker.io?

You can run container images from docker.io with podman instead of docker.

Yes. This PR should works on all the clients like docker desktop, podman, ...

@datho7561
Copy link
Collaborator

Okay, you need either docker or podman installed to run "Build" or "Run"

@datho7561
Copy link
Collaborator

Yes. This PR should works on all the clients like docker desktop, podman, ...

This line won't work if only podman is installed: https://github.com/redhat-developer/vscode-openshift-tools/pull/3854/files#diff-f9b7ce8b2e1d73c6d56dbcb8003e652267411f5c89e851753523d568b575fc48R368

@vrubezhny
Copy link
Contributor

vrubezhny commented Jan 30, 2024

Maybe Bulid and Run not showing any warning when docker is stopped is not a problem, because, at least in my case, docker gets started automatically on docker.socket access...
The scenario I've tested is the following:

$ sudo systemctl stop docker
Warning: Stopping docker.service, but it can still be activated by:
  docker.socket

$ sudo systemctl status docker
○ docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; preset: disabled)
     ...
     Active: inactive (dead) since Tue 2024-01-30 17:25:07 CET; 2s ago
     ...
TriggeredBy: ● docker.socket
     ...

$ func build 
A registry for function images is required. For example, 'docker.io/tigerteam'.
? Registry for function images: docker.io/vrubezhny
Note: building a function the first time will take longer than subsequent builds
Building function image
Still building
...

$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; preset: disabled)
     ...
     Active: active (running) since Tue 2024-01-30 17:25:22 CET; 6s ago
TriggeredBy: ● docker.socket
     ...

So when docker daemon is stopped (and even disabled) it gets started automatically when I run func build still allowing an image to be built.

Given this fact I don't know how can I locally test the appearance of Docker is not running, Please start the docker process error message for non-running docker case.

Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
@msivasubramaniaan
Copy link
Collaborator Author

msivasubramaniaan commented Feb 2, 2024

Yes. This PR should works on all the clients like docker desktop, podman, ...

This line won't work if only podman is installed: https://github.com/redhat-developer/vscode-openshift-tools/pull/3854/files#diff-f9b7ce8b2e1d73c6d56dbcb8003e652267411f5c89e851753523d568b575fc48R368

@datho7561 Here is the demo about how this PR works on podman
check-docker

@msivasubramaniaan
Copy link
Collaborator Author

Maybe Bulid and Run not showing any warning when docker is stopped is not a problem, because, at least in my case, docker gets started automatically on docker.socket access... The scenario I've tested is the following:

$ sudo systemctl stop docker
Warning: Stopping docker.service, but it can still be activated by:
  docker.socket

$ sudo systemctl status docker
○ docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; preset: disabled)
     ...
     Active: inactive (dead) since Tue 2024-01-30 17:25:07 CET; 2s ago
     ...
TriggeredBy: ● docker.socket
     ...

$ func build 
A registry for function images is required. For example, 'docker.io/tigerteam'.
? Registry for function images: docker.io/vrubezhny
Note: building a function the first time will take longer than subsequent builds
Building function image
Still building
...

$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; preset: disabled)
     ...
     Active: active (running) since Tue 2024-01-30 17:25:22 CET; 6s ago
TriggeredBy: ● docker.socket
     ...

So when docker daemon is stopped (and even disabled) it gets started automatically when I run func build still allowing an image to be built.

Given this fact I don't know how can I locally test the appearance of Docker is not running, Please start the docker process error message for non-running docker case.

@vrubezhny I am not sure but you can try sudo systemctl stop docker.socket and test this PR

@datho7561
Copy link
Collaborator

@datho7561 Here is the demo about how this PR works on podman

I tried it again, and it still doesn't work with only podman installed.

If you uninstall docker, then it won't work. On this line: https://github.com/redhat-developer/vscode-openshift-tools/pull/3854/files#diff-f9b7ce8b2e1d73c6d56dbcb8003e652267411f5c89e851753523d568b575fc48R379 you use the docker binary to check if docker is running. I don't have the docker binary installed on my computer, so no matter what, I am always warned that docker isn't installed. I could symlink docker to podman, but not everyone who has podman set up does this, and building and running a functino should work even if you don't do this.

@vrubezhny
Copy link
Contributor

vrubezhny commented Feb 2, 2024

@msivasubramaniaan This is what I get printed out to the OpenShift Terminal when I try executing Build and Run for a SL-function:

Warning: function has current image 'docker.io/jeremy/a-serverless-function:latest' which has a different registry than the currently configured registry 'image-registry.openshift-image-registry.svc:5000/vrubezhny-dev'. The new image tag will be 'image-registry.openshift-image-registry.svc:5000/vrubezhny-dev/a-serverless-function:latest'.  To use an explicit image, use --image.
Building function image

2024/02/02 15:40:11.328437 DEBUG:  Pulling image ghcr.io/knative/builder-jammy-base:latest

Error: failed to build the function: failed to fetch builder image 'ghcr.io/knative/builder-jammy-base:latest': Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?


Press any key to close this terminal

On the same time docker-services statuses are:

$ sudo systemctl status docker.socket
○ docker.socket - Docker Socket for the API
...
     Active: inactive (dead)
   Triggers: ● docker.service
...

$ sudo systemctl status docker
○ docker.service - Docker Application Container Engine
...
     Active: inactive (dead)
TriggeredBy: ○ docker.socket

...and docker says:

$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

$ docker info
Client: Docker Engine - Community
 Version:    25.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info

... and the error output (resultRaw.stderr) from docker info -f=json in this case:

image

Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
@vrubezhny
Copy link
Contributor

Looks like now the check works if docker is installed, but not running:

image

Still the question is: if I have podman and docker installed and if docker is stopped/disabled, should the func run -p <path-to-sl-func> --build command still work?

$ func run -p ./ --build
Building function image

2024/02/12 13:17:16.920103 DEBUG:  Pulling image ghcr.io/knative/builder-jammy-base:latest

Error: failed to build the function: failed to fetch builder image 'ghcr.io/knative/builder-jammy-base:latest': Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

vrubezhny
vrubezhny previously approved these changes Feb 12, 2024
Copy link
Contributor

@vrubezhny vrubezhny left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

@datho7561
Copy link
Collaborator

Still doesn't work for me

@msivasubramaniaan
Copy link
Collaborator Author

msivasubramaniaan commented Feb 12, 2024

Still doesn't work for me

@datho7561 Are you able to stop the docker daemon on your machine? May I Know the response of docker info

@datho7561
Copy link
Collaborator

datho7561 commented Feb 12, 2024

❯ docker info
bash: docker: command not found...
Packages providing this file are:
'podman-docker'
'moby-engine'

(docker isn't installed)

Here is the podman info:

❯ podman info
host:
  arch: amd64
  buildahVersion: 1.33.3
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.8-2.fc39.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.8, commit: '
  cpuUtilization:
    idlePercent: 84.24
    systemPercent: 1.93
    userPercent: 13.83
  cpus: 16
  databaseBackend: boltdb
  distribution:
    distribution: fedora
    variant: workstation
    version: "39"
  eventLogger: journald
  freeLocks: 2042
  hostname: davthomp-thinkpadp1gen4i.yyz.csb
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 109188
      size: 1
    - container_id: 1
      host_id: 165536
      size: 165536
    uidmap:
    - container_id: 0
      host_id: 109188
      size: 1
    - container_id: 1
      host_id: 165536
      size: 165536
  kernel: 6.7.3-200.fc39.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 35572551680
  memTotal: 67110932480
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.fc39.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.10.0
    package: netavark-1.10.1-5.fc39.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.10.1
  ociRuntime:
    name: crun
    package: crun-1.14-1.fc39.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.14
      commit: 667e6ebd4e2442d39512e63215e79d693d0780aa
      rundir: /run/user/109188/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20231230.gf091893-1.fc39.x86_64
    version: |
      pasta 0^20231230.gf091893-1.fc39.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/109188/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc39.x86_64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 0h 30m 44.00s
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/davthomp/.config/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 1
    stopped: 3
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/davthomp/.local/share/containers/storage
  graphRootAllocated: 1022488477696
  graphRootUsed: 266920759296
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 120
  runRoot: /run/user/109188/containers
  transientStore: false
  volumePath: /home/davthomp/.local/share/containers/storage/volumes
version:
  APIVersion: 4.9.0
  Built: 1706090847
  BuiltTime: Wed Jan 24 05:07:27 2024
  GitCommit: ""
  GoVersion: go1.21.6
  Os: linux
  OsArch: linux/amd64
  Version: 4.9.0

Since docker isn't installed, the docker daemon isn't running.

This is the info for the podman systemd service, but I think it works a bit differently from docker:

❯ systemctl status podman
○ podman.service - Podman API Service
     Loaded: loaded (/usr/lib/systemd/system/podman.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
TriggeredBy: ● podman.socket
       Docs: man:podman-system-service(1

@msivasubramaniaan
Copy link
Collaborator Author

❯ docker info
bash: docker: command not found...
Packages providing this file are:
'podman-docker'
'moby-engine'

(docker isn't installed)

Here is the podman info:

❯ podman info
host:
  arch: amd64
  buildahVersion: 1.33.3
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.8-2.fc39.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.8, commit: '
  cpuUtilization:
    idlePercent: 84.24
    systemPercent: 1.93
    userPercent: 13.83
  cpus: 16
  databaseBackend: boltdb
  distribution:
    distribution: fedora
    variant: workstation
    version: "39"
  eventLogger: journald
  freeLocks: 2042
  hostname: davthomp-thinkpadp1gen4i.yyz.csb
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 109188
      size: 1
    - container_id: 1
      host_id: 165536
      size: 165536
    uidmap:
    - container_id: 0
      host_id: 109188
      size: 1
    - container_id: 1
      host_id: 165536
      size: 165536
  kernel: 6.7.3-200.fc39.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 35572551680
  memTotal: 67110932480
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.fc39.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.10.0
    package: netavark-1.10.1-5.fc39.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.10.1
  ociRuntime:
    name: crun
    package: crun-1.14-1.fc39.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.14
      commit: 667e6ebd4e2442d39512e63215e79d693d0780aa
      rundir: /run/user/109188/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20231230.gf091893-1.fc39.x86_64
    version: |
      pasta 0^20231230.gf091893-1.fc39.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/109188/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc39.x86_64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 0h 30m 44.00s
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/davthomp/.config/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 1
    stopped: 3
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/davthomp/.local/share/containers/storage
  graphRootAllocated: 1022488477696
  graphRootUsed: 266920759296
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 120
  runRoot: /run/user/109188/containers
  transientStore: false
  volumePath: /home/davthomp/.local/share/containers/storage/volumes
version:
  APIVersion: 4.9.0
  Built: 1706090847
  BuiltTime: Wed Jan 24 05:07:27 2024
  GitCommit: ""
  GoVersion: go1.21.6
  Os: linux
  OsArch: linux/amd64
  Version: 4.9.0

Since docker isn't installed, the docker daemon isn't running.

This is the info for the podman systemd service, but I think it works a bit differently from docker:

❯ systemctl status podman
○ podman.service - Podman API Service
     Loaded: loaded (/usr/lib/systemd/system/podman.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
TriggeredBy: ● podman.socket
       Docs: man:podman-system-service(1

Can you please stop the container podman stop container_id and try to check the above case

@datho7561
Copy link
Collaborator

Can you please stop the container podman stop container_id

There are no running containers. There are three stopped containers. I'll try deleting them, I don't think this will fix detection of podman though. It seems Dockerode tries to communicate with podman using /var/run/docker.sock, but this won't work on my computer, since this file doesn't exist since I only have podman installed.

Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
@msivasubramaniaan
Copy link
Collaborator Author

@datho7561 added a case for check on podman if no docker on the machine. Please take a look and I hope it will resolve your case

Copy link
Collaborator

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

Looks good and works for me. Thank you Muthu! Sorry about the long review process.

@msivasubramaniaan
Copy link
Collaborator Author

Looks good and works for me. Thank you Muthu! Sorry about the long review process.

no worries @datho7561. It always good to cover all the scenario. Thanks for your review

@msivasubramaniaan msivasubramaniaan merged commit e33d00d into redhat-developer:main Feb 13, 2024
6 checks passed
@msivasubramaniaan msivasubramaniaan deleted the 3638-show-vscode-notification-message-if-docker-is-not-started-for-fn-commands branch February 13, 2024 18:15
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.

Show vscode notification message if docker is not started for Fn commands
3 participants