Allszn's picture
Add launch console UI
50e19c9 verified
Raw History Blame Contribute Delete
13.5 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Steam GPU Launch Console</title>
<style>
:root{
--bg:#0f1720; --panel:#16202b; --panel-2:#1c2833; --line:#26333f;
--ink:#e8eef4; --muted:#93a4b3; --accent:#4d9fff; --accent-2:#7bd88f;
--warn:#f0b357; --danger:#ff7b7b; --code:#0b1118;
--mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);
font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
.wrap{max-width:1080px;margin:0 auto;padding:30px 22px 70px}
header{border-bottom:1px solid var(--line);padding-bottom:20px;margin-bottom:26px}
h1{margin:0 0 6px;font-size:24px;letter-spacing:-.3px}
header p{margin:0;color:var(--muted);font-size:14.5px;max-width:76ch}
.pill{display:inline-block;background:#1e3a5c;color:#9cc8ff;border-radius:999px;
padding:3px 11px;font-size:11.5px;font-weight:700;letter-spacing:.4px;margin-top:12px}
h2{font-size:15px;text-transform:uppercase;letter-spacing:.9px;color:var(--muted);
margin:30px 0 12px;font-weight:700}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:14px}
label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:5px;font-weight:600}
input,select{width:100%;background:var(--panel-2);border:1px solid var(--line);color:var(--ink);
border-radius:8px;padding:9px 11px;font:14px/1.4 var(--mono);outline:none}
input:focus,select:focus{border-color:var(--accent)}
.hint{font-size:11.5px;color:#6d7f8f;margin-top:4px}
.warns{margin-top:22px;display:grid;gap:10px}
.w{border:1px solid var(--line);border-left:3px solid var(--warn);background:var(--panel);
border-radius:8px;padding:11px 14px;font-size:13.6px;color:#cfdae4}
.w.red{border-left-color:var(--danger)}
.w strong{color:var(--warn)}
.w.red strong{color:var(--danger)}
.cmd{background:var(--panel);border:1px solid var(--line);border-radius:10px;margin-bottom:16px;overflow:hidden}
.cmd-head{display:flex;justify-content:space-between;align-items:center;padding:11px 14px;
background:var(--panel-2);border-bottom:1px solid var(--line)}
.cmd-head h3{margin:0;font-size:13.5px;letter-spacing:.2px;color:var(--ink)}
.cmd-head span{display:block;font-size:11.5px;color:var(--muted);font-weight:500;letter-spacing:0;margin-top:2px}
button{background:#24405e;border:1px solid #315a84;color:#cfe4ff;border-radius:7px;
padding:6px 13px;font:600 12px/1.5 var(--mono);cursor:pointer;letter-spacing:.3px;flex:0 0 auto}
button:hover{background:#2d5279;color:#fff}
pre{margin:0;padding:15px;background:var(--code);color:#cfe0ee;overflow:auto;
font:12.6px/1.65 var(--mono);white-space:pre-wrap;word-break:break-word}
.ok{color:var(--accent-2)}
footer{margin-top:34px;padding-top:18px;border-top:1px solid var(--line);
color:var(--muted);font-size:13px}
a{color:var(--accent)}
.steps{counter-reset:s;list-style:none;margin:0;padding:0;font-size:13.8px;color:#c3d0dc}
.steps li{counter-increment:s;padding:7px 0 7px 32px;position:relative;border-bottom:1px solid var(--line)}
.steps li:last-child{border-bottom:0}
.steps li::before{content:counter(s);position:absolute;left:0;top:7px;width:21px;height:21px;
border-radius:50%;background:#24405e;color:#9cc8ff;font:700 11.5px/21px var(--mono);text-align:center}
</style>
</head>
<body>
<div class="wrap">
<header>
<h1>Steam GPU Launch Console</h1>
<p>Generate the commands to deploy a per-player Windows GPU cloud-gaming host on AWS —
NVIDIA gaming driver, Amazon DCV browser streaming, Steam Offline Mode library on its
own EBS volume, and IAM-scoped self-troubleshooting.</p>
<span class="pill">NO CREDENTIALS STORED · NO AWS CALLS MADE</span>
</header>
<h2>Parameters</h2>
<div class="grid">
<div>
<label for="region">AWS region</label>
<input id="region" value="us-east-1">
<div class="hint">Keep it near you — a distant region also looks odd to Steam</div>
</div>
<div>
<label for="instance">Instance type</label>
<select id="instance">
<option value="g4dn.xlarge">g4dn.xlarge — T4 16 GB (~$0.71/hr Windows)</option>
<option value="g6.xlarge" selected>g6.xlarge — L4 24 GB (~$0.99/hr Windows)</option>
<option value="g5.xlarge">g5.xlarge — A10G 24 GB (~$1.19/hr Windows)</option>
<option value="g6.2xlarge">g6.2xlarge — L4 24 GB, 8 vCPU</option>
</select>
</div>
<div>
<label for="stack">Stack name</label>
<input id="stack" value="steam-gpu">
</div>
<div>
<label for="key">EC2 key pair</label>
<input id="key" placeholder="my-keypair">
<div class="hint">Decrypts the local Administrator password</div>
</div>
<div>
<label for="volume">Steam library (GiB)</label>
<input id="volume" type="number" value="600" min="100" max="4000">
<div class="hint">gp3, encrypted, survives stop/start</div>
</div>
<div>
<label for="cidr">DCV allow CIDR</label>
<input id="cidr" placeholder="auto: your current public IP">
<div class="hint">Must end in /32. Blank lets launch.sh detect it</div>
</div>
</div>
<div class="warns">
<div class="w red"><strong>One Windows instance = one player.</strong> Amazon DCV's Windows
server supports console sessions only — virtual sessions and GPU sharing are Linux-only.
Scale by adding instances, not by adding users to one box.</div>
<div class="w"><strong>Steam credential sharing is outside Valve's terms.</strong> Offline Mode
is legitimate for your own second machine. For other people, use Steam Families — up to six
members, one play slot per owned copy, shared games playable offline.</div>
<div class="w"><strong>Browser streaming is the convenience tier.</strong> The DCV web client is
TCP-only and capped at 2 × 1920×1080. The native client gets QUIC over UDP 8443 and up to 4K.</div>
</div>
<h2>Launch from your machine</h2>
<div class="cmd">
<div class="cmd-head">
<div><h3>Deploy with launch.sh</h3><span>Validates first, then applies. No inbound RDP at any point.</span></div>
<button data-copy="c1">Copy</button>
</div>
<pre id="c1"></pre>
</div>
<h2>Launch on Hugging Face compute</h2>
<div class="cmd">
<div class="cmd-head">
<div><h3>Validate only</h3><span>Needs no AWS credentials at all. Run this first.</span></div>
<button data-copy="c2">Copy</button>
</div>
<pre id="c2"></pre>
</div>
<div class="cmd">
<div class="cmd-head">
<div><h3>Deploy</h3><span>Credentials travel as Hub secrets; nothing is written to the repo or image.</span></div>
<button data-copy="c3">Copy</button>
</div>
<pre id="c3"></pre>
</div>
<h2>Operate</h2>
<div class="cmd">
<div class="cmd-head">
<div><h3>RDP over Systems Manager</h3><span>Reaches 3389 without ever opening 3389.</span></div>
<button data-copy="c4">Copy</button>
</div>
<pre id="c4"></pre>
</div>
<div class="cmd">
<div class="cmd-head">
<div><h3>Health report</h3><span>The instance reports its own failures as a JSON verdict.</span></div>
<button data-copy="c5">Copy</button>
</div>
<pre id="c5"></pre>
</div>
<h2>After the deploy</h2>
<ol class="steps">
<li>Upload the Amazon DCV server MSI to <b>C:\DCV</b> on the instance and re-run the DCV section of <code>bootstrap.ps1</code>, then reboot so the GPU driver loads.</li>
<li>Confirm the licence with <code>nvidia-smi -q</code> — expect <b>NVIDIA Cloud Gaming</b> and <b>License Status : Licensed</b>.</li>
<li>Open <code>https://&lt;elastic-ip&gt;:8443/</code> in a browser and connect to the console session.</li>
<li>Configure Steam Offline Mode: save credentials, clear the download queue, launch each game once online, then <b>Steam &gt; Go Offline</b>.</li>
<li>Run the health report, then stop the instance between sessions — the GPU hour is the whole cost.</li>
</ol>
<footer>
Launch kit: <a href="https://huggingface.co/datasets/Allszn/aws-steam-gpu-launchkit">Allszn/aws-steam-gpu-launchkit</a> ·
one instance per player, because Windows DCV is console-session-only.
</footer>
</div>
<script>
(function () {
var $ = function (id) { return document.getElementById(id); };
function values() {
var v = {
region: ($('region').value || 'us-east-1').trim(),
instance: $('instance').value,
stack: ($('stack').value || 'steam-gpu').trim(),
key: ($('key').value || 'my-keypair').trim(),
volume: ($('volume').value || '600').trim(),
cidr: ($('cidr').value || '').trim()
};
return v;
}
function localCmd(v) {
var lines = [
'# 1. fetch the kit from the Hub',
'pip install --quiet huggingface_hub pyyaml awscli',
'',
'python - <<\'PY\'',
'from huggingface_hub import snapshot_download',
'print(snapshot_download("Allszn/aws-steam-gpu-launchkit", repo_type="dataset",',
' local_dir="launchkit",',
' allow_patterns=["cloudformation/*","scripts/*","iam/*",',
' "ssm/*","launch.sh","launch.py","README.md"]))',
'PY',
'',
'# 2. deploy (credentials stay in your shell - nothing is stored in the repo)',
'cd launchkit && chmod +x launch.sh',
'export AWS_PROFILE=my-profile',
'export AWS_REGION=' + v.region,
'export KEY_NAME=' + v.key,
'',
'./launch.sh \\',
' --stack-name ' + v.stack + ' \\',
' --region ' + v.region + ' \\',
' --instance-type ' + v.instance + ' \\',
' --volume-gib ' + v.volume + (v.cidr ? ' \\\n --admin-cidr ' + v.cidr : '')
];
return lines.join('\n');
}
function jobCmd(v, mode) {
var secrets = mode === 'deploy'
? ' --secrets AWS_ACCESS_KEY_ID \\\n --secrets AWS_SECRET_ACCESS_KEY \\\n --secrets AWS_REGION \\\n'
: '';
return [
'hf jobs uv run \\',
' --name ' + v.stack + '-' + mode + ' \\',
' --flavor cpu-basic \\',
' --timeout 40m \\',
' --with huggingface_hub --with pyyaml --with awscli --with boto3 \\',
secrets + ' --env MODE=' + mode + ' \\',
' --env STACK_NAME=' + v.stack + ' \\',
' --env INSTANCE_TYPE=' + v.instance + ' \\',
' --env GAME_VOLUME_GIB=' + v.volume + ' \\',
' --env KEY_NAME=' + v.key + ' \\',
' --env AWS_REGION=' + v.region + ' \\',
' scripts/hf_job.py',
'',
'# MODE=validate completes in about a minute and needs no AWS credentials.',
'# confirm flag names against: hf jobs run --help'
].join('\n');
}
function rdpCmd(v) {
return [
'INSTANCE_ID=$(aws cloudformation describe-stacks --stack-name ' + v.stack + ' \\',
' --region ' + v.region + ' \\',
' --query "Stacks[0].Outputs[?OutputKey==\'InstanceId\'].OutputValue" --output text)',
'',
'aws ssm start-session \\',
' --target "$INSTANCE_ID" \\',
' --region ' + v.region + ' \\',
' --document-name AWS-StartPortForwardingSession \\',
' --parameters \'{"portNumber":["3389"],"localPortNumber":["13389"]}\'',
'',
'# then: mstsc /v:localhost:13389'
].join('\n');
}
function healthCmd(v) {
return [
'INSTANCE_ID=$(aws cloudformation describe-stacks --stack-name ' + v.stack + ' \\',
' --region ' + v.region + ' \\',
' --query "Stacks[0].Outputs[?OutputKey==\'InstanceId\'].OutputValue" --output text)',
'',
'CMD=$(aws ssm send-command \\',
' --document-name SteamGpu-Diagnose \\',
' --instance-ids "$INSTANCE_ID" \\',
' --region ' + v.region + ' \\',
' --query "Command.CommandId" --output text)',
'',
'aws ssm list-command-invocations --command-id "$CMD" --region ' + v.region + ' \\',
' --details --query "CommandInvocations[0].CommandPlugins[0].Output" --output text',
'',
'# expect a JSON line like:',
'# {"ok":true,"failures":[],"detail":{"gpuLicensed":true,"dcvServiceStatus":"Running",...}}'
].join('\n');
}
function render() {
var v = values();
$('c1').textContent = localCmd(v);
$('c2').textContent = jobCmd(v, 'validate');
$('c3').textContent = jobCmd(v, 'deploy');
$('c4').textContent = rdpCmd(v);
$('c5').textContent = healthCmd(v);
}
['region', 'instance', 'stack', 'key', 'volume', 'cidr'].forEach(function (id) {
var el = $(id);
el.addEventListener('input', render);
el.addEventListener('change', render);
});
document.addEventListener('click', function (e) {
var btn = e.target.closest('button[data-copy]');
if (!btn) return;
var text = $(btn.getAttribute('data-copy')).textContent;
var flash = function () {
var prev = btn.textContent;
btn.textContent = 'Copied';
setTimeout(function () { btn.textContent = prev; }, 1200);
};
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(flash).catch(fallback);
} else { fallback(); }
function fallback() {
var ta = document.createElement('textarea');
ta.value = text;
ta.style.position = 'fixed';
ta.style.opacity = '0';
document.body.appendChild(ta);
ta.select();
try { document.execCommand('copy'); flash(); } catch (err) {}
document.body.removeChild(ta);
}
});
render();
})();
</script>
</body>
</html>