From abb27c2caa116f6a44ab0e275e77e0fedc0a314c Mon Sep 17 00:00:00 2001 From: Dejan Vlasakov Date: Fri, 20 Feb 2026 10:39:56 +0200 Subject: [PATCH] Fix Podman and Gunicorn compatibility issues on Windows in OCI GenAI Gateway docs 1. Podman Volume Mount (Issue 1): Updated the podman run command to include a note on using absolute Windows paths for ~/.oci mounting, as Unix-style paths don't work reliably in Podman on Windows (requires shared/mounted directories in the Podman VM). 2. Gunicorn on Windows (Issue 2): Added a note under the production setup clarifying that Gunicorn is Linux-only and recommending alternatives like Uvicorn with PM2 or NSSM for Windows production scaling. 3. Base URL for Podman on Windows (Issue 3): Changed the recommended Base URL in n8n config from host.docker.internal (unreliable in Podman) to host.containers.internal, with fallbacks to localhost or explicit IP via --add-host for better cross-platform support. --- .../files/N8N-GenAIOCI-Connection.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ai/generative-ai-service/a-getting-started-guide/files/N8N-GenAIOCI-Connection.md b/ai/generative-ai-service/a-getting-started-guide/files/N8N-GenAIOCI-Connection.md index ebb831179a..432ef6c6a6 100644 --- a/ai/generative-ai-service/a-getting-started-guide/files/N8N-GenAIOCI-Connection.md +++ b/ai/generative-ai-service/a-getting-started-guide/files/N8N-GenAIOCI-Connection.md @@ -23,8 +23,9 @@ From the repo root: ``` For production (Linux only, with Gunicorn for scaling): ```bash - gunicorn app:app --workers 16 --worker-class uvicorn.workers.UvicornWorker --timeout 600 --bind 0.0.0.0:8088 + gunicorn app:app --workers 16 --worker-class uvicorn.workers.UvicornWorker --timeout 600 --bind 0.0.0.0:8088 ``` + - **Note**: For Windows, Gunicorn is not natively supported; use Uvicorn directly with a process manager like PM2 (via Node.js) or NSSM for production scaling. ### Option 2: Run with Podman (Containerized Deployment) @@ -36,9 +37,9 @@ From the repo root: 3. Build and run: ```bash podman build -t oci_genai_gateway . - podman run -p 8088:8088 \ - -v ~/.oci:/root/.oci:Z \ - -it --name oci_genai_gateway oci_genai_gateway + podman run -p 8088:8088 \ + -v ~/.oci:/root/.oci:Z \ # On Linux/macOS; on Windows, use an absolute path like -v C:/Users//.oci:/root/.oci:Z (ensure the directory is shared/mounted in Podman machine/VM) + -it --name oci_genai_gateway oci_genai_gateway ``` 4. Verify: Open `http://localhost:8088` in a browser (should show a health check or API docs). Check logs with `podman logs oci_genai_gateway`. @@ -51,7 +52,7 @@ In n8n, use the **OpenAI** node but point it to your local gateway as a custom e 2. Add an **OpenAI** node (under AI > Chat Models). 3. Configure credentials: * **API Key:** Leave blank or use a dummy value (gateway uses OCI auth). - * **Base URL:** `http://host.docker.internal:8088/v1` (for Podman/Docker; use `http://localhost:8088/v1` if running natively). + * **Base URL**: `http://host.containers.internal:8088/v1` (preferred for Podman on Windows/macOS; fallback to `http://localhost:8088/v1` if running natively or use the gateway's explicit IP with `--add-host host.containers.internal:` in Podman run command). * **Model:** Select or enter an OCI model (list available models via gateway docs or OCI Console). n8n will now route requests through the gateway to OCI GenAI. @@ -126,4 +127,4 @@ This example creates a workflow that triggers on a webhook (e.g., incoming email ## Troubleshooting & Tips * **Authentication Errors:** Verify `~/.oci/config` permissions and OCI policies (from prerequisites). Test with `oci` CLI commands like `oci os ns get`. * **Connection Issues:** Ensure port 8088 is open (firewall/OCI security lists). For Podman, use `--network=host` if needed. -* **Model Not Found:** List OCI models in Console under **Analytics & AI > Generative AI**. Ensure your tenancy has the required permissions for `generative-ai-family`. \ No newline at end of file +* **Model Not Found:** List OCI models in Console under **Analytics & AI > Generative AI**. Ensure your tenancy has the required permissions for `generative-ai-family`.