-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Feature request podman support #50624
Comments
will approve as a feature request |
I just starting looking into creating some podman modules. I think this is a good starting point: https://github.com/containers/libpod/tree/master/contrib/python/podman |
Now that both Fedora and RHEL/CentOS 8 no longer have Docker packages in their native repos I think that podman support is very much needed. |
The podman python has it's own module: |
I agree with @fignew, this becomes a more pressing issue with the lack of Docker packages with Fedora and RHEL/CentOS 8. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Please keep this open, podman support would be beneficial to saltstack. |
Thank you for updating this issue. It is no longer marked as stale. |
Yes, It will be great if SaltStack provide Podman support. Please keep open this. |
I did some initial research and found this: containers/python-podman#70 (comment) A couple of important highlights:
This potentially means that some of the existing Salt docker modules might be somewhat compatible with the upcoming Podman APIv2 endpoint. However, I'm not really familiar with Podman and not sure if APIv2 could provide a viable shortcut for Salt to support Podman containers eventually. |
ZD-4685 |
I made some progress trying to run podman containers using its new Docker-compatible API and the existing Installation instructions (Ubuntu 20.04, Salt 3001): Pip pkg:
pkg.installed:
- name: python3-pip
Podman repo:
pkgrepo.managed:
- name: deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /
- key_url: https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key
- file: /etc/apt/sources.list.d/podman.list
Podman pkg:
pkg.installed:
- name: podman
Podman service:
file.managed:
- name: /etc/systemd/system/podman.service
- source: salt://podman/podman.service
Podman socket:
file.managed:
- name: /etc/systemd/system/podman.socket
- source: salt://podman/podman.socket
service.running:
- name: podman.socket
- enable: true
Docker socket:
file.symlink:
- name: /var/run/docker.sock
- target: /var/run/podman/podman.sock
Docker python:
pip.installed:
- bin_env: /usr/bin/pip3
- reload_modules: true
- pkgs:
- certifi==2019.11.28
- chardet==3.0.4
- docker==4.2.1
- idna==2.9
# - requests==2.23.0
- six==1.14.0
- urllib3==1.25.8
- websocket-client==0.57.0
restart_salt_minion:
cmd.run:
- name: 'salt-call service.restart salt-minion'
- bg: true
- onchanges:
- pip: Docker python `podman.service`
`podman.socket`
By default any
To fix that, run the following command and restart salt-minion: echo "docker.version: '1.35'" > /etc/salt/minion.d/docker.conf Here is an incomplete list of docker functions that work (i.e., do not crash and output something meaningful):
There is one minor blocker that prevents
If you want to help, testing other docker functions/states and reporting any issues is appreciated. Podman developers tend to ask for shell-based reproducers, you can find a couple of examples here: containers/podman#5553. Please do not ask them to run any Salt commands to reproduce an issue :) To trace the HTTP requests that are made by Salt docker module, patch the --- sessions.py.orig 2020-08-04 00:28:13.977552983 -0700
+++ sessions.py 2020-08-04 00:20:30.776382799 -0700
@@ -530,7 +530,9 @@
'allow_redirects': allow_redirects,
}
send_kwargs.update(settings)
+ print('REQ', prep.method, prep.url, prep.body)
resp = self.send(prep, **send_kwargs)
+ print('RES', resp.text)
return resp
def get(self, url, **kwargs): The Docker API reference can be useful in comparing and reporting any inconsistencies: https://docs.docker.com/engine/api/v1.35/ |
Is the goal to make the current docker modules work with both docker and podman, or to introduce a new podman module with a docker virtualname? |
The current goal is to make the existing modules work with minimal or no changes (it was stated that docker-py should just work with Podman APIv2). If it turns out to be unachievable, then the only option left is to write a new set of Podman-specific state/execution modules using the new podman-py module that supports APIv2 (not to be confused with the obsolete python-podman that uses Podman Varlink protocol). Right now I'm only considering the easy path :) |
Another progress update: first successful launch of a Podman container using Salt docker module containers/podman#5580 (comment) |
@max-arnold that's sounds great!!! |
Hey @max-arnold, what's the status? |
@max-arnold nice work, thanks for the status update. |
@max-arnold any updates? Been looking for this as well and interested in contributing. |
I had to fiddle a bit with the environment (podman adds environment variables to running containers) to get docker_container.running to behave, but anything else I tried with podman 4.2 worked nicely. |
Here you go! The states were written in Feb 2021 and are outdated, but if anyone wants to continue the work, feel free to create a repo: These are not meant to be used in production, because Podman and its components are compiled from source (to be able to test the latest fixes). Kudos to @defensivedepth for making this happen! |
Spent some time updating the states with the latest and greatest versions:
For some reason the The primary issue that needs to be fixed is non-idempotent
P.S. Sorry for making you wait for so long. I procrastinated on publishing this WIP for a while :) |
Is there any update on this issue ? I tried to use podman and it mostly works, but It seems to assume there's a new imagem even though the image is exactly the same. |
Hey @max-arnold any updates? It seems that we are close but just barely not quite there yet! |
@DaAwesomeP Unfortunately, I no longer work on this. Feel free to pick it up and continue the work. |
Feature request salstack state/module support for podman
Saltstack has already support for docker please add podman support
Development Information to get started:
https://medium.com/cri-o/python3-support-for-podman-a0a2395c3b4
podman is already build for suse and kubic-project so it should fit well with suse manager 3
The text was updated successfully, but these errors were encountered: