Skip to content

Commit

Permalink
Improve developer contribution guide for Postgres development (uber#3495
Browse files Browse the repository at this point in the history
)
  • Loading branch information
longquanzheng authored Sep 11, 2020
1 parent d3cab3e commit 2fc957e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

This doc is intended for contributors to `cadence` server (hopefully that's you!)

**Note:** All contributors also need to fill out the [Uber Contributor License Agreement](http://t.uber.com/cla) before we can merge in any of your changes
>Note: All contributors also need to fill out the [Uber Contributor License Agreement](http://t.uber.com/cla) before we can merge in any of your changes
## Development Environment

* Go. Install on OS X with `brew install go`.
* 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.
## Checking out the code

Expand Down Expand Up @@ -59,6 +60,9 @@ make bins

## Testing

>Note: The default setup of Cadence depends on Cassandra and Kafka(is being deprecated).
This section assumes you are testing with them, too. 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.

Before running the tests you must have `cassandra`, `kafka`, and its `zookeeper` dependency:

```bash
Expand Down
35 changes: 35 additions & 0 deletions docs/persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,49 @@ brew services start mysql
cd $GOPATH/github.com/uber/cadence
make install-schema-mysql
```
When run tests and CLI command locally, Cadence by default uses a user `uber` with password `uber`, with privileges of creating databases.
You can use the following command to create user(role) and grant access.
In the mysql shell:
```
> CREATE USER 'uber' IDENTIFIED BY 'uber';
> GRANT All Privileges to 'uber';
```
### Start cadence server
```
cd $GOPATH/github.com/uber/cadence
cp config/development_mysql.yaml config/development.yaml
./cadence-server start --services=frontend,matching,history,worker
```

## PostgresQL
### Start PostgresQL server
```
brew install postgres
brew services start postgres
```
When run tests and CLI command locally, Cadence by default uses a superuser `postgres` with password `cadence`.
You can use the following command to create user(role) and grant access:
```
$psql postgres
postgres=# CREATE USER postgres WITH PASSWORD 'cadence';
CREATE ROLE
postgres=# ALTER USER postgres WITH SUPERUSER;
ALTER ROLE
```
### Install cadence schema
```
cd $GOPATH/github.com/uber/cadence
make install-schema-postgres
```

### Start cadence server
```
cd $GOPATH/github.com/uber/cadence
cp config/development_postgres.yaml config/development.yaml
./cadence-server start --services=frontend,matching,history,worker
```

# Configuration
## Common to all persistence implementations
There are two major sub-subsystems within cadence that need persistence - cadence-core and visibility. cadence-core is
Expand Down

0 comments on commit 2fc957e

Please sign in to comment.