Skip to content

Commit

Permalink
Improve development documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Dec 9, 2020
1 parent 4dce7d4 commit ea35743
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
24 changes: 22 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,38 @@ Join our Slack channel(invite link in the [home page](https://github.com/uber/ca
## Development Environment

* Golang. Install on OS X with `brew install go`.
>Note: If running into any compiling issue, make sure you upgrade to the latest stable version of Golang.
* Golang. Install on OS X with.
```
brew install go
```
* Make sure set PATH to include bin path of GO so that other executables like thriftrw can be found.
```bash
# check it first
echo $GOPATH
# append to PATH
PATH=$PATH:$GOPATH/bin
# to confirm, run
echo $PATH
```

* Download golang dependencies.
```bash
go mod download
```

After check out and go to the Cadence repo, compile the `cadence` service and helper tools without running test:

```bash
make bins
```

>Note: If running into any compiling issue,
>1. Make sure you upgrade to the latest stable version of Golang.
> 2. Check if this document is outdated by comparing with the building steps in [Dockerfile](https://github.com/uber/cadence/blob/master/Dockerfile)
* Database. The default setup of Cadence depends on Cassandra. Before running the Cadence or tests you must have `cassandra` dependency(or equivalent database in the below notes)

>Note: This section assumes you are working with Cassandra. Please refer to [persistence documentation](https://github.com/uber/cadence/blob/master/docs/persistence.md) if you want to test with others like MySQL/Postgres.
> Also, you don't need those local stores if you want to connect to your existing staging/QA environment.
```bash
# install cassandra
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ For [manual setup or upgrading](docs/persistence.md) server schema --
* If server runs with SQL database, Use [Cadence SQL tool](tools/sql/README.md) to perform various tasks on database schema of SQL based persistence

TIPS: Run `make tools` to build all tools mentioned above.
> NOTE: See [CONTRIBUTING](CONTRIBUTING.md) for prerequisite of make command.
### Use Cadence Web

Try out [Cadence Web UI](https://github.com/uber/cadence-web) to view your workflows on Cadence.
Expand Down
8 changes: 7 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ Replace **YOUR_TAG** and **YOUR_CHECKOUT_BRANCH** in the below command to build:
```
cd $GOPATH/src/github.com/uber/cadence
git checkout YOUR_CHECKOUT_BRANCH
docker build . -t ubercadence/server:YOUR_TAG --build-arg TARGET=auto-setup
docker build . -t ubercadence/server:YOUR_TAG
```
Or for auto-setup images:
```
cd $GOPATH/src/github.com/uber/cadence
git checkout YOUR_CHECKOUT_BRANCH
docker build . -t ubercadence/server:YOUR_TAG-auto-setup --build-arg TARGET=auto-setup
```
Replace the tag of **image: ubercadence/server** to **YOUR_TAG** in docker-compose.yml .
Then stop service and remove all containers using the below commands.
Expand Down
3 changes: 2 additions & 1 deletion docs/persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ brew services start cassandra
cd $GOPATH/github.com/uber/cadence
make install-schema
```

> NOTE: See [CONTRIBUTING](../CONTRIBUTING.md) for prerequisite of make command.
>
### Start cadence server
```
cd $GOPATH/github.com/uber/cadence
Expand Down
3 changes: 3 additions & 0 deletions tools/cassandra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ This package contains the tooling for cadence cassandra operations.
```
make install-schema
```
> NOTE: See [CONTRIBUTING](../../CONTRIBUTING.md) for prerequisite of make command.
## For production

### Create the binaries
- Run `make cadence-cassandra-tool`
- You should see an executable `cadence-cassandra-tool`

> NOTE: See [CONTRIBUTING](../../CONTRIBUTING.md) for prerequisite of make command.
### Do one time database creation and schema setup for a new cluster
This uses Cassandra's SimpleStratagey for replication. For production, we recommend using a replication factor of 3 with NetworkTopologyStrategy.

Expand Down
5 changes: 4 additions & 1 deletion tools/sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ the sql interface. So, this same tool can be used against, say, OracleDB and MyS
```
SQL_USER=$USERNAME SQL_PASSWORD=$PASSWD make install-schema-mysql
```
> NOTE: See [CONTRIBUTING](../../CONTRIBUTING.md) for prerequisite of make command.
## For production

Expand All @@ -16,7 +17,9 @@ SQL_USER=$USERNAME SQL_PASSWORD=$PASSWD make install-schema-mysql
- Cadence officially support MySQL and Postgres for SQL.
- For other SQL database, you can add it easily as we do for MySQL/Postgres following our code in sql-extensions

Note: The binaries can also be found in the `ubercadence/server` docker images
> NOTE: See [CONTRIBUTING](../../CONTRIBUTING.md) for prerequisite of make command.
> Note: The binaries can also be found in the `ubercadence/server` docker images
### Do one time database creation and schema setup for a new cluster
- All command below are taking MySQL as example. For postgres, simply use with "--plugin postgres"
Expand Down

0 comments on commit ea35743

Please sign in to comment.