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

Using with Podman #21

Open
marcelned opened this issue Aug 19, 2021 · 3 comments
Open

Using with Podman #21

marcelned opened this issue Aug 19, 2021 · 3 comments
Labels
✨ enhancement New feature or request

Comments

@marcelned
Copy link

Attempting to use with Podman on RHEL8 results in the following error:

(hub_env) [root@*******]# dockernel install localhost/pyspark:3.2 --name spark-env
Traceback (most recent call last):
  File "/data/mambaforge-pypy3/envs/hub_env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/data/mambaforge-pypy3/envs/hub_env/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/data/mambaforge-pypy3/envs/hub_env/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/data/mambaforge-pypy3/envs/hub_env/lib/python3.9/http/client.py", line 1303, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/data/mambaforge-pypy3/envs/hub_env/lib/python3.9/http/client.py", line 1252, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/data/mambaforge-pypy3/envs/hub_env/lib/python3.9/http/client.py", line 1012, in _send_output
    self.send(msg)
  File "/data/mambaforge-pypy3/envs/hub_env/lib/python3.9/http/client.py", line 952, in send
    self.connect()
  File "/data/mambaforge-pypy3/envs/hub_env/lib/python3.9/site-packages/docker/transport/unixconn.py", line 43, in connect
    sock.connect(self.unix_socket)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Any idea on this? Podman is a daemonless, non-root process so I thought it would integrate well. I did alias docker=podman to no avail

@MrMino
Copy link
Owner

MrMino commented Aug 20, 2021

Hi @marcelned. Dockernel uses Docker API (the Python library), not Docker CLI, and so substituting docker command with podman will have no effect.

It might be that I'm completely misunderstanding the issue, but I'm going on a vacation shortly, so I'm unable to analyze this deeper.

I haven't used podman, but if you'd like dockernel to support it - I'll consider looking into it. That will have to wait until I can shift my focus back onto dockernel, as currently I'm a bit busy with other projects.

@marcelned
Copy link
Author

I got it working manually by adapting from this answer

kernel.json:

{
 "argv": [
  "/usr/bin/podman",
  "run",
  "--rm",
  "--network=host",
  "-v",
  "{connection_file}:/connection-spec:z",
  "-v",
  ".:/work:z",
  "localhost/pyspark:3.2",
  "python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "/connection-spec"
 ],
 "display_name": "spark-env",
 "language": "python"
}

Adding the current work directory to bind as volume, with /work set as WORKDIR in dockerfile, works like a charm.

@MrMino
Copy link
Owner

MrMino commented Aug 31, 2021

Looks like Podman actually comes with a REST API. The claim is that it is similar to that of Docker, so it should be possible to marry Dockernel with it.

I'll make sure to steer the source code towards enabling backend plularity, but I conside the implementation of Podman as a backend a low priority for now.

@MrMino MrMino added the ✨ enhancement New feature or request label Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants