-
Notifications
You must be signed in to change notification settings - Fork 570
feat: Add Podman rootless support alongside Docker #1608
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
Open
hari-kuriakose
wants to merge
7
commits into
main
Choose a base branch
from
feat/podman
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+180
−19
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ff52fe4
feat: change port to support rootless feat: (breaking) change localhost
hari-kuriakose aac3bf3
chore: updated gitignore
hari-kuriakose 35878f3
Merge branch 'main' into feat/podman
hari-kuriakose 3a3f072
refactor: simplify socket detection to default to Docker
hari-kuriakose 41fa817
Merge branch 'main' into feat/podman
hari-kuriakose a61e3e5
Merge branch 'main' into feat/podman
hari-kuriakose b03b5eb
Merge branch 'main' into feat/podman
hari-kuriakose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -713,3 +713,6 @@ CONTRIBUTION_GUIDE.md | |
| .qodo | ||
| .windsurfrules | ||
| .windsurf/rules | ||
|
|
||
| # MCP servers | ||
| .serena | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| # Container Runtime Support (Docker & Podman) | ||
|
|
||
| The Unstract docker-compose configuration supports both **Docker** (default) and **Podman**. | ||
|
|
||
| ## Socket Detection | ||
|
|
||
| The configuration defaults to Docker and supports Podman via environment variable: | ||
| - **Docker**: Default (`/var/run/docker.sock`) - no configuration needed | ||
| - **Podman**: Set `DOCKER_SOCKET=${XDG_RUNTIME_DIR}/podman/podman.sock` | ||
|
|
||
| ## Using Docker | ||
|
|
||
| Docker works out of the box with no additional configuration: | ||
|
|
||
| ```bash | ||
| VERSION=main docker-compose -f docker-compose.yaml up -d | ||
| ``` | ||
|
|
||
| The Docker socket at `/var/run/docker.sock` is used automatically. | ||
|
|
||
| ## Using Podman | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| 1. **Enable Podman socket** (required for Traefik to discover containers): | ||
| ```bash | ||
| systemctl --user enable podman.socket | ||
| systemctl --user start podman.socket | ||
| ``` | ||
|
|
||
| 2. **Verify socket is running**: | ||
| ```bash | ||
| systemctl --user status podman.socket | ||
| # Should show: active (listening) | ||
| ``` | ||
|
|
||
| ### Run with Podman | ||
|
|
||
| Set the `DOCKER_SOCKET` environment variable to point to Podman socket, then run podman-compose: | ||
|
|
||
| ```bash | ||
| export DOCKER_SOCKET=${XDG_RUNTIME_DIR}/podman/podman.sock | ||
| VERSION=main podman-compose -f docker-compose.yaml up -d | ||
| ``` | ||
|
|
||
| **Note**: The `DOCKER_SOCKET` environment variable must be set to use Podman instead of the default Docker socket. | ||
|
|
||
| ## Custom Socket Path | ||
|
|
||
| If you need to specify a custom socket path, set the `DOCKER_SOCKET` environment variable: | ||
|
|
||
| ```bash | ||
| # Example: Custom Docker socket location | ||
| export DOCKER_SOCKET=/custom/path/docker.sock | ||
| VERSION=main docker-compose -f docker-compose.yaml up -d | ||
|
|
||
| # Example: Alternative Podman socket location | ||
| export DOCKER_SOCKET=/run/user/$(id -u)/podman/podman.sock | ||
| VERSION=main podman-compose -f docker-compose.yaml up -d | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Traefik shows "Cannot connect to Docker daemon" | ||
|
|
||
| **For Podman users**: | ||
| 1. Check if Podman socket is running: | ||
| ```bash | ||
| systemctl --user status podman.socket | ||
| ``` | ||
|
|
||
| 2. If inactive, start it: | ||
| ```bash | ||
| systemctl --user start podman.socket | ||
| ``` | ||
|
|
||
| 3. Verify socket file exists: | ||
| ```bash | ||
| ls -la $XDG_RUNTIME_DIR/podman/podman.sock | ||
| # Should show: srw-rw---- (socket file, not directory) | ||
| ``` | ||
|
|
||
| 4. If it's a directory (wrong), remove and restart: | ||
| ```bash | ||
| rmdir $XDG_RUNTIME_DIR/podman/podman.sock | ||
| systemctl --user restart podman.socket | ||
| ``` | ||
|
|
||
| **For Docker users**: | ||
| 1. Check if Docker daemon is running: | ||
| ```bash | ||
| systemctl status docker | ||
| ``` | ||
|
|
||
| 2. Verify socket permissions: | ||
| ```bash | ||
| ls -la /var/run/docker.sock | ||
| ``` | ||
|
|
||
| ### Port 8081 not accessible | ||
|
|
||
| This is the Traefik HTTP port for Podman rootless compatibility. | ||
|
|
||
| 1. Check if Traefik container is running: | ||
| ```bash | ||
| podman ps | grep unstract-proxy | ||
| # or | ||
| docker ps | grep unstract-proxy | ||
| ``` | ||
|
|
||
| 2. Check Traefik logs: | ||
| ```bash | ||
| podman logs unstract-proxy | ||
| # or | ||
| docker logs unstract-proxy | ||
| ``` | ||
|
|
||
| ## Socket Path Priority | ||
|
|
||
| The configuration uses this simple priority: | ||
|
|
||
| 1. `$DOCKER_SOCKET` - if explicitly set (use this for Podman or custom paths) | ||
| 2. `/var/run/docker.sock` - default (Docker standard socket) | ||
|
|
||
| **Docker**: No configuration needed - uses default socket | ||
| **Podman**: Set `export DOCKER_SOCKET=${XDG_RUNTIME_DIR}/podman/podman.sock` | ||
|
|
||
| ## Technical Details | ||
|
|
||
| The docker-compose files use this volume mount configuration: | ||
|
|
||
| ```yaml | ||
| volumes: | ||
| - ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock | ||
| ``` | ||
|
|
||
| This means: | ||
| - If `DOCKER_SOCKET` is set → use that path (for Podman or custom Docker socket) | ||
| - Else → use `/var/run/docker.sock` (Docker default) | ||
|
|
||
| **For Podman users:** | ||
| ```bash | ||
| export DOCKER_SOCKET=${XDG_RUNTIME_DIR}/podman/podman.sock | ||
| ``` | ||
|
|
||
| This overrides the default Docker socket with the Podman socket path. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,6 @@ services: | |
| - ./workflow_data:/data | ||
| - ${TOOL_REGISTRY_CONFIG_SRC_PATH}:/data/tool_registry_config | ||
|
|
||
|
|
||
| # Celery worker for managing logs and periodic tasks | ||
| worker-logging: | ||
| image: unstract/backend:${VERSION} | ||
|
|
@@ -154,8 +153,8 @@ services: | |
| - ../backend/.env | ||
| - ./essentials.env | ||
| depends_on: | ||
| - db | ||
| - rabbitmq | ||
| - db | ||
| - rabbitmq | ||
| environment: | ||
| - ENVIRONMENT=development | ||
| - APPLICATION_NAME=unstract-celery-beat | ||
|
|
@@ -166,7 +165,7 @@ services: | |
| container_name: unstract-frontend | ||
| restart: unless-stopped | ||
| ports: | ||
| - "3000:80" | ||
| - "3000:8080" | ||
| depends_on: | ||
| - backend | ||
| - reverse-proxy | ||
|
|
@@ -175,6 +174,7 @@ services: | |
| labels: | ||
| - traefik.enable=true | ||
| - traefik.http.routers.frontend.rule=Host(`frontend.unstract.localhost`) && !PathPrefix(`/api/v1`, `/deployment`) | ||
| - traefik.http.services.frontend.loadbalancer.server.port=8080 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hari-kuriakose is this config necessary? looking at our existing backend configuration I can't see such a configuration |
||
|
|
||
| platform-service: | ||
| image: unstract/platform-service:${VERSION} | ||
|
|
@@ -232,8 +232,10 @@ services: | |
| - ../runner/.env | ||
| volumes: | ||
| - ./workflow_data:/data | ||
| # Docker socket bind mount to spawn tool containers | ||
| - /var/run/docker.sock:/var/run/docker.sock | ||
| # Socket mount for container runtime (defaults to Docker) | ||
| # Docker: /var/run/docker.sock (default) | ||
| # Podman: Set DOCKER_SOCKET=${XDG_RUNTIME_DIR}/podman/podman.sock | ||
| - ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock | ||
| depends_on: | ||
| - redis | ||
| - rabbitmq | ||
|
|
@@ -310,8 +312,8 @@ services: | |
| image: unstract/worker-unified:${VERSION} | ||
| container_name: unstract-worker-file-processing-v2 | ||
| restart: unless-stopped | ||
| # command: ["file-processing"] | ||
| command: [".venv/bin/celery", "-A", "worker", "worker", "--queues=file_processing,api_file_processing,file_processing_priority", "--loglevel=INFO", "--pool=prefork", "--concurrency=4", "--prefetch-multiplier=1", "--without-gossip", "--without-mingle", "--without-heartbeat"] | ||
| entrypoint: .venv/bin/celery | ||
| command: "-A worker worker --queues=file_processing,api_file_processing,file_processing_priority --loglevel=INFO --pool=prefork --concurrency=4 --prefetch-multiplier=1 --without-gossip --without-mingle --without-heartbeat" | ||
| ports: | ||
| - "8087:8082" | ||
| env_file: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hari-kuriakose why do we need to make this change exactly?