diff --git a/_local/README.md b/_local/README.md index f97bf29e150..7b251a49087 100644 --- a/_local/README.md +++ b/_local/README.md @@ -8,7 +8,7 @@ Everything the local dev stack uses. `mage dev:up ` wires these pieces | `compose/stack.yaml` | Dependency containers: redis, postgres, pulsar, plus keycloak (`auth` profile) and prometheus (`prometheus` profile) | | `compose/full.yaml` | Fully containerized Armada stack, used by `mage dev:full` and CI | | `compose/postgres-init.sql` | Creates the scheduler and lookout databases when the postgres container first initialises | -| `procfiles/` | Goreman procfiles: `no-auth`, `auth`, `fake-executor`, each with a `-dap` (Delve debug) variant | +| `procfiles/` | Goreman procfiles: `no-auth`, `auth`, `fake-executor`, `auth-fake-executor`, each with a `-dap` (Delve debug) variant | | `scripts/` | `init.sh` (migrations + priority classes) and helpers for port conflicts, dlv readiness, and pre-building components | | `kind/` | Kind cluster config for running a real executor locally | | `keycloak/` | Keycloak realm import for the `auth` profile | diff --git a/_local/procfiles/auth-fake-executor-dap.Procfile b/_local/procfiles/auth-fake-executor-dap.Procfile new file mode 100644 index 00000000000..fe5559154ad --- /dev/null +++ b/_local/procfiles/auth-fake-executor-dap.Procfile @@ -0,0 +1,8 @@ +server: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-server ./cmd/server/main.go && dlv dap --listen=:2345 +scheduler: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-scheduler ./cmd/scheduler/main.go && dlv dap --listen=:2346 +scheduleringester: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-scheduleringester ./cmd/scheduleringester/main.go && dlv dap --listen=:2347 +eventingester: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-eventingester ./cmd/eventingester/main.go && dlv dap --listen=:2348 +fakeexecutor: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-fakeexecutor ./cmd/fakeexecutor/main.go && dlv dap --listen=:2353 +lookout: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-lookout ./cmd/lookout/main.go && dlv dap --listen=:2350 +lookoutingester: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-lookoutingester ./cmd/lookoutingester/main.go && dlv dap --listen=:2351 +binoculars: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-binoculars ./cmd/binoculars/main.go && dlv dap --listen=:2352 diff --git a/_local/procfiles/auth-fake-executor.Procfile b/_local/procfiles/auth-fake-executor.Procfile new file mode 100644 index 00000000000..8c73c1cdfb7 --- /dev/null +++ b/_local/procfiles/auth-fake-executor.Procfile @@ -0,0 +1,9 @@ +server: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-server ./cmd/server/main.go && ./dist/armada-server --config ./_local/server/config-auth.yaml +scheduler: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-scheduler ./cmd/scheduler/main.go && ./dist/armada-scheduler run --config ./_local/scheduler/config-auth.yaml +scheduleringester: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-scheduleringester ./cmd/scheduleringester/main.go && ./dist/armada-scheduleringester --config ./_local/scheduleringester/config.yaml +eventingester: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-eventingester ./cmd/eventingester/main.go && ./dist/armada-eventingester --config ./_local/eventingester/config.yaml +fakeexecutor: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-fakeexecutor ./cmd/fakeexecutor/main.go && ./dist/armada-fakeexecutor --config ./_local/fakeexecutor/config.yaml +lookout: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-lookout ./cmd/lookout/main.go && ./dist/armada-lookout --config ./_local/lookout/config-auth.yaml +lookoutingester: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-lookoutingester ./cmd/lookoutingester/main.go && ./dist/armada-lookoutingester --config ./_local/lookoutingester/config.yaml +binoculars: ${GO_BIN:-go} build -gcflags="all=-N -l" -o ./dist/armada-binoculars ./cmd/binoculars/main.go && ./dist/armada-binoculars --config ./_local/binoculars/config-auth.yaml +lookoutui: sh -c 'cd internal/lookoutui && yarn install && yarn run openapi && PROXY_TARGET=http://localhost:8089 yarn dev' diff --git a/docs/developer_guide.md b/docs/developer_guide.md index e2547686b44..2adcfcb6b8e 100644 --- a/docs/developer_guide.md +++ b/docs/developer_guide.md @@ -86,7 +86,7 @@ Two smaller targets support these: `mage dev:deps` runs only the dependency cont The `no-auth` and `auth` profiles run a real executor, which needs a Kubernetes cluster. Create one with `mage kind`, which writes its kubeconfig to `.kube/external/config`, and start the stack with `KUBECONFIG=.kube/external/config mage dev:up no-auth`. Without `KUBECONFIG` set, the executor falls back to your default kubeconfig and connects to whatever cluster that selects. Use the `fake-executor` profile if you do not want a cluster at all. -The profile argument is required and is a comma-separated list of tokens: `no-auth`, `auth`, `fake-executor`, and `hot-cold` pick the procfile, and any other token (for example `prometheus`) is passed to docker compose as a `--profile` flag. The optional `-dap` flag starts every component under a headless [Delve](https://github.com/go-delve/delve) DAP server so your editor can attach a debugger, e.g. `mage dev:up auth,prometheus -dap`. +The profile argument is required and is a comma-separated list of tokens: `no-auth`, `auth`, `fake-executor`, `auth-fake-executor`, and `hot-cold` pick the procfile, and any other token (for example `prometheus`) is passed to docker compose as a `--profile` flag. Use `auth-fake-executor` to run the OIDC-enabled server without a Kubernetes cluster. The optional `-dap` flag starts every component under a headless [Delve](https://github.com/go-delve/delve) DAP server so your editor can attach a debugger, e.g. `mage dev:up auth,prometheus -dap`. If `mage dev:up no-auth` reports `Unknown target`, your mage binary is too old for optional flags (`mage checkDeps` verifies this). Upgrade it, or use `go run github.com/magefile/mage@v1.17.2 `, which also works without installing mage at all. @@ -140,6 +140,7 @@ All Procfiles are located in `_local/procfiles/`: | `no-auth.Procfile` | Standard setup without authentication | | `auth.Procfile` | Standard setup with OIDC authentication | | `fake-executor.Procfile` | Uses fake executor for testing without Kubernetes | +| `auth-fake-executor.Procfile` | OIDC authentication with the fake executor, no Kubernetes | | `hot-cold.Procfile` | Runs the parallel hot/cold Lookout stack | Each profile also has a `-dap` variant, described under [Debugging](#debugging). Restart individual processes with `goreman restart ` (e.g., `goreman restart server`). diff --git a/magefiles/dev.go b/magefiles/dev.go index d7291a4ca97..4ea57e5638a 100644 --- a/magefiles/dev.go +++ b/magefiles/dev.go @@ -30,11 +30,12 @@ const ( // Up brings up dependencies and runs Armada components via goreman with the chosen profile. // // profiles is a comma-separated list of tokens: -// - "no-auth" - the default profile -// - "auth" - enables OIDC (Keycloak); sets goreman profile to "auth" and uses the auth compose profile -// - "fake-executor" - no Kubernetes needed; sets goreman profile to "fake-executor" -// - "hot-cold" - runs the hot-cold scheduler setup -// - anything else - forwarded as a docker-compose --profile flag for extra services +// - "no-auth" - the default profile +// - "auth" - enables OIDC (Keycloak); sets goreman profile to "auth" and uses the auth compose profile +// - "fake-executor" - no Kubernetes needed; sets goreman profile to "fake-executor" +// - "auth-fake-executor" - auth server/scheduler/lookout/binoculars plus the fake executor (no Kubernetes) +// - "hot-cold" - runs the hot-cold scheduler setup +// - anything else - forwarded as a docker-compose --profile flag for extra services // // The optional -dap flag selects the "-dap" procfile variant, which starts each component // under dlv in headless DAP mode so an editor debugger can attach. @@ -62,9 +63,9 @@ func (Dev) Up(profiles string, dap *bool) error { continue } switch token { - case "auth", "fake-executor", "hot-cold": + case "auth", "fake-executor", "hot-cold", "auth-fake-executor": if profile != "no-auth" { - fmt.Printf("warning: ignoring %q - profile already set to %q; only one of auth/fake-executor/hot-cold may be used\n", token, profile) + fmt.Printf("warning: ignoring %q - profile already set to %q; only one of auth/fake-executor/hot-cold/auth-fake-executor may be used\n", token, profile) } else { profile = token } @@ -84,7 +85,7 @@ func (Dev) Up(profiles string, dap *bool) error { return fmt.Errorf("unknown profile %q: %s not found", profile+debugSuffix, procfile) } - if profile == "auth" { + if profile == "auth" || profile == "auth-fake-executor" { composeProfiles = append([]string{"auth"}, composeProfiles...) } @@ -99,7 +100,7 @@ func (Dev) Up(profiles string, dap *bool) error { if err := sh.RunV(initArgs[0], initArgs[1:]...); err != nil { return err } - if profile == "auth" { + if profile == "auth" || profile == "auth-fake-executor" { if err := waitForKeycloak(2 * time.Minute); err != nil { return err }