Open D3vil0p3r opened 4 weeks ago
Hello
Thanks for this PR, it is indeed a more complete approach to integrate podman in a stable way in Exegol. A few comments:
__connect_to_[...]
function and therefore never retrieved by the __handle_connection_error
functionThanks in any case for your help with this integration, there will be a lot of testing to do to make sure everything is compatible with podman and exegol before officially integrating it into the project, but it's certainly a very good starting point.
I'll try to give answer
- for the filter, you should test whether “docker.io/” would not be necessary in the current version of the lib.
Already tried, it is not an issue related to the input string, but an issue at code level. And I wouldn't suggest to add
docker.io
onIMAGE_NAME
constant. I would keep it as is because docker does not add that registry name, and adding it could break someif
statements.
- the way DockerUtils tries to load docker or podman doesn't seem right to me, as the original exceptions are caught in the
__connect_to_[...]
function and therefore never retrieved by the__handle_connection_error
functionIt can be changed. I did that proposal but I'm sure there are better ways to explore. PS: in the future
DockerUtils
can be renamed asContainerUtils
.
- your branch is not up to date with the dev version (which should soon be a new release), there are conflicts to manage
Probably because in the last days Exegol devs submitted new commits after the time I opened my PR. We can manage them once the PR is ready.
- is the fact that the podman lib is the same as the docker lib done on purpose? aren't there risks of divergence at times?
Not all functions are the same. The risk of divergence depends on how we will adapt podman on Exegol. On this PR we are not using Docker Py functions to manage podman daemon, but we are invoking original Podman Py libs to manage its daemon.
Overall, before to continue to work on this PR, I think we need to wait for those issues/PRs I opened on Podman Py project.
Description
Refactoring code to support Podman
Point of attention
TO DO
DockerUtils.py:
api.pull/build/remove_volume
function to podman: https://github.com/containers/podman-py/issues/456ConstantConfig.IMAGE_NAME in [repo_tag.split(':')[0] for repo_tag in img.attrs.get("RepoTags", [])]:
does not manage well cases where user pulled manually exegol image containing also the registry name, for exampledocker.io/nwodtuhs/exegol
. In this scenario, it won't enter in if statement. It is needed to addany
to manage cases where locally I have more container images. [Fixed in PR]ExegolImage.py:
As above, cannot enter in if statement in case user pulled manually an image by specifying
docker.io
. Need to usein
instead ofstartswith
. [Fixed in PR]Evaluate if it is needed to manage
if
statements involvingConstantConfig.IMAGE_NAME
in other files to manage the presence of prefixdocker.io
in the image name.ExegolController.py - Import
podman
and manageconsole.print_exception(show_locals=True, suppress=[docker, requests, git])
to consider podman module too.ConstantConfig.py:
from docker.types import Mount
for podman: https://github.com/containers/podman-py/issues/458