From 50122e893ea9763e783170e15f1ccd86eca6b0cc Mon Sep 17 00:00:00 2001 From: TheHiddenLayer <37908451+TheHiddenLayer@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:53:27 -0700 Subject: [PATCH 1/3] docs: enhance details & directions --- docs/contributing/local-development.md | 44 +++++++++++++++++++++----- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/docs/contributing/local-development.md b/docs/contributing/local-development.md index 12c92379..076fcf10 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,12 +11,29 @@ 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 out/release/artifacts/temporal-operator.crds.yaml +kubectl apply -f out/release/artifacts/temporal-operator.yaml +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 ``` ## Generate @@ -26,12 +44,22 @@ Generate crd and docs when api is modified make generate ``` -## Run Tilt +## Test -Then run: +Run tests with coverage report: ```bash -tilt up +make test ``` -Now, Tilt will automatically reload the deployment to your local cluster every time you make a code change. +Run end-to-end tests: + +```bash +make test-e2e +``` + +Run end-to-end tests on development computer using `kind`: + +```bash +make test-e2e-dev +``` From acbda8921c70a5c243f3eee92a6e34a85da0b7e0 Mon Sep 17 00:00:00 2001 From: TheHiddenLayer <37908451+TheHiddenLayer@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:24:43 -0700 Subject: [PATCH 2/3] add info abt cluster shutdown and port forwarding --- docs/contributing/local-development.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/contributing/local-development.md b/docs/contributing/local-development.md index 076fcf10..3455567c 100644 --- a/docs/contributing/local-development.md +++ b/docs/contributing/local-development.md @@ -36,6 +36,8 @@ 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 @@ -63,3 +65,9 @@ Run end-to-end tests on development computer using `kind`: ```bash make test-e2e-dev ``` + +## Gracefully Shutdown k8s Cluster + +```bash +make clean-dev-cluster +``` From 760fcb62115fcf0ab397cada1886aaf5f028ca4b Mon Sep 17 00:00:00 2001 From: TheHiddenLayer <37908451+TheHiddenLayer@users.noreply.github.com> Date: Fri, 2 Aug 2024 09:50:40 -0700 Subject: [PATCH 3/3] address comments: remove parts that are applied by tilt and fix typo. --- docs/contributing/local-development.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/contributing/local-development.md b/docs/contributing/local-development.md index 3455567c..f928dbcb 100644 --- a/docs/contributing/local-development.md +++ b/docs/contributing/local-development.md @@ -28,15 +28,13 @@ Once the local cluster is created, start applying your desired manifests and let ```bash # example make artifacts -kubectl apply -f out/release/artifacts/temporal-operator.crds.yaml -kubectl apply -f out/release/artifacts/temporal-operator.yaml 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: +Note: if you wish to interact with the Temporal Web UI or frontend gRPC service, you should port forward the services to localhost. ## Generate