Skip to content

Commit

Permalink
Use Temporal
Browse files Browse the repository at this point in the history
This commit migrates Enduro to Temporal.
  • Loading branch information
sevein committed Jul 6, 2023
1 parent fdba149 commit 88547c1
Show file tree
Hide file tree
Showing 68 changed files with 1,200 additions and 1,684 deletions.
32 changes: 14 additions & 18 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
run:
deadline: 60s
skip-dirs:
- hack
- website
- ui
- hack
- website
- ui

linters:
enable:
- misspell
- gofumpt
- importas
- gci
- misspell
- gofumpt
- importas
- gci

issues:
exclude-rules:
- path: _test\.go
linters:
- errcheck
- path: _test\.go
linters:
- errcheck

linters-settings:
gci:
Expand All @@ -32,11 +32,7 @@ linters-settings:
no-unaliased: true
no-extra-aliases: false
alias:
- pkg: go.uber.org/cadence
alias: cadencesdk
- pkg: go.uber.org/cadence/(\w+)
alias: cadencesdk_$1
- pkg: go.uber.org/cadence/.gen/go/shared
alias: cadencesdk_gen_shared
- pkg: go.uber.org/cadence/.gen/go/cadence/workflowserviceclient
alias: cadencesdk_gen_workflowserviceclient
- pkg: go.temporal.io/sdk/(\w+)
alias: temporalsdk_$1
- pkg: go.temporal.io/api/(\w+)
alias: temporalapi_$1
22 changes: 3 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ IGNORED_PACKAGES := \
github.com/artefactual-labs/enduro/internal/batch/fake \
github.com/artefactual-labs/enduro/internal/collection/fake \
github.com/artefactual-labs/enduro/internal/pipeline/fake \
github.com/artefactual-labs/enduro/internal/testutil \
github.com/artefactual-labs/enduro/internal/watcher/fake
PACKAGES := $(shell go list ./...)
TEST_PACKAGES := $(filter-out $(IGNORED_PACKAGES),$(PACKAGES))
Expand Down Expand Up @@ -126,27 +125,12 @@ ui-client:
@echo "@@@@ Please, review all warnings generated by openapi-generator-cli above!"
@echo "@@@@ We're using \`--skip-validate-spec\` to deal with Goa spec generation issues."

cadence-flush:
docker-compose exec mysql mysql -hlocalhost -uroot -proot123 -e "DROP DATABASE IF EXISTS cadence;"
docker-compose exec mysql mysql -hlocalhost -uroot -proot123 -e "DROP DATABASE IF EXISTS cadence_visibility;"
docker-compose exec mysql mysql -hlocalhost -uroot -proot123 -e "CREATE DATABASE IF NOT EXISTS cadence;"
docker-compose exec mysql mysql -hlocalhost -uroot -proot123 -e "CREATE DATABASE IF NOT EXISTS cadence_visibility;"
docker-compose run --rm cadence /seed.sh
docker-compose restart cadence
$(MAKE) cadence-domain

cadence-seed:
docker-compose run --rm cadence /seed.sh

cadence-domain:
docker run -it --network=host --rm ubercadence/cli:master --address=127.0.0.1:7400 --domain=enduro domain register --global_domain=false --active_cluster=active

db:
docker-compose exec --user=root mysql mysql -hlocalhost -uroot -proot123
docker compose exec --user=root mysql mysql -hlocalhost -uroot -proot123

flush:
docker-compose exec --user=root mysql mysql -hlocalhost -uroot -proot123 -e "drop database enduro"
docker-compose exec --user=root mysql mysql -hlocalhost -uroot -proot123 -e "create database enduro"
docker compose exec --user=root mysql mysql -hlocalhost -uroot -proot123 -e "drop database enduro"
docker compose exec --user=root mysql mysql -hlocalhost -uroot -proot123 -e "create database enduro"

gen-mock:
$(MOCKGEN) -destination=./internal/batch/fake/mock_batch.go -package=fake github.com/artefactual-labs/enduro/internal/batch Service
Expand Down
51 changes: 22 additions & 29 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ version: "3"
services:

mysql:
image: "mysql:5.7"
command: "--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"
image: "mysql:8.0"
environment:
MYSQL_ROOT_PASSWORD: "root123"
MYSQL_USER: "enduro"
Expand All @@ -14,37 +13,31 @@ services:
ports:
- "127.0.0.1:7450:3306"

cadence:
image: "ubercadence/server:0.9.5"
command: ["cadence-server", "--root=/etc/cadence", "--env=docker", "start", "--services=frontend,matching,history,worker"]
restart: "on-failure"
temporal:
image: "temporalio/auto-setup:1.21.1"
environment:
- "DB=mysql"
- "DB_PORT=3306"
- "MYSQL_USER=root"
- "MYSQL_PWD=root123"
- "MYSQL_SEEDS=mysql"
ports:
# frontend service
- "127.0.0.1:7400:7400" # rpc
- "127.0.0.1:7401:7401" # prom
- "127.0.0.1:7402:7402" # pprof
# matching service
- "127.0.0.1:7410:7410" # rpc
- "127.0.0.1:7411:7411" # prom
- "127.0.0.1:7412:7412" # pprof
# history service
- "127.0.0.1:7420:7420" # rpc
- "127.0.0.1:7421:7421" # prom
- "127.0.0.1:7422:7422" # pprof
# worker service
- "127.0.0.1:7430:7430" # rpc
- "127.0.0.1:7431:7431" # prom
- "127.0.0.1:7432:7432" # pprof
volumes:
- "./hack/cadence/seed.sh:/seed.sh:ro"
- "./hack/cadence/config.yml:/etc/cadence/config/docker.yaml:ro"
- "127.0.0.1:7233:7233"

temporal-admin-tools:
environment:
- "TEMPORAL_CLI_ADDRESS=temporal:7233"
image: "temporalio/admin-tools:1.21.1"
stdin_open: true
tty: true

cadence-web:
image: "ubercadence/web:3.13.0"
temporal-ui:
image: "temporalio/ui:2.16.2"
environment:
- "CADENCE_TCHANNEL_PEERS=cadence:7400"
- "TEMPORAL_ADDRESS=temporal:7233"
- "TEMPORAL_CORS_ORIGINS=http://localhost:7440"
ports:
- "127.0.0.1:7440:8088"
- "127.0.0.1:7440:8080"

minio:
image: "minio/minio:RELEASE.2020-04-28T23-56-56Z"
Expand Down
7 changes: 4 additions & 3 deletions enduro.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
debug = true
debugListen = "127.0.0.1:9001"

[cadence]
domain = "enduro"
address = "127.0.0.1:7400"
[temporal]
namespace = "default"
address = "127.0.0.1:7233"
taskQueue = "global"

[api]
listen = "127.0.0.1:9000"
Expand Down
33 changes: 10 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/uber-go/tally v3.4.3+incompatible
go.artefactual.dev/tools v0.1.0
go.uber.org/cadence v0.19.1
go.uber.org/yarpc v1.70.3
go.uber.org/zap v1.24.0
go.artefactual.dev/tools v0.3.0
go.temporal.io/api v1.21.0
go.temporal.io/sdk v1.23.1
goa.design/goa/v3 v3.11.3
goa.design/plugins/v3 v3.11.3
gocloud.dev v0.30.0
Expand All @@ -41,11 +39,8 @@ require (
)

require (
github.com/BurntSushi/toml v1.0.0 // indirect
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/apache/thrift v0.16.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.18.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.27 // indirect
Expand All @@ -67,34 +62,33 @@ require (
github.com/aws/smithy-go v1.13.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cristalhq/jwt/v3 v3.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598 // indirect
github.com/dimfeld/httptreemux/v5 v5.5.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gogo/status v1.1.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/wire v0.5.0 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kisielk/errcheck v1.6.0 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nwaples/rardecode v1.1.2 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pierrec/lz4/v4 v4.1.16 // indirect
Expand All @@ -108,21 +102,16 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/twmb/murmur3 v1.1.6 // indirect
github.com/uber-go/mapdecode v1.0.0 // indirect
github.com/uber/tchannel-go v1.22.2 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/yuin/gopher-lua v1.1.0 // indirect
github.com/zach-klippenstein/goregen v0.0.0-20160303162051-795b5e3961ea // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/net/metrics v1.3.1 // indirect
go.uber.org/thriftrw v1.29.2 // indirect
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.10.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
Expand All @@ -134,9 +123,7 @@ require (
google.golang.org/grpc v1.56.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.3.2 // indirect
)

// ringpop-go and tchannel-go depends on older version of thrift, yarpc brings up newer version
Expand Down
Loading

0 comments on commit 88547c1

Please sign in to comment.