Feat podman runner#17786
Conversation
| self.podman_user_name = self.configfile.run.user or 'root' | ||
| self.podman_user_home = f'/{"home/" if self.podman_user_name != "root" else ""}{self.podman_user_name}' | ||
| self.abs_podman_path = os.path.join(f'{self.podman_user_home}/conanrunner', os.path.basename(self.abs_host_path)).replace("\\","/") |
There was a problem hiding this comment.
Here I'm placing the conanrunner folder in the user home. This is slightly different from what is done for the docker runner.
| workdir = workdir or self.abs_podman_path | ||
| if log: | ||
| _podman_info(f'Running in container: "{command}"') | ||
| _, exec_output = self.container.exec_run(f"/bin/bash -c '{command}'", stream=True, workdir=workdir, demux=True) |
There was a problem hiding this comment.
Here, if I add tty=True, no output is returned. Can't really tell why.
| #exit_metadata = self.docker_api.exec_inspect(exec_instance['Id']) | ||
| #if exit_metadata['Running'] or exit_metadata['ExitCode'] > 0: | ||
| # raise RunnerException(command=command, stdout_log=stdout_log, stderr_log=stderr_log) |
There was a problem hiding this comment.
There seems to be no way to check for the command exit code while using stream=True.
| _, podman_build_logs = self.podman_client.images.build( | ||
| dockerfile=dockerfile_file_path, | ||
| path=build_path, | ||
| tag=self.image, | ||
| buildargs=self.configfile.build.build_args, | ||
| cache_from=self.configfile.build.cache_from, | ||
| ) | ||
| for chunk in podman_build_logs: | ||
| for line in chunk.decode("utf-8").split('\r\n'): | ||
| if line: | ||
| stream = json.loads(line).get('stream') | ||
| if stream: | ||
| ConanOutput().status(stream.strip()) |
There was a problem hiding this comment.
No streaming of the output here. The output of the build command is spit out all at once.
|
Where is this one at @dyamon ? This is a feature that I'd find useful so keen for it to make it in. Is it worth unmarking this as draft? |
|
@samuel-emrys hey, I guess I was looking for some feedback on the comments I left. Honestly it works for me but it still needs testing and documentation. Did you get the chance to try it? |
|
Hi @samuel-emrys, Thank you very much for your contribution to Conan! 🙌 We had a look at your PR when it was opened and it looks very promising. At the moment, we’re focusing on finalizing and merging the next runners in our roadmap (SSH and WSL). In parallel, we’d like to gather more feedback from users of the existing Docker runner and make some refinements to it before introducing additional runners. For that reason, we’d prefer to hold off on adding new ones until the current implementation is more mature. We really appreciate your effort and initiative here, and we hope you understand the reasoning. Your contribution is valuable, and we’d be happy to revisit this once the Docker runner stabilizes further. Thanks again for your patience and support! |
|
@perseoGI would love to take credit for this work but it was @dyamon who put in the hard yards to bring this together. The response is a bit of a shame though - RHEL doesn't ship with Is there a way that runners can be provided as extensions to allow us to manage these independently of the conan client? |
Greetings, I'll propose this idea in our next "look intos", thank you! |
Changelog: (Feature): Add podman runner
Docs: https://github.com/conan-io/docs/pull/XXXX (TBD)
The first commit of the pull request is a plain copy of
runner/docker.pyintorunner/podman.py. This makes the second commit an actual overview of the differences between the two runners.I'm leaving a couple of comments on the code to highlight some potential issue with this runner. Then, I guess, we can move to tests and documentation.
developbranch, documenting this one.Closes #17743