cli icon indicating copy to clipboard operation
cli copied to clipboard

[WIP]feature/podman: Updating dapr cli to allow different container runtime

Open pravinpushkar opened this issue 1 year ago • 4 comments

Description

This is to continue work on - https://github.com/dapr/cli/pull/948

Taken from original PR -

Adding a new argument --container-runtime to be passed during dapr init and dapr uninstall commands. This allows a user to provide a container runtime environment such as podman where in some instances docker is unavailable.

This would be used to stand up a repeatable Dapr environment with the placement, zipkin and redis containers in the desired container runtime environment.

The default container runtime is docker, therefore the behavior is unaltered unless we provide podman as the runtime.

Example:

# Install Dapr using podman as container runtime
$ dapr init --container-runtime podman

# Uninstall Dapr using podman as container runtime
$ dapr uninstall --cotnainer-runtime podman

Issue reference

Please reference the issue this PR will close: #257

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • [ ] Code compiles correctly
  • [ ] Created/updated tests
  • [ ] Extended the documentation

pravinpushkar avatar Aug 09 '22 06:08 pravinpushkar

@pravinpushkar Please fix failures .. Also enable e2e to run on macOS-latest with brew install podman .

mukundansundar avatar Aug 09 '22 09:08 mukundansundar

Codecov Report

Merging #1041 (bce94b2) into master (d229506) will decrease coverage by 0.10%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1041      +/-   ##
==========================================
- Coverage   29.34%   29.24%   -0.11%     
==========================================
  Files          35       35              
  Lines        2334     2342       +8     
==========================================
  Hits          685      685              
- Misses       1574     1582       +8     
  Partials       75       75              
Impacted Files Coverage Δ
pkg/standalone/container.go 0.00% <0.00%> (ø)
pkg/standalone/standalone.go 4.55% <0.00%> (-0.05%) :arrow_down:
pkg/standalone/uninstall.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 10 '22 10:08 codecov[bot]

@mukundansundar With podman also, sometime podman machine start gets stuck. But with re-run the tests couple of times, it works. RN in the current PR I have configured the macos tests to use podman. As you can see all tests except uninstall is passing. I am facing a peculiar issue with uninstall whereas it is passing locally but failing in github action.

pravinpushkar avatar Aug 12 '22 09:08 pravinpushkar

@mukundansundar With podman also, sometime podman machine start gets stuck. But with re-run the tests couple of times, it works. RN in the current PR I have configured the macos tests to use podman. As you can see all tests except uninstall is passing. I am facing a peculiar issue with uninstall whereas it is passing locally but failing in github action.

Could this be the issue ?

$ docker rmi -f daprio/dapr 
Error: No such image: daprio/dapr
$ # Exits without error 

$ podman rmi -f daprio/dapr 
Error: daprio/dapr: image not known
$ # Exits with error 

@pravinpushkar

mukundansundar avatar Aug 12 '22 16:08 mukundansundar

@mukundansundar With podman also, sometime podman machine start gets stuck. But with re-run the tests couple of times, it works. RN in the current PR I have configured the macos tests to use podman. As you can see all tests except uninstall is passing. I am facing a peculiar issue with uninstall whereas it is passing locally but failing in github action.

Could this be the issue ?

$ docker rmi -f daprio/dapr 
Error: No such image: daprio/dapr
$ # Exits without error 

$ podman rmi -f daprio/dapr 
Error: daprio/dapr: image not known
$ # Exits with error 

@pravinpushkar

Actually the issue was we are using import dockerClient "github.com/docker/docker/client" in tests for verifying the containers and it expects api forwarding to listen on /var/run/docker.sock but with podman api forwarding listens on /Users/runner/.local/share/containers/podman/machine/podman-machine-default/podman.sock. There are two approach I can think of -

  1. There is a utility that comes with podman podman-mac-helper install which makes api forwarding to listen same as docker.
  2. Using slim mode for macos tests.

I have made the changes using 1st approach i.e. podman-mac-helper install. @mukundansundar

pravinpushkar avatar Aug 18 '22 11:08 pravinpushkar

Is there any update to implement this on dapr for windows as well?

VinuelMancent avatar Sep 22 '22 13:09 VinuelMancent

Is there any update to implement this on dapr for windows as well?

Are you facing any issue while running dapr with Podman on Windows ? I believe if Podman can be installed on windows then dapr should work as expected. Kindly check Podman docs for installation on windows.

pravinpushkar avatar Oct 07 '22 09:10 pravinpushkar