1
0
Fork 0
mirror of https://github.com/imjasonh/terraform-playground synced 2026-07-07 23:35:16 +00:00
Commit graph

148 commits

Author SHA1 Message Date
Cursor Agent
2d20db5c67
Update tests for AWS node keys and <1 spot price bounds
Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 14:04:22 +00:00
Cursor Agent
80538d1509
UI: spot savings multiplier, AWS pool prices, scrollable node grid
- Show the spot price as a <1× multiplier of on-demand (e.g. 0.42×) with a
  'spot vs on-dmd' label, colored by how much you're saving; node spot tags
  show the effective $/hr and savings %.
- Node-pool dropdown shows realistic specs and prices (spot priced ~0.45×).
- Make the node and queue panels flex columns whose lists scroll
  internally, so a large cluster no longer overflows its row and covers the
  event log.

Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 14:04:16 +00:00
Cursor Agent
3338b31e1a
Model node pools on real AWS instance types, prices & spot market
- Replace the generic node pools with realistic AWS EC2 families and their
  us-east-1 on-demand prices: c5.xlarge/c5.2xlarge (general), c5d.2xlarge
  (local-NVMe SSD), r5.2xlarge (memory), g4dn.xlarge (1× T4 GPU), plus c5
  spot variants. Pod requests were already realistic and are unchanged.
- Spot price is now the live fraction of on-demand (mean-reverting ~0.45,
  clamped <1 since AWS never bills spot above on-demand); spot nodes bill at
  cost×spotPrice and a hotter market means more interruptions.
- GPU nodes are now single-GPU (g4dn.xlarge), so the autoscaler provisions
  one GPU node per pending GPU pod instead of de-duping to one per burst.
- Name nodes with a random k8s-style suffix (node-xugjs) while keeping a
  stable internal id.

Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 14:04:08 +00:00
Cursor Agent
218eba3b47
Document new mechanics; extend smoke test + refresh screenshot
- README covers DaemonSets, spot nodes/pricing/reclaims, and cluster
  upgrades, plus the updated scoring and KPIs.
- Headless smoke test builds a richer scene (spot node + in-progress
  upgrade) and asserts daemonset pods/chips render; new screenshot shows
  it all.

Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 13:26:31 +00:00
Cursor Agent
6cd5194229
Render daemonsets, spot pricing, and upgrades in the UI
- New KPI tiles for live spot price and cluster version (with count of
  nodes left to upgrade).
- Node cards show their version (amber when out of date), a spot $/hr tag
  at the live price, a spot 'Reclaiming' countdown, distinct dashed
  DaemonSet chips, and an Upgrade button on outdated nodes.
- Daemonset overhead is drawn at the base of each resource meter.
- Badges/styles for Upgrading and Reclaiming states; a toast announces
  control-plane upgrade events.
- Help modal documents the new mechanics.

Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 13:26:24 +00:00
Cursor Agent
5c54c49ab8
Add daemonsets, spot interruptions, and node upgrades to sim core
- DaemonSets: infra pods the controller reconciles onto every matching
  node (gpu plugin only on GPU nodes); counted as per-node overhead, kept
  on drain like kubectl, and recreated when a node joins or finishes an
  upgrade.
- Spot nodes: a fluctuating spot price (mean-reverting random walk with
  occasional spikes) drives both billing and an unexpected-reclaim risk;
  reclaimed nodes give a short drain window before evicting their pods.
- Cluster upgrades: nodes carry a version, periodic upgrade events bump
  the target, and upgradeNode() drains + reboots a node onto the new
  version. Outdated nodes leak score while pending; a full rollout pays a
  bonus.
- Autopilot now recovers from spot reclaims and performs a safe one-at-a
  -time rolling upgrade.
- Tests cover daemonset reconciliation/overhead, spot reclaim + price
  bounds, upgrade drain/reboot, rollout bonus, and auto rolling upgrade.

Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 13:26:16 +00:00
Cursor Agent
982d8857e7
Add dev server, README, screenshot, and headless smoke tool
- server.js: zero-dependency static file server (Node built-ins only) with
  correct ES-module MIME types, path-traversal guard, and auto port fallback.
- package.json: type=module, start/serve/test/smoke scripts, no dependencies.
- README: how to run/play, the scheduling constraints, scoring formula,
  scenarios, project layout, and testing.
- tools/browser-smoke.mjs: optional end-to-end check that drives the real UI in
  headless Chrome over the DevTools Protocol (Node global fetch/WebSocket, no
  npm deps); verifies zero console errors, click-to-schedule, and screenshots.
