Move development files to develop (#1377)

This commit is contained in:
Alex Shtin
2021-03-15 17:06:19 -07:00
committed by GitHub
parent 948b1aaa21
commit 25fe19341a
33 changed files with 107 additions and 108 deletions
+3 -2
View File
@@ -1,11 +1,12 @@
.buildkite
.coverage
.github
.idea
.vscode
docker-compose
*.md
develop/docker-compose
develop/buildkite
# exclude binaries from the docker build context
tctl
temporal-server
+18 -38
View File
@@ -26,21 +26,21 @@ For developing on Windows, install [Windows Subsystem for Linux 2 (WSL2)](https:
Temporal uses go modules, there is no dependency on `$GOPATH` variable. Clone the repo into the preferred location:
```bash
$ git clone https://github.com/temporalio/temporal.git
git clone https://github.com/temporalio/temporal.git
```
## Build
For the very first time build `temporal-server` and helper tools with simple `make` command:
```bash
$ make
make
```
It will install all other build dependencies and build the binaries.
Further you can build binaries without running tests with:
```bash
$ make bins
make bins
```
Please check the top of our [Makefile](Makefile) for other useful build targets.
@@ -49,97 +49,77 @@ Please check the top of our [Makefile](Makefile) for other useful build targets.
Tests require runtime dependencies. They can be run with `start-dependencies` target (uses `docker-compose` internally). Open new terminal window and run:
```bash
$ make start-dependencies
make start-dependencies
```
Before testing on macOS, make sure you increase the file handle limit:
```bash
$ ulimit -n 8192
ulimit -n 8192
```
Run unit tests:
```bash
$ make unit-test
make unit-test
```
Run all integration tests:
```bash
$ make integration-test
make integration-test
```
Or run all the tests at once:
```bash
$ make test
make test
```
You can also run a single test:
```bash
$ go test -v <path> -run <TestSuite> -testify.m <TestSpecificTaskName>
go test -v <path> -run <TestSuite> -testify.m <TestSpecificTaskName>
```
for example:
```bash
$ go test -v github.com/temporalio/temporal/common/persistence -run TestCassandraPersistenceSuite -testify.m TestPersistenceStartWorkflow
go test -v github.com/temporalio/temporal/common/persistence -run TestCassandraPersistenceSuite -testify.m TestPersistenceStartWorkflow
```
When you are done, don't forget to stop `docker-compose` (with `Ctrl+C`) and clean up all dependencies:
```bash
$ make stop-dependencies
make stop-dependencies
```
## Run Temporal Server locally
First start runtime dependencies. They can be run with `start-dependencies` target (uses `docker-compose` internally). Open new terminal window and run:
```bash
$ make start-dependencies
make start-dependencies
```
then create database schema:
```bash
$ make install-schema
make install-schema
```
and then run the server:
```bash
$ make start
make start
```
Now you can create default namespace with `tctl`:
```bash
$ make tctl
$ ./tctl --ns default namespace register
make tctl
./tctl --ns default namespace register
```
and run samples from [Go](https://github.com/temporalio/samples-go) and [Java](https://github.com/temporalio/samples-java) samples repos. Also, you can access web UI at `localhost:8088`.
When you are done, press `Ctrl+C` to stop the server. Don't forget to stop dependencies (with `Ctrl+C`) and clean up resources:
```bash
$ make stop-dependencies
make stop-dependencies
```
## Release artifacts
Release binaries are created using [GoReleaser](https://goreleaser.com/)
GoReleaser github action is configured to attach release binaries on a Github release event [Release action](.github/workflows/goreleaser.yml)
GoReleaser configuration is at [.goreleaser.yml](.goreleaser.yml)
Locally build snapshot binaries
```shell
./.development/scripts/goreleaser.sh --snapshot --rm-dist
```
Locally build release binaries
```shell
./.development/scripts/goreleaser.sh
```
## Licence headers
This project is Open Source Software, and requires a header at the beginning of
all source files. To verify that all files contain the header execute:
```bash
$ make copyright
make copyright
```
## Commit Messages And Titles of Pull Requests
+4 -4
View File
@@ -174,7 +174,7 @@ clean-bins:
temporal-server:
@printf $(COLOR) "Build temporal-server with OS: $(GOOS), ARCH: $(GOARCH)..."
CGO_ENABLED=0 go build -ldflags "$(shell ./.development/scripts/go-build-ldflags.sh $(MODULE_ROOT)/ldflags)" -o temporal-server cmd/server/main.go
CGO_ENABLED=0 go build -ldflags "$(shell ./develop/scripts/go-build-ldflags.sh $(MODULE_ROOT)/ldflags)" -o temporal-server cmd/server/main.go
tctl:
@printf $(COLOR) "Build tctl with OS: $(GOOS), ARCH: $(GOARCH)..."
@@ -381,10 +381,10 @@ install-schema-cdc: temporal-cassandra-tool
##### Run server #####
start-dependencies:
docker-compose -f ./.development/docker-compose/docker-compose.yml -f ./.development/docker-compose/docker-compose.$(GOOS).yml up
docker-compose -f ./develop/docker-compose/docker-compose.yml -f ./develop/docker-compose/docker-compose.$(GOOS).yml up
stop-dependencies:
docker-compose -f ./.development/docker-compose/docker-compose.yml -f ./.development/docker-compose/docker-compose.$(GOOS).yml down
docker-compose -f ./develop/docker-compose/docker-compose.yml -f ./develop/docker-compose/docker-compose.$(GOOS).yml down
start: temporal-server
./temporal-server start
@@ -411,7 +411,7 @@ start-cdc-other: temporal-server
AWS_SDK_VERSION := $(lastword $(shell grep "github.com/aws/aws-sdk-go" go.mod))
external-mocks:
@printf $(COLOR) "Generate external libraries mocks..."
@mockgen -copyright_file LICENSE -package mocks -source $(GOPATH)/pkg/mod/github.com/aws/aws-sdk-go@$(AWS_SDK_VERSION)/service/s3/s3iface/interface.go | grep -v -e "^// Source: .*" > common/archiver/s3store/mocks/S3API.go
@mockgen -copyright_file ./LICENSE -package mocks -source $(GOPATH)/pkg/mod/github.com/aws/aws-sdk-go@$(AWS_SDK_VERSION)/service/s3/s3iface/interface.go | grep -v -e "^// Source: .*" > common/archiver/s3store/mocks/S3API.go
go-generate:
@printf $(COLOR) "Process go:generate directives..."
+6 -6
View File
@@ -21,9 +21,9 @@ Learn more about Temporal at [docs.temporal.io](https://docs.temporal.io).
Execute the following commands to start a pre-built image along with all the dependencies.
```bash
$ git clone https://github.com/temporalio/docker-compose.git
$ cd docker-compose
$ docker-compose up
git clone https://github.com/temporalio/docker-compose.git
cd docker-compose
docker-compose up
```
Refer to Temporal [docker-compose](https://github.com/temporalio/docker-compose) repo for more advanced options.
@@ -38,9 +38,9 @@ We have a number of [HelloWorld type scenarios](https://github.com/temporalio/sa
Use [Temporal's command line tool](https://docs.temporal.io/docs/tctl) `tctl` to interact with the local Temporal server.
```bash
$ alias tctl="docker exec temporal-admin-tools tctl"
$ tctl namespace list
$ tctl workflow list
alias tctl="docker exec temporal-admin-tools tctl"
tctl namespace list
tctl workflow list
```
### Use Temporal Web UI
@@ -4,11 +4,11 @@ Buildkite simply runs docker containers. So it is easy to perform the
same build locally that BuildKite will do.
## Testing the build locally
To run tests locally use `docker-compose run` command in `.buildkite` directory:
To run tests locally use `docker-compose run` command in `develop/buildkite` directory:
```bash
$ cd .buildkite
$ docker-compose run <container_name> <command>
cd develop/buildkite
docker-compose run <container_name> <command>
```
Get `<container_name>` and `<command>` form [pipeline.yml](pipeline.yml):
@@ -31,15 +31,15 @@ Get `<container_name>` and `<command>` form [pipeline.yml](pipeline.yml):
For example to run unit tests:
```bash
$ docker-compose run unit-test make unit-test-coverage
docker-compose run unit-test make unit-test-coverage
```
or run integration tests with Cassandra:
```bash
$ docker-compose run integration-test-cassandra make integration-test-coverage
docker-compose run integration-test-cassandra make integration-test-coverage
```
or run integration tests with MySQL:
```bash
$ docker-compose run integration-test-mysql make integration-test-coverage
docker-compose run integration-test-mysql make integration-test-coverage
```
## Testing the build in Buildkite
@@ -42,8 +42,8 @@ services:
integration-test-cassandra:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "CASSANDRA_SEEDS=cassandra"
- "ES_SEEDS=elasticsearch"
@@ -60,7 +60,7 @@ services:
- cassandra
- elasticsearch
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
@@ -42,8 +42,8 @@ services:
build:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "CASSANDRA_SEEDS=cassandra"
- "MYSQL_SEEDS=mysql"
@@ -53,13 +53,13 @@ services:
- BUILDKITE_BUILD_ID
- BUILDKITE_BUILD_NUMBER
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
unit-test:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "CASSANDRA_SEEDS=cassandra"
- "MYSQL_SEEDS=mysql"
@@ -74,7 +74,7 @@ services:
- mysql
- postgresql
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
@@ -83,8 +83,8 @@ services:
integration-test-cassandra:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "CASSANDRA_SEEDS=cassandra"
- "ES_SEEDS=elasticsearch"
@@ -101,7 +101,7 @@ services:
- cassandra
- elasticsearch
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
@@ -110,8 +110,8 @@ services:
integration-test-mysql:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "MYSQL_SEEDS=mysql"
- "ES_SEEDS=elasticsearch"
@@ -128,7 +128,7 @@ services:
- mysql
- elasticsearch
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
@@ -137,8 +137,8 @@ services:
integration-test-postgresql:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "POSTGRES_SEEDS=postgresql"
- "ES_SEEDS=elasticsearch"
@@ -155,7 +155,7 @@ services:
- postgresql
- elasticsearch
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
@@ -164,8 +164,8 @@ services:
integration-test-xdc-cassandra:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "CASSANDRA_SEEDS=cassandra"
- "ES_SEEDS=elasticsearch"
@@ -183,7 +183,7 @@ services:
- cassandra
- elasticsearch
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
@@ -192,8 +192,8 @@ services:
integration-test-xdc-mysql:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "MYSQL_SEEDS=mysql"
- "ES_SEEDS=elasticsearch"
@@ -211,7 +211,7 @@ services:
- mysql
- elasticsearch
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
@@ -220,8 +220,8 @@ services:
integration-test-xdc-postgresql:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- "POSTGRES_SEEDS=postgresql"
- "ES_SEEDS=elasticsearch"
@@ -239,7 +239,7 @@ services:
- postgresql
- elasticsearch
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
@@ -248,8 +248,8 @@ services:
coverage-report:
build:
context: ../
dockerfile: ./.buildkite/Dockerfile
context: ../..
dockerfile: ./develop/buildkite/Dockerfile
environment:
- CI
- BUILDKITE
@@ -270,7 +270,7 @@ services:
- BUILDKITE_PULL_REQUEST_REPO
- COVERALLS_TOKEN
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
@@ -7,7 +7,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: build
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- wait
@@ -21,7 +21,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: unit-test
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration test with cassandra"
agents:
@@ -36,7 +36,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-cassandra
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration test with cassandra (ES6)"
agents:
@@ -51,7 +51,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-cassandra
config: ./.buildkite/docker-compose-es6.yml
config: ./develop/buildkite/docker-compose-es6.yml
- label: ":golang: integration xdc test with cassandra"
agents:
@@ -66,7 +66,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-xdc-cassandra
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration ndc test with cassandra"
agents:
@@ -81,7 +81,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-xdc-cassandra
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration test with mysql"
agents:
@@ -96,7 +96,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-mysql
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration xdc test with mysql"
agents:
@@ -111,7 +111,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-xdc-mysql
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration ndc test with mysql"
agents:
@@ -126,7 +126,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-xdc-mysql
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration test with postgresql"
agents:
@@ -141,7 +141,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-postgresql
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration xdc test with postgresql"
agents:
@@ -156,7 +156,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-xdc-postgresql
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":golang: integration ndc test with postgresql"
agents:
@@ -171,7 +171,7 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: integration-test-xdc-postgresql
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- wait
@@ -179,7 +179,7 @@ steps:
agents:
queue: "default"
docker: "*"
command: "./.buildkite/scripts/coverage-report.sh"
command: "./develop/buildkite/scripts/coverage-report.sh"
artifact_paths:
- ".coverage/summary_coverprofile.out"
- ".coverage/summary_coverprofile.out.html"
@@ -189,14 +189,14 @@ steps:
plugins:
- docker-compose#v3.1.0:
run: coverage-report
config: ./.buildkite/docker-compose.yml
config: ./develop/buildkite/docker-compose.yml
- label: ":docker: build and push master"
agents:
queue: "default"
docker: "*"
branches: "master"
command: "./.buildkite/scripts/docker-push.sh"
command: "./develop/buildkite/scripts/docker-push.sh"
retry:
automatic:
limit: 1
@@ -6,13 +6,13 @@ Temporal server besides a server itself which you suppose to run locally on the
You are not supposed to use these files directly. Please use [Makefile](../../Makefile) targets instead. To start dependencies:
```bash
$ make start-dependencies
make start-dependencies
```
To stop dependencies:
```bash
$ make stop-dependencies
make stop-dependencies
```
See [CONTRIBUTING.md](../../CONTRIBUTING.md) for details.
+18
View File
@@ -0,0 +1,18 @@
## Release artifacts
Release binaries are created using [GoReleaser](https://goreleaser.com/)
GoReleaser github action is configured to attach release binaries on a Github release event [Release action](.github/workflows/goreleaser.yml)
GoReleaser configuration is at [.goreleaser.yml](.goreleaser.yml)
Locally build snapshot binaries
```bash
./develop/scripts/goreleaser.sh --snapshot --rm-dist
```
Locally build release binaries
```bash
./develop/scripts/goreleaser.sh
```
+5 -5
View File
@@ -12,21 +12,21 @@ To run docker image with dependencies:
Replace **YOUR_TAG** and **YOUR_CHECKOUT_COMMIT** in the below command to build:
```bash
$ git checkout YOUR_CHECKOUT_COMMIT
$ docker build . -t temporalio/auto-setup:YOUR_TAG --build-arg TARGET=auto-setup
git checkout YOUR_CHECKOUT_COMMIT
docker build . -t temporalio/auto-setup:YOUR_TAG --build-arg TARGET=auto-setup
```
## Run Temporal with custom docker image
Clone Temporal docker-compose repo: [https://github.com/temporalio/docker-compose](https://github.com/temporalio/docker-compose):
```bash
$ git clone https://github.com/temporalio/docker-compose.git
git clone https://github.com/temporalio/docker-compose.git
```
Replace the tag of `image: temporalio/auto-setup` to **YOUR_TAG** in `docker-compose.yml`.
Then start the service using the below command:
```bash
$ docker-compose up
docker-compose up
```
## Quickstart for production
@@ -35,7 +35,7 @@ In a typical production setting, dependencies (such as `cassandra` or `elasticse
To use the container in a production setting, use the following command:
```plain
$ docker run -e CASSANDRA_SEEDS=10.x.x.x -- csv of cassandra server ipaddrs
docker run -e CASSANDRA_SEEDS=10.x.x.x -- csv of cassandra server ipaddrs
-e KEYSPACE=<keyspace> -- Cassandra keyspace
-e VISIBILITY_KEYSPACE=<visibility_keyspace> -- Cassandra visibility keyspace
-e SKIP_SCHEMA_SETUP=true -- do not setup cassandra schema during startup