Skip to content

Commit

Permalink
Move development files to develop (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshtin authored Mar 16, 2021
1 parent 09bc54c commit af60aea
Show file tree
Hide file tree
Showing 33 changed files with 107 additions and 108 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
56 changes: 18 additions & 38 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)..."
Expand Down Expand Up @@ -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
Expand All @@ -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..."
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions .buildkite/README.md → develop/buildkite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -60,7 +60,7 @@ services:
- cassandra
- elasticsearch
volumes:
- ../:/temporal
- ../..:/temporal
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
networks:
services-network:
Expand Down
Loading

0 comments on commit af60aea

Please sign in to comment.