- docs/screenshot.png: gameplay screenshot for the README.

Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 02:19:49 +00:00
Cursor Agent
6ad1a227c0
Add K8s scheduler game UI
Dark control-plane dashboard rendered with vanilla DOM (no framework):
- Node grid cards with status badges, label/taint chips, segmented CPU/Mem
  bin-packing bars colored per pod, GPU counters, and cordon/drain/delete actions.
- Pending-pod queue with per-pod constraint pills, wait timers, and a one-click
  auto-place (best-fit) button.
- Click-to-select a pod to highlight feasible nodes green and dim infeasible ones
  with the blocking reason; click or drag-and-drop onto a node to bind it.
- KPI bar (score, utilization, latency, pending/running, nodes, cost, SLA),
  scenario/speed/pause controls, auto-schedule + autoscaler toggles, event log,
  toasts, and a how-to-play modal.
- main.js drives a sim loop (setTimeout, speed-scaled) and a dirty-flag rAF
  render loop that never repaints mid-drag.

Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 02:19:39 +00:00
Cursor Agent
94c2de4236
Add K8s scheduler game simulation core and tests
Pure, UI-agnostic simulation:
- types: instance types (general/ssd/mem/gpu/spot node pools with labels & taints)
  and Deployment-like app templates (selectors, tolerations, hard/soft pod
  anti-affinity, replica caps, lifetimes).
- scheduler: kube-scheduler-style predicate filtering (resources, nodeSelector,
  taints/tolerations, anti-affinity, cordon/ready) returning human-readable
  reasons, plus a MostAllocated bin-packing scoring phase.
- workload: seeded PRNG + steady/spike/gpu/chaos scenarios with bounded,
  Deployment-like arrival streams.
- engine: tick loop, node lifecycle (provision/cordon/drain/delete), scheduling,
  job/service lifetimes, scoring (utilization vs latency vs cost), and an
  auto-scheduler + responsive cluster autoscaler.
- tests: predicates, engine actions, autoscaler, determinism, plus soak &
  balance runs asserting no overcommit and a healthy steady state.

Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com>
2026-06-26 02:19:29 +00:00
Jason Hall
42fd405534
Merge pull request #16 from imjasonh/copilot/add-pr-risk-scorer
Add PR risk scorer with LLM-based assessment and evaluation framework
2026-02-18 21:56:31 -05:00
copilot-swe-agent[bot]
91d03c0c0b Fix golangci-lint staticcheck issues in cifixer eval_test.go
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-19 02:51:19 +00:00
copilot-swe-agent[bot]
6e73e0d463 Fix golangci-lint staticcheck issues in pr-reconciler main.go
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-19 02:17:05 +00:00
copilot-swe-agent[bot]
1224664d2d Fix all golangci-lint issues: error handling, ineffassign, staticcheck, and unused code
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-19 02:08:09 +00:00
copilot-swe-agent[bot]
a4fd9b19cc Remove unused formatFileDiffs function and test to fix golangci-lint
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 22:32:13 +00:00
copilot-swe-agent[bot]
de6dbaaf07 Fix golangci-lint formatting issues
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:39:18 +00:00
copilot-swe-agent[bot]
7cbd7ac6ea Add pr-risk-scorer service and Terraform infrastructure with LLM integration
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:26:31 +00:00
copilot-swe-agent[bot]
1393815bc9 Rewrite risk scorer to use LLM agent framework with evaluation support
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:24:06 +00:00
copilot-swe-agent[bot]
ebaebe4044 Add comprehensive README documentation for pr-risk-scorer
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:14:38 +00:00
copilot-swe-agent[bot]
ec49bb999f Fix formatting issues in struct tags and remove extra blank line
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:13:20 +00:00
copilot-swe-agent[bot]
ae34b14b29 Add Terraform infrastructure for pr-risk-scorer deployment
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:12:12 +00:00
copilot-swe-agent[bot]
85c5b630ad Address code review feedback - improve pattern matching and simplify helpers
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:08:43 +00:00
copilot-swe-agent[bot]
e56aeb29a6 Add pr-risk-scorer command with full implementation
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:07:15 +00:00
copilot-swe-agent[bot]
0dfa7cbae1 Add internal/risk package with comprehensive tests
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-18 17:04:53 +00:00
copilot-swe-agent[bot]
2617dd6bad Initial plan 2026-02-18 16:59:31 +00:00
Jason Hall
a0b010d627
Merge pull request #14 from imjasonh/vfs
update litestream to vfs
2026-02-05 21:56:45 -05:00
Jason Hall
0983014992 clean up logging
Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-02-05 21:55:20 -05:00
Jason Hall
a57a90de12 update litestream to vfs
Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-02-05 21:46:52 -05:00
Jason Hall
d4600f2a19
Merge pull request #13 from imjasonh/ci-fixer
add ci-fixer
2026-02-04 14:23:30 -05:00
pr-reconciler
80bb808366 fix: resolve CI lint errors - remove unused function, fix deprecated calls, add error handling 2026-02-04 19:05:12 +00:00
Jason Hall
4be99d04da re-enable lint, latest versions
Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-02-04 13:58:59 -05:00
Jason Hall
943c6d1f28 ci: temporarily disable golangci-lint until it supports Go 1.25 2026-02-04 13:48:26 -05:00
Jason Hall
aff5c420f6 fix: require Go 1.25.4 to match chainguard.dev/driftlessaf dependency 2026-02-04 13:46:07 -05:00
Jason Hall
ba86d9a4ca fix: use latest golangci-lint to support Go 1.25 2026-02-04 13:43:31 -05:00
pr-reconciler
b625fde14d fix: correct invalid Go version from 1.25.4 to 1.23.4 2026-02-04 18:43:04 +00:00
Jason Hall
f936d8302f fix: use real chainguard.dev/driftlessaf module instead of broken replace directive 2026-02-04 13:39:45 -05:00
pr-reconciler
6758e575c0 fix: correct singular/plural handling in CI status messages 2026-02-04 18:19:54 +00:00
pr-reconciler
ab44593fa3 fix: correct go.mod replace directive timestamp and workflow cache path 2026-02-04 18:15:49 +00:00
pr-reconciler
68ea3d06be fix: handle error from strconv.Atoi in parsePRURL function 2026-02-04 18:12:56 +00:00
pr-reconciler
08124b3bf8 fix: correct invalid Go version in go.mod from 1.25.5 to 1.23 2026-02-04 18:09:17 +00:00
Jason Hall
4aaa1eec57 fix: use correct Vertex AI Claude model format (@ instead of -) 2026-02-04 13:04:40 -05:00
Jason Hall
0334f118a2 Fix Claude model version to claude-sonnet-4-5@20250514 2026-02-04 12:57:53 -05:00
Jason Hall
58b6bdb0f2 Use requeue polling instead of check_run events for CI completion
When CI is pending, the reconciler now returns RequeueAfterSeconds: 60
to poll for CI completion every minute, instead of relying on check_run
events which are difficult to route through the workqueue.

- Remove check-run-workqueue from trigger.tf
- Remove processCheckRunEvent and related parsing code
- Add requeue when CIFixPending is true
- Update agent.md to remove check_run event documentation
2026-02-04 12:53:35 -05:00
Jason Hall
009f2ec186 Fix check_run events using subject instead of repo extension
The github-events trampoline sets event.SetSubject(repoFullName) which
becomes ce-subject attribute, but does NOT set a 'repo' extension.

- Change extension_key from 'repo' to 'subject' for check-run-workqueue
- Rename parseRepoURL to parseRepoKey to handle both URL and subject formats
- Add tests for subject format (owner/repo)

This allows check_run completion events to flow through the workqueue
and trigger CI fixer reconciliation.
2026-02-04 12:43:03 -05:00
Jason Hall
87ca77d9dd trigger CI to test check_run events 2026-02-04 12:30:59 -05:00
Jason Hall
63745e0cb6 update evaluateCIStatus
Signed-off-by: Jason Hall <jason@chainguard.dev>
2026-02-04 12:25:20 -05:00
Jason Hall
0255000457 Treat zero checks as pending, not passing
When a push event triggers reconciliation, the GitHub workflow may not
have started yet, resulting in 0 checks. Previously this was treated
as 'all checks passing'. Now we treat it as pending and wait for checks
to start.
2026-02-04 12:16:26 -05:00
Jason Hall
6100adadeb Improve CI fixer status messages in check run
- Show 'Waiting for CI to complete' when pending instead of success
- Distinguish 'CI passing after fix' from 'CI is passing' (no fix needed)
- Show turns attempted for all states
- Clearer messaging overall
2026-02-04 12:14:58 -05:00
Jason Hall
53052f0d98 Fix filter format for check-run-workqueue 2026-02-04 12:11:08 -05:00
Jason Hall
9b13ff140d Add check_run workqueue for CI completion events
The github-events module doesn't set pullrequesturl for check_run events,
so they don't trigger the PR workqueue. This adds a separate workqueue that
listens for check_run completion events keyed by repo URL.

When a check_run event is received, the reconciler:
1. Lists open PRs with the ci-autofix label
2. Processes each one to re-evaluate CI status

Also keeps check run status as in_progress while waiting for CI.
2026-02-04 12:09:12 -05:00
Jason Hall
b5cd02f65c Keep check run in_progress while waiting for CI checks 2026-02-04 12:03:57 -05:00