Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Kubeflow Pipelines Get Proxy URL

From Leeroopedia
Knowledge Sources
Domains GCP, Networking
Last Updated 2026-02-13 14:00 GMT

Overview

CLI tool that determines the correct inverting proxy URL for a given GCP zone using geographic proximity-based selection.

Description

The get_proxy_url.py module (117 lines) implements a zone-to-proxy URL resolver. The `urls_for_zone()` function builds a prioritized list of candidate URLs by: (1) exact region match, (2) approximate region match (prefix), and (3) country-level fallback. The `main()` function reads a JSON config file, resolves candidates for the given zone, and sends HTTP HEAD requests to find the first accessible proxy (indicated by HTTP 307 status).

Usage

Run as a CLI tool by `attempt-register-vm-on-proxy.sh` to select the nearest available inverting proxy server for KFP UI access.

Code Reference

Source Location

Signature

def urls_for_zone(zone: str, location_to_urls: dict) -> list:
    """Returns prioritized proxy URLs for a GCP zone.
    Priority: exact region > approximate region > country fallback."""

def main() -> None:
    """CLI entry point. Parses args, reads config, probes URLs,
    prints first accessible proxy URL to stdout."""

Import

from get_proxy_url import urls_for_zone
# Or run as CLI:
# python get_proxy_url.py --config-file-path config.json --location us-west1-b --version v1

I/O Contract

Inputs

Name Type Required Description
--config-file-path CLI arg Yes JSON file with proxy URL mappings by version and region
--location CLI arg Yes GCP zone string (e.g., us-west1-b)
--version CLI arg Yes Proxy version key in config

Outputs

Name Type Description
stdout string Selected proxy URL (first URL returning HTTP 307)

Usage Examples

Running the Proxy URL Resolver

python proxy/get_proxy_url.py \
  --config-file-path proxy/proxy-config.json \
  --location us-central1-a \
  --version v1
# Output: https://proxy.us-central1.example.com

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment