Skip to content

Commit bcf8fba

Browse files
Create readme (#814)
* intial readme * update md * update dev container * change section names into links * address comments * add local docker-compose for backend and updte contributing.md * fix typos and update cadence composed docker section * Update README.md Co-authored-by: Adhitya Mamallan <[email protected]> * update readme * Update README.md Co-authored-by: Adhitya Mamallan <[email protected]> * Update README.md Co-authored-by: Adhitya Mamallan <[email protected]> --------- Co-authored-by: Adhitya Mamallan <[email protected]>
1 parent 00ede49 commit bcf8fba

File tree

5 files changed

+202
-35
lines changed

5 files changed

+202
-35
lines changed

.docker_env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NODE_ENV=development
2-
CADENCE_CLUSTERS_NAMES=default
2+
CADENCE_CLUSTERS_NAMES=cluster0
33
CADENCE_GRPC_PEERS="127.0.0.1:7833"
44
CADENCE_GRPC_SERVICES_NAMES=cadence-frontend
55
CADENCE_WEB_PORT=8088

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ This doc is intended for contributors to `cadence-web`
66

77
## Development Environment
88

9-
Node.js. Check [package.json](https://github.com/uber/cadence-web/blob/master/package.json) for the current version required. We do not recomment nvm since it can provide confusion with npm version.
9+
Node.js. Check [package.json](https://github.com/cadence-workflow/cadence-web/blob/master/package.json) for the current (engines > node) version required.
1010

11-
For development we recommend using VSCode with [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). We provide a default configuration for remote container using docker-compose.
12-
13-
You also need to run [cadence-server](https://github.com/uber/cadence) locally or have access to a cadence environment to talk to.
11+
For development check the [Building & developing cadence-web](./README.md#building-&-developing-cadence-web)section
1412

1513
## Working with the source code
1614

README.md

Lines changed: 109 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,125 @@
1-
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
1+
# Cadence Web UI
2+
3+
[![Build Status](https://github.com/uber/cadence-web/actions/workflows/build.yml/badge.svg)](https://github.com/uber/cadence-web/actions/workflows/build.yml) [![Docker Status](https://github.com/uber/cadence-web/actions/workflows/docker_publish.yml/badge.svg)](https://hub.docker.com/r/ubercadence/web/tags)
4+
5+
Cadence is a distributed, scalable, durable, and highly available orchestration engine we developed at Uber Engineering to execute asynchronous long-running business logic in a scalable and resilient way.
6+
7+
This web UI is used to view workflows from [Cadence][cadence], see what's running, and explore and debug workflow executions.
8+
29

310
## Getting Started
411

5-
First, run the development server:
12+
### Configuration
13+
14+
Set these environment variables if you need to change their defaults
15+
16+
| Variable | Description | Default |
17+
| ---------------------------- | --------------------------------------------- | ---------------- |
18+
| CADENCE_GRPC_PEERS | Comma-delimited list of gRPC peers | 127.0.0.1:7833 |
19+
| CADENCE_GRPC_SERVICES_NAMES | Comma-delimited list of gRPC services to call | cadence-frontend |
20+
| CADENCE_CLUSTERS_NAMES | Comma-delimited list of cluster names | cluster0 |
21+
| CADENCE_WEB_PORT | HTTP port to serve on | 8088 |
22+
| ENABLE_AUTH | Enable auth feature | false |
23+
| CADENCE_ADMIN_SECURITY_TOKEN | Admin token for accessing admin methods | '' |
24+
25+
Note: To connect `cadence-web` to multiple clusters, you will need to add comma-delimted entries for `CADENCE_GRPC_PEERS`, `CADENCE_GRPC_SERVICES_NAMES` & `CADENCE_CLUSTERS_NAMES` for each cluster (each cluster values are grouped by their index within the Comma-delimited lists).
26+
27+
Example:
28+
```
29+
CADENCE_GRPC_PEERS=127.0.0.1:3000,127.0.0.1:5000
30+
CADENCE_GRPC_SERVICES_NAMES=cadence-frontend-cluster0,cadence-frontend-cluster1
31+
CADENCE_CLUSTERS_NAMES=cluster0,cluster1
32+
```
33+
634

7-
```bash
35+
### Using cadence-web
36+
37+
The latest version of `cadence-web` is included in the `cadence` composed docker containers in the [main Cadence repository][cadence]. Follow the instructions there to get started.
38+
```
39+
docker-compose -f docker/docker-compose.yml up
40+
```
41+
42+
### Building & developing cadence-web
43+
44+
`cadence-web` requires node `v18` or greater to be able to run correctly.
45+
46+
#### Creating a production build
47+
48+
To create a production build, follow these steps:
49+
50+
1. Install npm packages and download idls
51+
```
52+
npm install && npm run install-idl && npm run generate:idl
53+
```
54+
2. Build the project files
55+
```
56+
npm run build
57+
```
58+
3. After building the code, start the server by running this command from the same directory as the build
59+
```
60+
npm start
61+
```
62+
4. Once the webapp is ready, access it through `localhost:8088` (port can be changed using `CADENCE_WEB_PORT` environment variable)
63+
64+
#### Running development environment
65+
66+
To run the development server, follow these steps:
67+
68+
1. Install npm packages and download idls
69+
```
70+
npm install && npm run install-idl && npm run generate:idl
71+
```
72+
2. Run the development server using
73+
```
874
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
1575
```
76+
3. Once the webapp is ready, access it through `localhost:8088` (port can be changed using `CADENCE_WEB_PORT` environment variable)
77+
78+
Note: For contribution we recommend using dev containers, check [VSCode Dev Containers](#using-vscode-dev-containers) section for more information
79+
80+
#### Using VSCode Dev Containers
81+
82+
1. Set up the [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VSCode.
83+
2. Open the cadence-web directory in VSCode.
84+
3. Make sure to update `CADENCE_GRPC_PEERS` with the correct host. (If you are connecting to a server on a container host machine use `host.docker.interal:7833`, where `7833` is the gRPC port for a running [cadence-frontend](https://github.com/cadence-workflow/cadence/tree/master/service/frontend) service)
85+
4. Use the Command Palette to select the 'Reopen folder in Container' option
86+
5. Follow same commands listed in [Running development environment](#running-development-environment) section.
87+
88+
89+
#### Developing cadence-web against cadence composed docker
90+
91+
To start development against dockerized cadence services, run the following command from the root of the project
92+
```
93+
docker-compose -f docker-compose-backend-services.yml up
94+
```
95+
96+
You can customize the YAML file or reuse configurations from the [cadence repository](https://github.com/cadence-workflow/cadence/tree/master/docker). (In case of reusing exsisting files: ensure that cadence-web is not included in the composed container services, or just remove it)
97+
98+
After running `cadence`, start `cadence-web` for development using one of the previous methods ([Running development environment](#running-development-environment), [VSCode Dev Containers](#using-vscode-dev-containers))
1699

17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18100

19-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
101+
#### NPM scripts
20102

21-
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22103

23-
## Learn More
104+
| script | Description |
105+
| ----------------- | ----------------------------------------------------------------------------------------------- |
106+
| build | Generate a production build |
107+
| start | Start server for existing production build |
108+
| dev | Run a development server |
109+
| install-idl | Download idl files required for building/running the project |
110+
| generate:idl | Move idl files inside the project and generate typescript types for them |
111+
| test | Run all test cases. To pass extra jest flags, use environment specific scripts e.g. test:unit:* |
112+
| test:unit | Run all unit tests. To pass extra jest flags, use environment specific scripts e.g. test:unit:* |
113+
| test:unit:browser | Run only browser unit tests |
114+
| test:unit:node | Run only node unit tests |
115+
| lint | Run eslint |
116+
| typecheck | Run typescript checks |
24117

25-
To learn more about Next.js, take a look at the following resources:
26118

27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29119

30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31120

32-
## Deploy on Vercel
121+
## License
33122

34-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
123+
MIT License, please see [LICENSE](https://github.com/cadence-workflow/cadence-web/blob/master/LICENSE) for details.
35124

36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
125+
[cadence]: https://github.com/cadence-workflow/cadence

docker-compose-backend-services.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# modified version of https://github.com/cadence-workflow/cadence/blob/master/docker/docker-compose-es-v7.yml
2+
# It includes all services except UI
3+
4+
services:
5+
cassandra:
6+
image: cassandra:4.1.1
7+
ports:
8+
- "9042:9042"
9+
environment:
10+
- "MAX_HEAP_SIZE=256M"
11+
- "HEAP_NEWSIZE=128M"
12+
healthcheck:
13+
test: ["CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces"]
14+
interval: 15s
15+
timeout: 30s
16+
retries: 10
17+
prometheus:
18+
image: prom/prometheus:latest
19+
volumes:
20+
- ./prometheus:/etc/prometheus
21+
command:
22+
- '--config.file=/etc/prometheus/prometheus.yml'
23+
ports:
24+
- '9090:9090'
25+
kafka:
26+
image: docker.io/bitnami/kafka:3.7
27+
hostname: kafka
28+
container_name: kafka
29+
ports:
30+
- "9092:9092"
31+
environment:
32+
# KRaft settings
33+
- "KAFKA_CFG_NODE_ID=0"
34+
- "KAFKA_CFG_PROCESS_ROLES=controller,broker"
35+
- "KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093"
36+
# Listeners
37+
- "KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093"
38+
- "KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092"
39+
- "KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT"
40+
- "KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER"
41+
- "KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT"
42+
# Topic settings
43+
- "KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true"
44+
elasticsearch:
45+
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.3
46+
ports:
47+
- "9200:9200"
48+
environment:
49+
- discovery.type=single-node
50+
cadence:
51+
image: ubercadence/server:master-auto-setup
52+
ports:
53+
- "8000:8000"
54+
- "8001:8001"
55+
- "8002:8002"
56+
- "8003:8003"
57+
- "7933:7933"
58+
- "7934:7934"
59+
- "7935:7935"
60+
- "7939:7939"
61+
- "7833:7833"
62+
environment:
63+
- "CASSANDRA_SEEDS=cassandra"
64+
- "PROMETHEUS_ENDPOINT_0=0.0.0.0:8000"
65+
- "PROMETHEUS_ENDPOINT_1=0.0.0.0:8001"
66+
- "PROMETHEUS_ENDPOINT_2=0.0.0.0:8002"
67+
- "PROMETHEUS_ENDPOINT_3=0.0.0.0:8003"
68+
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development_es.yaml"
69+
- "ENABLE_ES=true"
70+
- "ES_SEEDS=elasticsearch"
71+
- "ES_VERSION=v7"
72+
- "KAFKA_SEEDS=kafka"
73+
depends_on:
74+
cassandra:
75+
condition: service_healthy
76+
prometheus:
77+
condition: service_started
78+
kafka:
79+
condition: service_started
80+
elasticsearch:
81+
condition: service_started
82+
grafana:
83+
image: grafana/grafana
84+
volumes:
85+
- ./grafana:/etc/grafana
86+
user: "1000"
87+
depends_on:
88+
- prometheus
89+
ports:
90+
- '3000:3000'

docker-compose.prod.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)