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

[FEATURE] Podman support #584

Open
mwester117 opened this issue Jul 31, 2023 · 1 comment
Open

[FEATURE] Podman support #584

mwester117 opened this issue Jul 31, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request podman v2

Comments

@mwester117
Copy link

Hi,
since the 1.5.0 release Bunkerweb is no longer working on Podman, because the new scheduler container needs docker API access. Of course you can enable the Docker compatibility socket of Podman but I'm looking for a solutions without the socket.

Is it possible to run Bunkerweb on Podman without the compatibility socket?

@mwester117 mwester117 added the enhancement New feature or request label Jul 31, 2023
@mwester117
Copy link
Author

My attempts to run the bw-docker-proxy container and scheduler under podman were not successful.

I started the socket with this command (rootless):

systemctl --user enable --now podman.socket

The socket now exists under /run/user/1001/podman/podman.sock.

Afterwards I created the containers as described in the documentation:

podman run -d --pod bunkerweb-pod -e CONTAINERS=1 -v /run/user/$(id -u)/podman/podman.sock:/var/run/docker.sock:ro,Z --name bw-docker-proxy docker.io/tecnativa/docker-socket-proxy:0.1
podman run -d --pod bunkerweb-pod -e DOCKER_HOST=tcp://127.0.0.1:2375 -v bw-data:/data:Z --name bw-scheduler docker.io/bunkerity/bunkerweb-scheduler:latest

No I get the following errors in the bw-scheduler container:

$ podman logs bw-scheduler 
[2023-07-31 13:01:55] - ENTRYPOINT - ℹ️ - Starting the job scheduler v1.5.0 ...
[2023-07-31 13:01:55] - ENTRYPOINT - ℹ️ - Setup and check /data folder ...
[2023-07-31 13:01:55] - ENTRYPOINT - ℹ️  - Executing scheduler ...
[2023-07-31 13:01:57] - SCHEDULER - ℹ️  - Database connection established
[2023-07-31 13:01:57] - SCHEDULER - ℹ️  - Scheduler started ...
[2023-07-31 13:01:57] - SCHEDULER - ❌ - Exception while executing scheduler : Traceback (most recent call last):
  File "/usr/share/bunkerweb/deps/python/docker/api/client.py", line 268, in _raise_for_status
    response.raise_for_status()
  File "/usr/share/bunkerweb/deps/python/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: http://127.0.0.1:2375/version

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/share/bunkerweb/deps/python/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/docker/api/client.py", line 274, in _result
    self._raise_for_status(response)
  File "/usr/share/bunkerweb/deps/python/docker/api/client.py", line 270, in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/docker/errors.py", line 39, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
docker.errors.APIError: 503 Server Error for http://127.0.0.1:2375/version: Service Unavailable ("b'<html><body><h1>503 Service Unavailable</h1>\nNo server is available to handle this request.\n</body></html>'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/bunkerweb/scheduler/main.py", line 212, in <module>
    api_caller.auto_setup(bw_integration=integration)
  File "/usr/share/bunkerweb/utils/ApiCaller.py", line 56, in auto_setup
    docker_client = DockerClient(
                    ^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: 503 Server Error for http://127.0.0.1:2375/version: Service Unavailable ("b'<html><body><h1>503 Service Unavailable</h1>\nNo server is available to handle this request.\n</body></html>'")

[2023-07-31 13:01:57] - ENTRYPOINT - ℹ️  - Scheduler stopped

The bw-docker-proxy output looks like this:

$ podman logs bw-docker-proxy 
[WARNING] 211/130001 (1) : Can't open server state file '/var/lib/haproxy/server-state': No such file or directory
Proxy dockerbackend started.
Proxy dockerfrontend started.
[NOTICE] 211/130001 (1) : New worker #1 (6) forked
127.0.0.1:59920 [31/Jul/2023:13:00:16.782] dockerfrontend dockerbackend/dockersocket 0/0/-1/-1/0 503 213 - - SC-- 1/1/0/0/3 0/0 "GET /version HTTP/1.1"
127.0.0.1:48194 [31/Jul/2023:13:01:57.354] dockerfrontend dockerbackend/dockersocket 0/0/-1/-1/0 503 213 - - SC-- 1/1/0/0/3 0/0 "GET /version HTTP/1.1"
127.0.0.1:58992 [31/Jul/2023:13:02:45.726] dockerfrontend dockerfrontend/<NOSRV> 0/-1/-1/-1/0 403 189 - - PR-- 1/1/0/0/0 0/0 "GET / HTTP/1.1"
127.0.0.1:56972 [31/Jul/2023:13:02:55.869] dockerfrontend dockerbackend/dockersocket 0/0/-1/-1/0 503 213 - - SC-- 1/1/0/0/3 0/0 "GET /version HTTP/1.1"

Need assistance. A solution without using the docker compatibility socket would be fine as well.
Thanks!

@fl0ppy-d1sk fl0ppy-d1sk self-assigned this Aug 1, 2023
@fl0ppy-d1sk fl0ppy-d1sk added this to TODO in 1.5.X Aug 1, 2023
@fl0ppy-d1sk fl0ppy-d1sk moved this from TODO to 1.5.2 in 1.5.X Aug 1, 2023
@fl0ppy-d1sk fl0ppy-d1sk moved this from 1.5.2 to 1.5.3 in 1.5.X Sep 10, 2023
@fl0ppy-d1sk fl0ppy-d1sk added the v2 label Oct 16, 2023
@fl0ppy-d1sk fl0ppy-d1sk removed this from 1.5.3 in 1.5.X Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request podman v2
Projects
None yet
Development

No branches or pull requests

3 participants