Unified storefront + tiered pricing (1 free, 2&3 billed) + token auth + ProxyFly clean-proxy auto-assign on sessions

This commit is contained in:
drjones
2026-08-24 22:30:56 -07:00
parent 1b586daf20
commit 6e3b1f11be
3 changed files with 497 additions and 316 deletions

View File

@@ -1,12 +1,14 @@
#!/usr/bin/env python3
"""
VORTEX_GPU — Linux Host Node Agent (v2 — Ubuntu-session provisioning)
VORTEX_GPU — Linux Host Node Agent (v3 — Ubuntu-session provisioning + clean proxy)
Target: Ubuntu (nightmare .128, RTX 4080 SUPER 16GB)
Spawns in-browser Ubuntu desktop sessions, each with the 4080 attached (--gpus all):
- provision_ubuntu : docker run a full Ubuntu LXDE desktop (noVNC) with GPU, on a
dedicated port. Tenant gets a clean private machine; the physical
GPU is shared/hidden.
GPU is shared/hidden. If a clean ProxyFly proxy is supplied, its
address is injected as HTTP(S)_PROXY / ALL_PROXY env vars so the
session egresses through a clean residential IP automatically.
- destroy_ubuntu : docker rm -f the session container.
- shell / hashcat / comfyui : run an arbitrary command against the local GPU.
@@ -110,18 +112,29 @@ def run_shell(command):
return False, f"error: {e}"
def provision_ubuntu(instance_id, port, password, resolution):
"""Spawn a full Ubuntu desktop session with the 4080 attached (noVNC on mapped port)."""
def provision_ubuntu(instance_id, port, password, resolution, proxy=None):
"""Spawn a full Ubuntu desktop session with the 4080 attached (noVNC on mapped port).
If a clean proxy string is supplied (e.g. http://1.2.3.4:8080), it is injected as
HTTP_PROXY/HTTPS_PROXY/ALL_PROXY env vars so outbound traffic egresses through it.
"""
name = f"vortex-{instance_id}"
_docker(["rm", "-f", name], timeout=30) # clean any stale instance
r = _docker(["run", "-d", "--gpus", "all", "--name", name,
"-p", f"{port}:80",
"-e", f"VNC_PASSWORD={password}",
"-e", f"RESOLUTION={resolution or '1440x900'}",
SESSION_IMAGE])
args = ["run", "-d", "--gpus", "all", "--name", name,
"-p", f"{port}:80",
"-e", f"VNC_PASSWORD={password}",
"-e", f"RESOLUTION={resolution or '1440x900'}"]
if proxy:
args += ["-e", f"HTTP_PROXY={proxy}", "-e", f"http_proxy={proxy}",
"-e", f"HTTPS_PROXY={proxy}", "-e", f"https_proxy={proxy}",
"-e", f"ALL_PROXY={proxy}", "-e", f"all_proxy={proxy}",
"-e", "NO_PROXY=localhost,127.0.0.1"]
args.append(SESSION_IMAGE)
r = _docker(args)
if r.returncode == 0:
cid = r.stdout.strip()[:12]
return True, f"launched container={name} id={cid} port={port}"
prox = f" proxy={proxy}" if proxy else " proxy=none"
return True, f"launched container={name} id={cid} port={port}{prox}"
return False, f"failed: {r.stderr.strip()[:400]}"
@@ -141,7 +154,8 @@ def handle_job(job):
ok, result = provision_ubuntu(payload.get("instanceId", "inst"),
int(payload.get("port", 6090)),
payload.get("password", "vortex"),
payload.get("resolution", "1440x900"))
payload.get("resolution", "1440x900"),
payload.get("proxy"))
elif kind == "destroy_ubuntu":
ok, result = destroy_ubuntu(payload.get("instanceId", ""))
else: