diff --git a/docs/contributing/local-development.md b/docs/contributing/local-development.md index 12c92379..f928dbcb 100644 --- a/docs/contributing/local-development.md +++ b/docs/contributing/local-development.md @@ -1,6 +1,7 @@ # Prerequisites -- [Docker](https://docs.docker.com/engine/install/) +- [Docker](https://docs.docker.com/engine/install/) and [docker-buildx](https://github.com/docker/buildx) +- [Helm](https://helm.sh/) - [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) - [tilt](https://docs.tilt.dev/install.html) - [Golang](https://go.dev/doc/install) @@ -10,14 +11,31 @@ Tilt offers a simple way of creating a local development environment. -## Create a kind cluster +## Create local k8s cluster -Create a kind cluster with a local registry: +```bash +make deploy-dev +``` + +Open the `tilt` browser UI by pressing the "space" key when prompted. Note that `tilt` sets up a directory watcher and will automatically redeploy any code changes! + +You can check the "temporal-operator-controller-manager" Pod status with `kubectl get pods -n temporal-system -w`. + +## Apply Manifests + +Once the local cluster is created, start applying your desired manifests and let the temporal operator handle reconciliation: ```bash -make dev-cluster +# example +make artifacts +kubectl apply -f examples/cluster-postgres/00-namespace.yaml +kubectl apply -f examples/cluster-postgres/01-postgresql.yaml +kubectl apply -f examples/cluster-postgres/02-temporal-cluster.yaml +kubectl apply -f examples/cluster-postgres/03-temporal-namespace.yaml ``` +Note: if you wish to interact with the Temporal Web UI or frontend gRPC service, you should port forward the services to localhost. + ## Generate Generate crd and docs when api is modified @@ -26,12 +44,28 @@ Generate crd and docs when api is modified make generate ``` -## Run Tilt +## Test + +Run tests with coverage report: + +```bash +make test +``` + +Run end-to-end tests: -Then run: +```bash +make test-e2e +``` + +Run end-to-end tests on development computer using `kind`: ```bash -tilt up +make test-e2e-dev ``` -Now, Tilt will automatically reload the deployment to your local cluster every time you make a code change. +## Gracefully Shutdown k8s Cluster + +```bash +make clean-dev-cluster +```