Skip to content

Commit d6c3dfb

Browse files
committed
docker-compose.harness.yml -> docker-compose.yml:
- move the sentry release build to docker-compose.bench.yml file - replace all occurrences of `.harness` in docs, makefiles & CI build
1 parent 6eebd09 commit d6c3dfb

File tree

9 files changed

+40
-109
lines changed

9 files changed

+40
-109
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
uses: sudo-bot/action-docker-compose@latest
6969
with:
7070
# https://docs.docker.com/compose/reference/overview/
71-
cli-args: "-f docker-compose.harness.yml up -d --build adex-postgres adex-redis ganache-1 ganache-1337"
71+
cli-args: "up -d --build adex-postgres adex-redis ganache-1 ganache-1337"
7272
- uses: actions-rs/toolchain@v1
7373
with:
7474
# No need to add `toolchain`, it will use `rust-toolchain` file instead

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Two services are needed to run `Sentry`: `Postgres` and `Redis`.
3030

3131
The easiest way to run these services locally is by using the provided `docker-compose` file:
3232

33-
`docker-compose -f docker-compose.harness.yml up -d adex-redis adex-postgres`
33+
`docker-compose -f docker-compose.yml up -d adex-redis adex-postgres`
3434

3535
If you want to run them manually without `docker-compose`:
3636

@@ -245,7 +245,7 @@ cargo make
245245
It will format your code using `rustfmt` and will perform `clippy` checks (it will fail on warnings).
246246
Thanks to `cargo` it will run all the tests (doc tests, unit tests, integration tests, etc.).
247247

248-
Using the provided `docker-compose.harness.yml` setup [`cargo-make`][cargo-make overview] will run
248+
Using the provided `docker-compose.yml` setup [`cargo-make`][cargo-make overview] will run
249249
all the required services for the specific crate/application before executing the tests.
250250

251251
[cargo-make overview]: https://github.com/sagiegurari/cargo-make#overview

adapter/Makefile.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ args = ["test", "--all-features"]
2121
[tasks.ganache-up]
2222
# `--renew-anon-volumes` is required to make sure that the snapshot used for the `ganache` instances is reloaded.
2323
script = '''
24-
docker-compose -f ../docker-compose.harness.yml up --renew-anon-volumes -d ganache-1 ganache-1337 \
24+
docker-compose -f ../docker-compose.yml up --renew-anon-volumes -d ganache-1 ganache-1337 \
2525
&& sleep 6
2626
'''
2727

2828
[tasks.ganache-down]
29-
script = "docker-compose -f ../docker-compose.harness.yml down"
29+
script = "docker-compose -f ../docker-compose.yml down"

docker-compose.bench.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: '3.8'
2+
3+
services:
4+
# Service used to bechmark the sentry application in release mode
5+
# It uses the dummy adapter and the Leader
6+
sentry-dummy-leader-release:
7+
restart: unless-stopped
8+
build:
9+
context: .
10+
dockerfile: Dockerfile-sentry
11+
container_name: adex-sentry-dummy-leader-release
12+
ports:
13+
- "8005:8005"
14+
environment:
15+
ENV: development
16+
IP_ADDR: 0.0.0.0
17+
PORT: 8005
18+
POSTGRES_DB: sentry_leader
19+
POSTGRES_HOST: adex-postgres
20+
REDIS_HOST: adex-redis
21+
ADAPTER: dummy
22+
DUMMY_IDENTITY: '0x80690751969B234697e9059e04ed72195c3507fa'
23+
REDIS_URL: redis://adex-redis:6379/0
24+
networks:
25+
- adex-external

docker-compose.dev.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

docker-compose.harness.yml renamed to docker-compose.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ services:
2828
- "6379:6379"
2929
networks:
3030
- adex-external
31+
3132
ganache-1:
3233
build:
3334
context: ./scripts/ethereum
@@ -59,28 +60,5 @@ services:
5960
networks:
6061
- adex-external
6162

62-
# Service used to bechmark the sentry application in release mode
63-
# It uses the dummy adapter and the Leader
64-
sentry-dummy-leader-release:
65-
restart: unless-stopped
66-
build:
67-
context: .
68-
dockerfile: Dockerfile-sentry
69-
container_name: adex-sentry-dummy-leader-release
70-
ports:
71-
- "8005:8005"
72-
environment:
73-
ENV: development
74-
IP_ADDR: 0.0.0.0
75-
PORT: 8005
76-
POSTGRES_DB: sentry_leader
77-
POSTGRES_HOST: adex-postgres
78-
REDIS_HOST: adex-redis
79-
ADAPTER: dummy
80-
DUMMY_IDENTITY: '0x80690751969B234697e9059e04ed72195c3507fa'
81-
REDIS_URL: redis://adex-redis:6379/0
82-
networks:
83-
- adex-external
84-
8563
networks:
8664
adex-external:

primitives/Makefile.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies = [
1919
env = { "POSTGRES_DB" = "primitives" }
2020

2121
[tasks.services-up]
22-
script = "docker-compose -f ../docker-compose.harness.yml up -d adex-postgres && sleep 6"
22+
script = "docker-compose -f ../docker-compose.yml up -d adex-postgres && sleep 6"
2323

2424
[tasks.services-down]
25-
script = "docker-compose -f ../docker-compose.harness.yml down"
25+
script = "docker-compose -f ../docker-compose.yml down"

sentry/Makefile.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ dependencies = [
1919
env = { "POSTGRES_DB" = "sentry_leader" }
2020

2121
[tasks.services-up]
22-
script = "docker-compose -f ../docker-compose.harness.yml up -d adex-redis adex-postgres && sleep 3"
22+
script = "docker-compose -f ../docker-compose.yml up -d adex-redis adex-postgres && sleep 3"
2323

2424
[tasks.services-down]
25-
script = "docker-compose -f ../docker-compose.harness.yml down"
25+
script = "docker-compose -f ../docker-compose.yml down"
2626

2727
[tasks.run-benchmark]
2828
category = "Development"
@@ -59,7 +59,8 @@ args = [
5959

6060
[tasks.benchmark-services-up]
6161
# `--renew-anon-volumes` is required to make sure that the Databases are dumpped.
62-
script = "docker-compose -f ../docker-compose.harness.yml up --renew-anon-volumes -d adex-redis adex-postgres sentry-dummy-leader-release && sleep 3"
62+
# also run with `--build` to build the latest release of sentry!
63+
script = "docker-compose -f ../docker-compose.yml -f ../docker-compose.bench.yml up --build --renew-anon-volumes -d adex-redis adex-postgres sentry-dummy-leader-release && sleep 3"
6364

6465
[tasks.benchmark-services-down]
65-
script = "docker-compose -f ../docker-compose.harness.yml down"
66+
script = "docker-compose -f ../docker-compose.yml -f ../docker-compose.bench.yml down"

test_harness/Makefile.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ dependencies = ["services-up", "test-flow", "services-down"]
2121
# it's used primarily for `ganache-cli`.
2222
# This forces the snapshot from previous unsuccessful test runs to get destroyed.
2323
script = '''
24-
docker-compose -f ../docker-compose.harness.yml up --renew-anon-volumes -d ganache-1 ganache-1337 adex-redis adex-postgres \
24+
docker-compose -f ../docker-compose.yml up --renew-anon-volumes -d ganache-1 ganache-1337 adex-redis adex-postgres \
2525
&& sleep 6
2626
'''
2727

2828
[tasks.services-down]
29-
script = "docker-compose -f ../docker-compose.harness.yml down"
29+
script = "docker-compose -f ../docker-compose.yml down"

0 commit comments

Comments
 (0)