Skip to content

feat: streamline dev setup DX with auto-sourced env config - #4

Merged
Gkrumbach07 merged 1 commit into
Gkrumbach07:mainfrom
rhuss:fix-dev-setup
Aug 1, 2026
Merged

feat: streamline dev setup DX with auto-sourced env config#4
Gkrumbach07 merged 1 commit into
Gkrumbach07:mainfrom
rhuss:fix-dev-setup

Conversation

@rhuss

@rhuss rhuss commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Streamline the local development experience so running the full OIDC auth stack takes one command.

Before: 5 manual env var exports + 2 commands
After: make dev-full (or make dev after first run)

What changed

  • scripts/dev-env.sh orchestrates Keycloak (Podman), self-signed TLS, and the OpenShell gateway
  • Makefile auto-sources scripts/.env.dev via -include (zero manual exports after first run)
  • OPENSHELL_DIR resolved interactively on first run, with option to clone from GitHub
  • Robust stop command handles orphaned processes, stale PIDs, and dangling containers
  • grpcurl workspace creation uses proto descriptor instead of server reflection
  • BFF supports custom CA via GATEWAY_CA_CERT env var

Use cases

First-time setup

make setup
make dev-full    # prompts for OpenShell dir, starts everything

Open http://localhost:3000, log in with admin@test / admin.

Daily development

make dev         # infra already running, config auto-loaded from scripts/.env.dev

After pulling upstream gateway changes

./scripts/dev-env.sh rebuild-gateway

Clean shutdown

./scripts/dev-env.sh stop    # kills gateway, removes Keycloak, cleans up orphans

Check what's running

./scripts/dev-env.sh status

Components started by dev-full

Component Type Port Lifecycle
Keycloak Podman container 8180 Until stop
Gateway Background process 17670 (gRPCs) + 17671 (health) Until stop
BFF go run 8080 Until Ctrl+C
Frontend Webpack dev server 3000 Until Ctrl+C

Merge order

This PR should be merged before PR #2 (SDK migration), which is rebased on top of it.

Test plan

  • Fresh clone: make setup && make dev-full prompts for OpenShell dir, starts everything
  • Second run: make dev reads config without prompts
  • ./scripts/dev-env.sh stop cleans up everything including orphaned processes
  • ./scripts/dev-env.sh rebuild-gateway rebuilds and restarts gateway only
  • Log in at localhost:3000 via Keycloak with admin@test / admin

🤖 Generated with Claude Code

@rhuss
rhuss marked this pull request as draft July 31, 2026 20:53
@rhuss
rhuss force-pushed the fix-dev-setup branch 2 times, most recently from bd4d49b to 10d0d31 Compare August 1, 2026 06:49
@rhuss rhuss changed the title fix: use proto descriptor for grpcurl workspace creation feat: streamline dev setup DX with auto-sourced env config Aug 1, 2026
@rhuss
rhuss force-pushed the fix-dev-setup branch 2 times, most recently from 1b315c2 to 757f98a Compare August 1, 2026 07:14
@rhuss
rhuss marked this pull request as ready for review August 1, 2026 07:57
@rhuss
rhuss force-pushed the fix-dev-setup branch 2 times, most recently from 3eabd96 to 32df1e7 Compare August 1, 2026 12:11
DX improvements:
- dev-env.sh writes scripts/.env.dev with all config (including OPENSHELL_DIR)
- Makefile auto-sources scripts/.env.dev via -include (zero manual exports)
- make dev-full: one command starts infra + dashboard
- make dev: auto-reads config from previous dev-env.sh start

OPENSHELL_DIR resolution:
- Checks env var first, then scripts/.env.dev, then prompts interactively
- Offers to clone NVIDIA/OpenShell if no checkout exists
- Persists the path to .env.dev for future runs

Robust shutdown:
- Graceful stop with 10s timeout, then SIGKILL
- Detects and kills orphaned gateway processes on the expected port
- Force-removes Keycloak containers regardless of state
- Cleans up stale PID/log/config files (preserves PKI, DB, env config)

Also: fix grpcurl to use proto descriptor instead of server reflection

Assisted-By: 🤖 Claude Code
@Gkrumbach07
Gkrumbach07 merged commit ae30064 into Gkrumbach07:main Aug 1, 2026
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