Skip to content

refactor(gateway): remove pre-generated debug keys - #999

Merged
kvinwang merged 4 commits into
masterfrom
codex/remove-gateway-debug-key
Aug 6, 2026
Merged

refactor(gateway): remove pre-generated debug keys#999
kvinwang merged 4 commits into
masterfrom
codex/remove-gateway-debug-key

Conversation

@kvinwang

@kvinwang kvinwang commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • remove the obsolete gen_debug_key utility and debug.key_file certificate path
  • always obtain Gateway TLS keys through the Guest Agent GetTlsKey API
  • remove the Gateway-only KMS configuration and dependencies that supported the static debug-key flow
  • run the certbot Docker E2E stack against a local dstack-guest-agent-simulator container instead of a hard-coded external simulator endpoint

debug.insecure_skip_attestation remains available because it is still used by existing Gateway RPC and WaveKV test authorization paths; this PR only removes the pre-generated key and quote mechanism.

Rationale

The static debug_key.json bundle predates the supported simulator workflow. Keeping a private key, quote, event log, and VM configuration synchronized in a generated file bypasses the normal Guest Agent integration and makes tests depend on implementation-specific debug behavior. The local simulator now exercises the same GetTlsKey path used by deployments.

Verification

  • cargo fmt --manifest-path dstack/Cargo.toml --all
  • cargo check --manifest-path dstack/Cargo.toml -p dstack-gateway
  • cargo test --manifest-path dstack/Cargo.toml -p dstack-gateway --no-run
  • docker compose -f dstack/gateway/test-run/e2e/docker-compose.yml config --quiet
  • built the E2E simulator image and verified its Unix socket health check reaches healthy
  • git diff --check

Copilot AI lite review requested due to automatic review settings August 4, 2026 15:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the legacy “pre-generated debug key / KMS-signed cert” path from dstack-gateway and updates the gateway’s test infrastructure to obtain RPC TLS keys exclusively via the Guest Agent GetTlsKey API, including adding a test-local guest-agent-simulator container for the certbot E2E docker stack.

Changes:

  • Removed gen_debug_key, debug.key_file, and Gateway-side KMS signing dependencies/configuration.
  • Switched gateway cert generation to always use Guest Agent GetTlsKey.
  • Updated certbot E2E docker-compose to run against a local dstack-guest-agent-simulator via a shared Unix socket volume.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/dev-stack.sh Drops gateway kms_url and debug attestation-skip stanza from the generated dev config.
dstack/gateway/test-run/test_suite.sh Removes kms_url="" from generated configs used by the legacy WaveKV harness.
dstack/gateway/test-run/test_certbot.sh Removes kms_url="" from generated configs used by the legacy distributed certbot harness.
dstack/gateway/test-run/proxy/gwconfig.py Removes kms_url="" from the proxy integration test config emitter.
dstack/gateway/test-run/e2e/Dockerfile.simulator.dockerignore Adds a dockerignore for the new simulator Dockerfile build to keep contexts small.
dstack/gateway/test-run/e2e/Dockerfile.simulator Adds an image build for dstack-guest-agent-simulator for local E2E runs.
dstack/gateway/test-run/e2e/docker-compose.yml Adds simulator service + shared socket volume; points gateways at unix:/var/run/dstack/dstack.sock.
dstack/gateway/test-run/e2e/configs/simulator.toml Adds simulator config binding the internal API to the shared Unix socket.
dstack/gateway/test-run/e2e/configs/gateway-{1,2,3}.toml Removes kms_url="" from gateway E2E configs.
dstack/gateway/test-run/cluster.sh Removes kms_url="" from generated configs used by the legacy cluster harness.
dstack/gateway/src/main.rs Removes debug-key/KMS signing flow; always calls Guest Agent GetTlsKey for RPC TLS material.
dstack/gateway/src/gen_debug_key.rs Deletes obsolete debug key generator utility.
dstack/gateway/src/config.rs Removes kms_url and debug.key_file from config structs.
dstack/gateway/gateway.toml Removes kms_url and debug.key_file from the default config template.
dstack/gateway/docs/cluster-deployment.md Removes kms_url from config examples.
dstack/gateway/Cargo.toml Drops KMS/base64 deps and the gen_debug_key bin; removes ra-rpc client feature.
dstack/Cargo.lock Removes gateway’s transitive deps related to the deleted debug-key/KMS flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dstack/gateway/test-run/test_suite.sh
Comment thread dstack/gateway/test-run/test_certbot.sh
Comment thread dstack/gateway/test-run/cluster.sh
Comment thread dstack/gateway/src/main.rs
Comment thread dstack/gateway/docs/cluster-deployment.md
@kvinwang
kvinwang force-pushed the codex/remove-gateway-debug-key branch from 5d4322c to 8120cab Compare August 5, 2026 00:46
@kvinwang
kvinwang merged commit d22a8c7 into master Aug 6, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants