Feature request podman support #67528
Replies: 27 comments
-
|
will approve as a feature request |
Beta Was this translation helpful? Give feedback.
-
|
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 |
Beta Was this translation helpful? Give feedback.
-
|
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. |
Beta Was this translation helpful? Give feedback.
-
|
The podman python has it's own module: |
Beta Was this translation helpful? Give feedback.
-
|
I agree with @fignew, this becomes a more pressing issue with the lack of Docker packages with Fedora and RHEL/CentOS 8. |
Beta Was this translation helpful? Give feedback.
-
|
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. |
Beta Was this translation helpful? Give feedback.
-
|
Please keep this open, podman support would be beneficial to saltstack. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for updating this issue. It is no longer marked as stale. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, It will be great if SaltStack provide Podman support. Please keep open this. |
Beta Was this translation helpful? Give feedback.
-
|
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. |
Beta Was this translation helpful? Give feedback.
-
|
ZD-4685 |
Beta Was this translation helpful? Give feedback.
-
|
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.confHere 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/ |
Beta Was this translation helpful? Give feedback.
-
|
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? |
Beta Was this translation helpful? Give feedback.
-
|
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 :) |
Beta Was this translation helpful? Give feedback.
-
|
Another progress update: first successful launch of a Podman container using Salt docker module containers/podman#5580 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
@max-arnold that's sounds great!!! |
Beta Was this translation helpful? Give feedback.
-
|
Hey @max-arnold, what's the status? |
Beta Was this translation helpful? Give feedback.
-
|
@aboe76 @paususe I think I got a single podman container running with some issues, I hope I can find some time this August to document and upload my WIP code here |
Beta Was this translation helpful? Give feedback.
-
|
@max-arnold nice work, thanks for the status update. |
Beta Was this translation helpful? Give feedback.
-
|
@max-arnold any updates? Been looking for this as well and interested in contributing. |
Beta Was this translation helpful? Give feedback.
-
|
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. |
Beta Was this translation helpful? Give feedback.
-
|
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! |
Beta Was this translation helpful? Give feedback.
-
|
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 :) |
Beta Was this translation helpful? Give feedback.
-
|
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. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @max-arnold any updates? It seems that we are close but just barely not quite there yet! |
Beta Was this translation helpful? Give feedback.
-
|
@DaAwesomeP Unfortunately, I no longer work on this. Feel free to pick it up and continue the work. |
Beta Was this translation helpful? Give feedback.
-
|
I'm trying to use salt with podman, and the approach I'm doing is using podman quadlets. hello.container |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
Beta Was this translation helpful? Give feedback.
All reactions