Skip to content

Add proxy support to GPU validation role#25

Merged
bogdando merged 1 commit into
rhos-vaf:mainfrom
MiguelCarpio:http_proxy
Jul 14, 2026
Merged

Add proxy support to GPU validation role#25
bogdando merged 1 commit into
rhos-vaf:mainfrom
MiguelCarpio:http_proxy

Conversation

@MiguelCarpio

@MiguelCarpio MiguelCarpio commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Add gpu_validation_http_proxy, gpu_validation_https_proxy, and gpu_validation_no_proxy variables for outbound connectivity
  • Add proxy.yaml task to configure /etc/environment, dnf, and podman
  • Add proxy env vars to vllm-serve.service.j2 (service and container)
  • Add use_proxy: false and validate_certs: false to vLLM health checks

Why do we need this PR?

When VMs cannot reach the internet directly, a Proxy VM serves as the outbound gateway. The Proxy VM must have internet access. To route traffic through it, the proxy must be configured at every layer inside the VM: /etc/environment, dnf.conf, podman systemd, and the vLLM container.

If the Proxy VM also lacks internet access but a workstation can reach it via SSH, the workstation can provide connectivity through an SSH reverse tunnel — forwarding its local Squid proxy to the Proxy VM. The Proxy VM then chains requests through the tunnel to the workstation's proxy, giving the entire environment (Proxy VM and all GPU VMs behind it) outbound internet access without any direct connectivity.

┌─────────────────────────────────────────────────────────────────────────┐
│                           INTERNET                                      │
└────────────────────────────────┬────────────────────────────────────────┘
                                 │
                                 ▼
┌────────────────────────────────────────┐
│            WORKSTATION                 │
│            Squid (:3128)               │
└───────────┬────────────────────────────┘
            │ ssh -R 3129:localhost:3128
            ▼
┌────────────────────────────────────────────────────────────────────────┐
│                     Proxy VM (<proxy_ip>)                              │
│                     Squid (:3128)                                      │
│                       cache_peer 127.0.0.1:3129 ──► Workstation Squid  │
└────────────────────────────────┬───────────────────────────────────────┘
                                 │
                    http_proxy=<proxy_ip>:3128
                                 │
        ┌────────────────────────┼────────────────────────┐
        ▼                        ▼                        ▼
┌───────────────┐  ┌───────────────────┐  ┌───────────────────┐
│   GPU VM 01   │  │     GPU VM 02     │  │     GPU VM N      │
└───────────────┘  └───────────────────┘  └───────────────────┘

Related: RHOSSTRAT-1212

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds configurable HTTP, HTTPS, and no-proxy defaults, wires proxy setup into GPU validation, injects proxy variables into the vLLM service and Podman, and disables proxy use and TLS certificate validation for local health and metrics checks.

Changes

Proxy Configuration Support

Layer / File(s) Summary
Proxy and networking defaults
gpu-validation/defaults/main.yaml
Documents the SSH proxy command and adds HTTP, HTTPS, and no-proxy settings.
Proxy configuration task
gpu-validation/tasks/setup.yaml, gpu-validation/tasks/proxy.yaml
Conditionally includes proxy configuration, writes system proxy variables, updates DNF, creates the Podman drop-in, and reloads systemd when the drop-in changes.
vLLM service proxy environment
gpu-validation/templates/vllm-serve.service.j2
Adds proxy environment variables to the service and Podman run command.
Health and metrics proxy bypass
gpu-validation/tasks/model_download_and_serve.yaml
Sets use_proxy: false and validate_certs: false for the /health and /metrics/ polling requests.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Setup as setup.yaml
  participant ProxyTask as proxy.yaml
  participant System as System files and DNF
  participant Podman as Podman service
  participant Vllm as vLLM service
  participant Checks as health and metrics requests

  Setup->>ProxyTask: include when HTTP proxy is set
  ProxyTask->>System: write proxy variables and DNF proxy
  ProxyTask->>Podman: install proxy drop-in and reload systemd
  Vllm->>Podman: pass proxy environment variables
  Checks->>Checks: poll endpoints without proxy and certificate validation
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding proxy support to the GPU validation role.
Description check ✅ Passed The description accurately describes the proxy variables, task, template, and health-check updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
gpu-validation/templates/vllm-serve.service.j2 (1)

24-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Inconsistent quoting vs. HF token env var.

Line 21 quotes the HF token value with | quote, but the proxy env values here are not quoted. Minor inconsistency; low risk since URLs rarely contain shell-significant characters, but worth aligning for consistency/defensiveness.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gpu-validation/templates/vllm-serve.service.j2` around lines 24 - 26, The
proxy environment variables in the vllm-serve.service.j2 template are
inconsistently rendered compared with the HF token value. Update the HTTP_PROXY,
HTTPS_PROXY, and NO_PROXY env entries in the service template to use the same
quoting approach as the HF token env var for consistency and safer shell
rendering, keeping the existing variable names and defaults intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gpu-validation/tasks/proxy.yaml`:
- Around line 8-13: The proxy environment rendering is using
gpu_validation_https_proxy directly, which can produce the literal string "None"
when that value is unset. Update the proxy template so the HTTPS variables in
the proxy block (including the matching lower-case entries) fall back to
gpu_validation_http_proxy the same way vllm-serve.service.j2 does, and apply the
same fix wherever this proxy block is duplicated.
- Around line 21-35: After the drop-in is created in the proxy task, add an
explicit systemd daemon reload so podman.service picks up the new environment
immediately. Update the tasks in proxy.yaml around the Configure container
engine proxy and Set container engine proxy environment steps to trigger a
reload using the appropriate systemd/ansible action, and keep the change
localized to the existing podman.service.d and http-proxy.conf setup.

