Add launch kit overview
Browse files
README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: AWS Steam GPU Launch Kit
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- aws
|
| 6 |
+
- infrastructure-as-code
|
| 7 |
+
- cloudformation
|
| 8 |
+
- gaming
|
| 9 |
+
- windows
|
| 10 |
+
- amazon-dcv
|
| 11 |
+
- systems-manager
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# AWS Steam GPU Launch Kit
|
| 15 |
+
|
| 16 |
+
Deploy kit for a **per-player Windows GPU host on AWS**: NVIDIA gaming driver, Amazon DCV
|
| 17 |
+
browser streaming, a Steam Offline Mode library on its own EBS volume, and IAM-scoped
|
| 18 |
+
self-troubleshooting with a self-healing diagnostics loop.
|
| 19 |
+
|
| 20 |
+
This repo is the versioned artifact registry **and** the execution layer. Artifacts are
|
| 21 |
+
fetched with `huggingface_hub`, so a runner that has only the AWS CLI and a token can
|
| 22 |
+
deploy without a git checkout.
|
| 23 |
+
|
| 24 |
+
## Read these three constraints first
|
| 25 |
+
|
| 26 |
+
1. **One Windows instance = one player.** Amazon DCV's Windows server supports console
|
| 27 |
+
sessions only — virtual sessions and GPU sharing are Linux-only features. Scale by
|
| 28 |
+
adding instances, never by adding users to one box.
|
| 29 |
+
2. **Steam credential sharing is outside Valve's terms.** Offline Mode is legitimate for
|
| 30 |
+
*your own* second machine. For other people, use **Steam Families** (up to six members,
|
| 31 |
+
one play slot per owned copy, shared games playable offline).
|
| 32 |
+
3. **Browser streaming is the convenience tier.** The DCV web client is TCP-only and
|
| 33 |
+
capped at 2 x 1920x1080. The native client gets QUIC over UDP 8443 and up to 4K.
|
| 34 |
+
|
| 35 |
+
## Layout
|
| 36 |
+
|
| 37 |
+
| Path | Purpose |
|
| 38 |
+
|---|---|
|
| 39 |
+
| `cloudformation/steam-gpu-host.yaml` | IAM role, security group, encrypted game volume, instance, Elastic IP, log group, status alarm |
|
| 40 |
+
| `scripts/bootstrap.ps1` | Installs the NVIDIA gaming driver, registers the vGaming marketplace key, installs the DCV server and the CloudWatch agent |
|
| 41 |
+
| `scripts/diagnose.ps1` | Emits a one-line JSON health verdict (`gpu-missing`, `gpu-unlicensed`, `dcv-port-closed`, ...) |
|
| 42 |
+
| `scripts/validate.py` | Static validation, secret scanning, IAM surface inventory. **No AWS credentials required.** |
|
| 43 |
+
| `scripts/hf_job.py` | Runs *inside* a Hugging Face Job: fetches this repo, then validates or deploys |
|
| 44 |
+
| `ssm/SteamGpu-Diagnose.json` | Systems Manager document wrapping the diagnostic |
|
| 45 |
+
| `iam/instance-role-inline-policy.json` | Least-privilege policy for the gaming host |
|
| 46 |
+
| `iam/operator-role-policy.json` | Your debugging identity, with tag-scoped mutations |
|
| 47 |
+
| `launch.sh` | One-command deploy: validate, deploy the stack, push the bootstrap over SSM |
|
| 48 |
+
| `launch.py` | Driver with `validate` / `plan` / `deploy` / `job` modes |
|
| 49 |
+
|
| 50 |
+
## Validate without touching AWS
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
python -m pip install pyyaml
|
| 54 |
+
python scripts/validate.py --root .
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Deploy from your own machine
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
export AWS_PROFILE=my-profile
|
| 61 |
+
export AWS_REGION=us-east-1
|
| 62 |
+
export KEY_NAME=my-keypair
|
| 63 |
+
./launch.sh --instance-type g6.xlarge --volume-gib 600
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
`--admin-cidr` defaults to your current public IP. `--dry-run` validates and prints the
|
| 67 |
+
plan without changing anything.
|
| 68 |
+
|
| 69 |
+
## Deploy from a Hugging Face Job
|
| 70 |
+
|
| 71 |
+
Credentials arrive as Hub secrets, so no long-lived keys sit in this repo or on disk.
|
| 72 |
+
`launch.sh` then runs on ephemeral Hub compute and the runner disappears afterwards.
|
| 73 |
+
|
| 74 |
+
```bash
|
| 75 |
+
hf jobs uv run \
|
| 76 |
+
--name steam-gpu-deploy \
|
| 77 |
+
--flavor cpu-basic \
|
| 78 |
+
--timeout 40m \
|
| 79 |
+
--with huggingface_hub --with pyyaml --with awscli --with boto3 \
|
| 80 |
+
--secrets AWS_ACCESS_KEY_ID --secrets AWS_SECRET_ACCESS_KEY --secrets AWS_REGION \
|
| 81 |
+
--env KEY_NAME=my-keypair \
|
| 82 |
+
--env INSTANCE_TYPE=g6.xlarge \
|
| 83 |
+
scripts/hf_job.py
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
Set `MODE=validate` to run the credential-free checks on Hub compute first. Confirm the
|
| 87 |
+
flag names against `hf jobs run --help` in your CLI version.
|
| 88 |
+
|
| 89 |
+
## Launch console
|
| 90 |
+
|
| 91 |
+
A zero-credential parameter console lives at
|
| 92 |
+
[Allszn/steam-gpu-launch-console](https://huggingface.co/spaces/Allszn/steam-gpu-launch-console) —
|
| 93 |
+
it generates the exact commands above from the options you pick. It stores no credentials
|
| 94 |
+
and calls no AWS API.
|
| 95 |
+
|
| 96 |
+
## Cost
|
| 97 |
+
|
| 98 |
+
Windows GPU instances land near **~$0.71/hr** (`g4dn.xlarge`) to **~$0.99/hr**
|
| 99 |
+
(`g6.xlarge`) in us-east-1, derived from Linux on-demand list rates plus AWS's stated
|
| 100 |
+
$0.046-per-vCPU-hour Windows licence component. Verify in the AWS Pricing Calculator.
|
| 101 |
+
Stopping the instance between sessions is the single biggest saving.
|
| 102 |
+
|
| 103 |
+
## Security notes
|
| 104 |
+
|
| 105 |
+
- No secrets are stored in this repo. `scripts/validate.py` fails the build if an AWS key,
|
| 106 |
+
private key block, Steam password or bearer token is ever committed.
|
| 107 |
+
- Only TCP/UDP **8443** is opened, and only to the CIDR you supply. **3389 is never
|
| 108 |
+
exposed** — reach RDP through `AWS-StartPortForwardingSession`.
|
| 109 |
+
- The instance role cannot widen its own access; mutations in the operator role are
|
| 110 |
+
conditioned on the `Project=steam-gpu` tag.
|