From 10d44ec2b481f25f8e277befda8983ddba8b4e82 Mon Sep 17 00:00:00 2001 From: Zachary Blasczyk <77289967+wandb-zacharyblasczyk@users.noreply.github.com> Date: Fri, 16 Feb 2024 09:51:24 -0600 Subject: [PATCH] docs(operator-wand): Add a local-development.md (#79) --- charts/operator-wandb/local-development.md | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 charts/operator-wandb/local-development.md diff --git a/charts/operator-wandb/local-development.md b/charts/operator-wandb/local-development.md new file mode 100644 index 00000000..38f7d840 --- /dev/null +++ b/charts/operator-wandb/local-development.md @@ -0,0 +1,98 @@ +# Helm Chart Operator Development Guide + +This guide provides instructions for local development and testing of the Helm chart operator for the `wandb/helm-charts` repository. It includes setup instructions, development workflow, and guidelines for contributing to the repository. + +## Prerequisites + +- Helm (3.x+) +- kubectl (configured with access to your Kubernetes cluster) +- AWS CLI (configured with the necessary permissions) +- Azure CLI +- Google Cloud SDK + +## Setup + +### 1. Cloud Provider Login + +#### AWS + +Update your kube-context for the EKS cluster: + +```bash +aws eks update-kubeconfig --name smooth-operator --region us-west-2 +``` + +#### Azure + +Log in to Azure CLI: + +```bash +az login +az account set --subscription +az aks get-credentials --resource-group --name +``` + + +#### GCP + +Authenticate with the Google Cloud SDK: + +```bash +gcloud auth login +gcloud container clusters get-credentials YOUR_CLUSTER_NAME --zone YOUR_ZONE --project YOUR_PROJECT +``` + +### 2. Clone the Helm Charts Repository + +Clone the `wandb/helm-charts` repository: + +```bash +git clone https://github.com/wandb/helm-charts.git +cd helm-charts +``` + +### 3. Initial Setup for Development + +Extract the current values from the deployed Helm chart and scale down the `wandb-controller-manager` deployment: + +```bash +helm get values wandb > operator-spec.yaml +kubectl scale --replicas=0 deployment -n wandb wandb-controller-manager +``` + +### 4. Develop and Test Your Changes + +After extracting the current chart values into `operator-spec.yaml`, you can start making your changes to the chart or the operator specifications. + +#### Building Dependencies + +Before deploying your changes, ensure that any chart dependencies are updated: + +```bash +helm dependency build ./charts/operator-wandb +``` + +#### Upgrading the Helm Release + +To apply your changes, upgrade the Helm release with your modified specifications: + +```bash +helm upgrade \ + --install wandb \ + ./charts/operator-wandb -f ./operator-spec.yaml +``` + +### 5. Finalizing Development + +After completing your development work: + +1. Ensure to increment the version in `Chart.yaml` of your Helm chart, e.g., `0.10.43`. +2. Scale the `wandb-controller-manager` deployment back up: + + ```bash + kubectl scale --replicas=1 deployment -n wandb wandb-controller-manager + ``` + +## Contributing + +After testing your changes locally, submit a pull request with your modifications. Ensure your commits are well-documented, and your PR includes a summary of the changes and any testing performed.