Skip to content

Add automatic schema management with database dependencies and minor changes #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2d54ea3
Squashed commit of the following:
CosminL-DEV Jun 25, 2025
55e7237
Create schema-create-job.yaml
CosminL-DEV Jun 25, 2025
ed0cd00
Create schema-setup-job.yaml
CosminL-DEV Jun 25, 2025
c40e481
Create schema-update-job.yaml
CosminL-DEV Jun 25, 2025
40933c5
Schema changes in values.yaml
CosminL-DEV Jun 25, 2025
cf90e49
delete 3 job and converted in 1
CosminL-DEV Jun 25, 2025
604dd7e
delete old schema job
CosminL-DEV Jun 25, 2025
a85bf35
Update schema-server-job.yaml
CosminL-DEV Jun 25, 2025
2e49d72
values.schema restructure final
CosminL-DEV Jun 25, 2025
6371e98
hooks needed
CosminL-DEV Jun 25, 2025
4bc9b53
wait-for-database added
CosminL-DEV Jun 25, 2025
791fafb
datacenter and setup handler added
CosminL-DEV Jun 25, 2025
144ee31
Revert "hooks needed"
CosminL-DEV Jun 25, 2025
eaeabf6
auto-delete job after success
CosminL-DEV Jun 25, 2025
852cae8
add protocol version
CosminL-DEV Jun 25, 2025
9b640af
remove useless helper
CosminL-DEV Jun 25, 2025
80015e1
helm ignore added
CosminL-DEV Jun 25, 2025
9f326b0
Delete .helmignore
CosminL-DEV Jun 25, 2025
2a28fb6
wait-frontend added to web
CosminL-DEV Jun 25, 2025
2ca5fe3
old cassandra removed
CosminL-DEV Jun 25, 2025
f8abff8
modern dependencies
CosminL-DEV Jun 25, 2025
845c979
Update CONTRIBUTING.md
CosminL-DEV Jun 25, 2025
a6c459a
block rollbacks
CosminL-DEV Jun 25, 2025
880f44b
Create schema-elasticsearch-job.yaml
CosminL-DEV Jun 25, 2025
66f3d33
added servername to job
CosminL-DEV Jun 25, 2025
42b2ecd
change default for tls auto-generated
CosminL-DEV Jun 25, 2025
bffe057
auto-detect schema versions
CosminL-DEV Jun 26, 2025
1d0f0c2
change command source and wait for file
CosminL-DEV Jun 26, 2025
b13c725
remove hardcoded filepath
CosminL-DEV Jun 26, 2025
b80fec8
fix wait-for-mysql in job
CosminL-DEV Jun 26, 2025
8431891
handled mysql createdb
CosminL-DEV Jun 26, 2025
974f318
comment updated
CosminL-DEV Jun 26, 2025
d17b516
postgresql wait for db corrected to use tls
CosminL-DEV Jun 26, 2025
4eeb88c
base for elasticsearch
CosminL-DEV Jun 26, 2025
d29d57b
idea of ES job
CosminL-DEV Jun 26, 2025
25e2da0
fix wrong shared
CosminL-DEV Jun 26, 2025
da6fc94
useless env
CosminL-DEV Jun 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 79 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,126 @@

## Build and generate template yml locally

```
```bash
helm package ./charts/cadence
helm template cadence-release cadence-0.1.8.tgz > template_out.yaml
# Replace with current chart version
helm template cadence-release cadence-0.2.0.tgz > template_out.yaml
```

## Build and deploy to a k8s cluster

1. Build helm package and deploy to a k8s cluster
### 1. Update dependencies (if needed)
```bash
cd charts/cadence
helm dependency update
cd ../..
```

### 2. Build helm package and deploy to a k8s cluster
```bash
helm package ./charts/cadence
helm upgrade --install cadence-release cadence-0.1.8.tgz \
# Replace with current chart version
helm upgrade --install cadence-release cadence-0.2.0.tgz \
-n cadencetest \
--create-namespace
```

2. Port forward to check the UI
```
### 3. Port forward to check the UI
```bash
kubectl port-forward svc/cadence-release-web 8088:8088 -n cadencetest
```

Visit localhost:8088 and validate it is accessible.
Visit http://localhost:8088 and validate it is accessible.

3. Port forward frontend service to run CLI commands
```
### 4. Port forward frontend service to run CLI commands
```bash
kubectl port-forward svc/cadence-release-frontend 7833:7833 -n cadencetest
```

4. (optional) Register a domain:
```
### 5. (Optional) Register a domain:
```bash
cadence \
--address localhost:7833 \
--transport grpc \
--domain samples-domain \
--domain default \
domain register \
--retention 1
```

