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

Use podman for the molecule test #165

Closed
3 of 4 tasks
RMPR opened this issue Mar 18, 2020 · 7 comments
Closed
3 of 4 tasks

Use podman for the molecule test #165

RMPR opened this issue Mar 18, 2020 · 7 comments

Comments

@RMPR
Copy link

RMPR commented Mar 18, 2020

  • Subscribe to the system roles mailing list and send an introduction message. Tell us which area interests you and why you would like to participate
  • Take a look at the integration tests and try to get them running. The are run by a custom CI tool and are inspired by the Standard Test Interface
  • Get the unit and linting tests running using tox
  • Optional: Get the molecule tests running by running tox -e molecule (this requires being able to run docker as the current user)

When I try to run tox -e molecule I get

ERROR: Unable to contact the Docker daemon. Please refer to https://docs.docker.com/config/daemon/ for managing the daemon

Which is not surprising because I don't have docker installed, but on the flip side I have podman installed and since from the whatis podman page it's said that:

Simply put: alias docker=podman

It's my understanding that there's a way to run this test if the user has podman instead of docker.
Am I right? If yes can you provide some guidance on how to work around this issue?
Thanks.

@richm
Copy link
Contributor

richm commented Mar 18, 2020

molecule v3 supposedly has support for podman - I tried several things to get podman to work with molecule but I could never get it to work. If you can figure out how to make it work, patches are welcome.

@tyll
Copy link
Member

tyll commented Mar 18, 2020

When I try to run tox -e molecule I get

ERROR: Unable to contact the Docker daemon. Please refer to https://docs.docker.com/config/daemon/ for managing the daemon

Which is not surprising because I don't have docker installed, but on the flip side I have podman installed and since from the whatis podman page it's said that:

Simply put: alias docker=podman

It's my understanding that there's a way to run this test if the user has podman instead of docker.
Am I right? If yes can you provide some guidance on how to work around this issue?

Is the error message from when you tried this alias with molecule? What system are you using? What happens when you try to run molecule with podman?

@RMPR
Copy link
Author

RMPR commented Mar 19, 2020

Yes, I aliased docker to podman and I also created a symlink at /usr/bin/docker because some programs relied on that.
OS: Fedora 31 Workstation.
I tried to change the line requiring docker to podman #166 but still an error, the last five lines of the stacktrace:

--> Sanity checks: 'docker'
ERROR: Missing Docker driver dependency. Please install via 'molecule[docker]' or refer to your INSTALL.rst driver documentation file
ERROR: InvocationError for command /usr/bin/bash .travis/runsyspycmd.sh .tox/env-molecule/bin/python /usr/bin/python3 molecule syntax -s default (exited with code 1)
___________________________________________________________________________________________ summary ____________________________________________________________________________________________
ERROR:   molecule: commands failed

Which is surprising because when I run the tests with the change mentioned in the PR, on the second line I get podman as an install dep:

molecule installdeps: ansible, podman, molecule<3, selinux, -rmolecule_extra_requirements.txt

@tyll
Copy link
Member

tyll commented Mar 23, 2020

Yes, I aliased docker to podman and I also created a symlink at /usr/bin/docker because some programs relied on that.
OS: Fedora 31 Workstation.
I tried to change the line requiring docker to podman #166 but still an error, the last five lines of the stacktrace:

--> Sanity checks: 'docker'
ERROR: Missing Docker driver dependency. Please install via 'molecule[docker]' or refer to your INSTALL.rst driver documentation file
ERROR: InvocationError for command /usr/bin/bash .travis/runsyspycmd.sh .tox/env-molecule/bin/python /usr/bin/python3 molecule syntax -s default (exited with code 1)
___________________________________________________________________________________________ summary ____________________________________________________________________________________________
ERROR:   molecule: commands failed

Which is surprising because when I run the tests with the change mentioned in the PR, on the second line I get podman as an install dep:

molecule installdeps: ansible, podman, molecule<3, selinux, -rmolecule_extra_requirements.txt

You need at least molecule V3 to try podman. https://github.com/tyll/network/tree/molecule_podman contains a quick try from my side but it is failing with:

"msg": "Unable to gather info for 'molecule_local/centos-7': time=\"2020-03-23T19:14:19+01:00\" level=error msg=\"failed to setup podman build flags: failed to get container config: cannot stat /root/.config/containers/storage.conf: stat /root/.config/containers/storage.conf: permission denied\"\nError: could not get runtime: cannot stat /root/.config/containers/storage.conf: stat /root/.config/containers/storage.conf: permission denied\n"

@richm what errors did you see? What did you try?
@RMPR if you want to follow-up, please ask the Ansible molecule community for help. As an alternative to get this running on your system, you can try my Vagrantfile from https://github.com/tyll/vagrant-nmstate that sets up a F29 VM to be used with docker.

@tyll
Copy link
Member

tyll commented Mar 23, 2020

Other issues with molecule/podman: containers/podman#5046 ansible/ansible#67004

@richm
Copy link
Contributor

richm commented Mar 23, 2020

@richm what errors did you see? What did you try?

I tried upgrading to molecule v3 first, then configured molecule to use podman. I got a lot of selinux errors (I run with Enforcing mode). Once I solved all of those, I ran into ansible/ansible#67004 - then I gave up

I get the general impression that, in order to get molecule + podman working well, some developer is going to have to woodshed this for a while . . .

@tyll
Copy link
Member

tyll commented Apr 9, 2020

I opened linux-system-roles/template#21 to track the progress there since it is not specific for the network role.

@tyll tyll closed this as completed Apr 9, 2020
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

No branches or pull requests

3 participants