Skip to content

Commit

Permalink
split up background tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Mar 2, 2024
1 parent b70b896 commit 4e94f9e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
42 changes: 35 additions & 7 deletions .github/workflows/flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,37 @@ jobs:
- name: Install Temporal CLI
uses: temporalio/setup-temporal@v0

- name: run tests
run: |
temporal server start-dev --namespace default --headless
go build -ldflags="-s -w" -o peer-flow .
temporal operator search-attribute create --name MirrorName --type Text --namespace default
./peer-flow worker &
./peer-flow snapshot-worker &
- run: temporal server start-dev --namespace default --headless &

- run: go build -ldflags="-s -w" -o peer-flow .
working-directory: ./flow

- run: ./peer-flow worker &
working-directory: ./flow
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
PEERDB_CATALOG_HOST: localhost
PEERDB_CATALOG_PORT: 5432
PEERDB_CATALOG_USER: postgres
PEERDB_CATALOG_PASSWORD: postgres
PEERDB_CATALOG_DATABASE: postgres

- run: ./peer-flow snapshot-worker &
working-directory: ./flow
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
PEERDB_CATALOG_HOST: localhost
PEERDB_CATALOG_PORT: 5432
PEERDB_CATALOG_USER: postgres
PEERDB_CATALOG_PASSWORD: postgres
PEERDB_CATALOG_DATABASE: postgres

- name: temporal monitoring
- run: |
(
while :
do sleep 10
Expand All @@ -104,6 +128,10 @@ jobs:
temporal workflow list
done
)&
- name: run tests
run: |
temporal operator search-attribute create --name MirrorName --type Text --namespace default
go test -p 24 ./... -timeout 1200s
working-directory: ./flow
env:
Expand Down
2 changes: 1 addition & 1 deletion stacks/flow.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COPY flow .
# build the binary from flow folder
WORKDIR /root/flow
ENV CGO_ENABLED=1
RUN go build -ldflags="-s -w" -o /root/peer-flow .
RUN go build -ldflags="-s -w" -o /root/peer-flow

FROM debian:bookworm-slim AS flow-base
RUN apt-get update && apt-get install -y ca-certificates libgeos-c1v5
Expand Down

0 comments on commit 4e94f9e

Please sign in to comment.