5. Run samples:
- Clone https://github.com/uber-common/cadence-samples
### 6. Run samples:
- Clone https://github.com/cadence-workflow/cadence-samples

- Run sample worker (run at samples repo root)
```
- Run sample worker (execute at samples repo root):
```bash
./bin/helloworld -m worker
```

- Trigger a workflow (run at samples repo root)
```
- Trigger a workflow (execute at samples repo root):
```bash
./bin/helloworld -m trigger
```

6. Visit localhost:8088 and validate the new workflow exists!
### 7. Validate deployment
Visit http://localhost:8088 and validate the new workflow exists!

## Generate helmdocs
## Generate helm documentation

Install [helm-docs](https://github.com/norwoodj/helm-docs):
```
```bash
go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
```

Run it
```
Generate documentation:
```bash
helm-docs
```

cadencechart/README.md file should be updated.
The `charts/cadence/README.md` file should be updated automatically.

## Release Process

### Before making a release:

1. **Update appVersion and dependencies**:
- Check if Cadence has a new release and update `appVersion` in `Chart.yaml`
- Verify dependencies are using latest-1 stable versions:
- Cassandra: Currently using `11.x.x` from Bitnami
- PostgreSQL: Currently using `16.x.x` from Bitnami
- MySQL: Currently using `12.x.x` from Bitnami
- Update `global.image.tag` in `values.yaml` to match `appVersion`

2. **Update dependencies**:
```bash
cd charts/cadence
helm dependency update
cd ../..
```

3. **Test the changes**:
- Build and deploy locally following the steps above
- Validate all functionality works as expected

4. **Increment chart version**: Update the `version` field in `charts/cadence/Chart.yaml`:
- Patch version (0.2.1): Bug fixes, dependency updates
- Minor version (0.3.0): New features, breaking changes
- Major version (1.0.0): Major breaking changes

5. **Update documentation**: Run `helm-docs` to regenerate the README.md

### Publishing:

After making changes to templates and incrementing the chart version in `charts/cadence/Chart.yaml`, merge your changes to the main branch.

The automation will handle publishing the new version using [Chart Releaser Action](https://helm.sh/docs/howto/chart_releaser_action/). The Cadence chart is hosted on GitHub Pages.

After the new version is available in the helm repository, deploy it to a Kubernetes cluster to validate the release.

## Publish chart
## Version Management Checklist

After making changes to templates, increment the chart version in charts/cadence/Chart.yaml.
Then merge your changes and automation will take care of publishing the new version.
Cadence chart is hosted on github pages and automation is done using [Chart Releaser Action](https://helm.sh/docs/howto/chart_releaser_action/).
After new version is available in helm repo, deploy it to a K8s cluster to validate.
When updating versions, ensure consistency across:
- [ ] `Chart.yaml`: `version` (chart version) and `appVersion` (Cadence version)
- [ ] `values.yaml`: `global.image.tag` (should match appVersion)
- [ ] Dependencies in `Chart.yaml` (check for updates, aim for latest-1 stable)
- [ ] Update dependencies with `helm dependency update`
- [ ] Test deployment locally
- [ ] Run `helm-docs` to update documentation
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# Cadence
docs/
12 changes: 12 additions & 0 deletions charts/cadence/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dependencies:
- name: cassandra
repository: oci://registry-1.docker.io/bitnamicharts
version: 11.4.2
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 16.7.13
- name: mysql
repository: oci://registry-1.docker.io/bitnamicharts
version: 12.3.5
digest: sha256:d355eb032d520a4005678225960f11fbce541e4aaea7fce4a7e90ecebcbe1807
generated: "2025-06-25T16:33:38.605196+02:00"
16 changes: 15 additions & 1 deletion charts/cadence/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: cadence
version: 0.1.9
version: 0.2.0
appVersion: "1.3.1"

description: |
Expand All @@ -26,3 +26,17 @@ sources:
maintainers:
- name: Cadence Community
url: https://github.com/cadence-workflow/cadence-charts

dependencies:
- name: cassandra
version: 11.x.x
repository: oci://registry-1.docker.io/bitnamicharts
condition: cassandra.enabled
- name: postgresql
version: 16.x.x
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
- name: mysql
version: 12.x.x
repository: oci://registry-1.docker.io/bitnamicharts
condition: mysql.enabled
Loading