In `@gpu-validation/templates/vllm-serve.service.j2`:
- Around line 8-12: The vllm-serve systemd unit template currently writes proxy
environment values into a world-readable file, which can expose embedded
credentials. Update the rendering in
gpu_validation/tasks/model_download_and_serve.yaml and the vllm-serve.service.j2
template to use tighter permissions and ownership (for example, a
non-world-readable mode owned by cloud-user), or otherwise ensure
HTTP_PROXY/HTTPS_PROXY values cannot contain credentials; keep the existing
Environment entries but make the generated unit file private enough to protect
them.
- Line 10: The vllm-serve.service.j2 template is using the wrong fallback
behavior for HTTPS_PROXY, so when gpu_validation_https_proxy is empty it can
still resolve to None instead of reusing the HTTP proxy. Update both HTTPS proxy
environment entries in gpu_validation/templates/vllm-serve.service.j2 to use
default(gpu_validation_http_proxy, true) so gpu_validation_http_proxy is used
whenever gpu_validation_https_proxy is unset or empty.

---

Nitpick comments:
In `@gpu-validation/templates/vllm-serve.service.j2`:
- Around line 24-26: The proxy environment variables in the
vllm-serve.service.j2 template are inconsistently rendered compared with the HF
token value. Update the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY env entries in the
service template to use the same quoting approach as the HF token env var for
consistency and safer shell rendering, keeping the existing variable names and
defaults intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 9e72d700-90dc-450c-8069-dd90ec059592

📥 Commits

Reviewing files that changed from the base of the PR and between 565225d and 6d43504.

📒 Files selected for processing (5)
  • gpu-validation/defaults/main.yaml
  • gpu-validation/tasks/model_download_and_serve.yaml
  • gpu-validation/tasks/proxy.yaml
  • gpu-validation/tasks/setup.yaml
  • gpu-validation/templates/vllm-serve.service.j2

Comment thread gpu-validation/tasks/proxy.yaml
Comment thread gpu-validation/tasks/proxy.yaml
Comment thread gpu-validation/templates/vllm-serve.service.j2 Outdated
Comment thread gpu-validation/templates/vllm-serve.service.j2 Outdated
Comment thread gpu-validation/defaults/main.yaml

@bogdando bogdando left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see inline

@bogdando

Copy link
Copy Markdown
Contributor

it failed when the proxy var unset:

fatal: [localhost]: FAILED! => {"msg": "The conditional check 'gpu_validation_http_proxy | default('') | length > 0' failed. The error was: Unexpected templating type error occurred on ({% if gpu_validation_http_proxy | default('') | length > 0 %} True {% else %} False {% endif %}): object of type 'NoneType' has no len(). object of type 'NoneType' has no len()\n\nThe error appears to be in '/home/cloud-user/gpu-validation/gpu-validation/tasks/setup.yaml': line 9, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Configure proxy settings\n  ^ here\n"}```

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gpu-validation/defaults/main.yaml`:
- Around line 75-79: Set both gpu_validation_http_proxy and
gpu_validation_https_proxy to explicit empty-string defaults instead of null in
the defaults configuration. Also update the consuming template’s default filters
to use the boolean true argument, ensuring explicitly provided null values are
converted to empty strings before length or truthiness checks.
- Around line 33-42: Resolve the conflict in the defaults file by removing all
Git conflict markers, preserving the gpu_validation_mem_page_size setting and
its comments, and deleting the duplicate gpu_validation_libnvidia_ml_version
definition from this block while retaining its later definition.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: c16cfc44-36de-41d1-906c-4c4443577bf5

📥 Commits

Reviewing files that changed from the base of the PR and between 802d2b5 and 151e7c5.

📒 Files selected for processing (5)
  • gpu-validation/defaults/main.yaml
  • gpu-validation/tasks/model_download_and_serve.yaml
  • gpu-validation/tasks/proxy.yaml
  • gpu-validation/tasks/setup.yaml
  • gpu-validation/templates/vllm-serve.service.j2
🚧 Files skipped from review as they are similar to previous changes (4)
  • gpu-validation/templates/vllm-serve.service.j2
  • gpu-validation/tasks/model_download_and_serve.yaml
  • gpu-validation/tasks/setup.yaml
  • gpu-validation/tasks/proxy.yaml

Comment thread gpu-validation/defaults/main.yaml Outdated
Comment thread gpu-validation/defaults/main.yaml Outdated
@MiguelCarpio
MiguelCarpio force-pushed the http_proxy branch 2 times, most recently from 0910622 to e6525d3 Compare July 14, 2026 10:57
- Add gpu_validation_http_proxy, gpu_validation_https_proxy, and
  gpu_validation_no_proxy variables for outbound connectivity
- Add proxy.yaml task to configure /etc/environment, dnf, and podman
- Add proxy env vars to vllm-serve.service.j2 (service and container)
- Add use_proxy: false and validate_certs: false to vLLM health checks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bogdando
bogdando merged commit 1ebc168 into rhos-vaf:main Jul 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants