Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: docker-compose postgres healthcheck #890

Merged
merged 6 commits into from
Aug 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/integration-tests-r2dbc.yml
Original file line number Diff line number Diff line change
@@ -48,9 +48,7 @@ jobs:

- name: Start DB
run: |-
docker-compose -f docker-files/docker-compose-postgres.yml up -d
# TODO: could we poll the port instead of sleep?
sleep 10
docker compose -f docker-files/docker-compose-postgres.yml up --wait
docker exec -i postgres_db psql -U postgres -t < akka-projection-r2dbc/ddl-scripts/create_tables_postgres.sql

- name: Run integration tests with with Scala and Java ${{ matrix.jdkVersion }}
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ Before running the sample locally you will need to run a PostgreSQL instance in
`docker-compose.yml`. Run it and create the needed database schema:

```shell
docker-compose up -d
docker-compose up --wait
docker exec -i postgres_db psql -U postgres -t < ddl-scripts/create_tables.sql
```

Original file line number Diff line number Diff line change
@@ -191,7 +191,7 @@ your own workstation. Docker, a JDK and @java[maven]@scala[sbt] is all that need
1. Start a local PostgresSQL server on default port 5432. The `docker-compose.yml` included in the shopping-cart project starts everything required for running locally.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
@@ -248,7 +248,7 @@ your own workstation. Docker, a JDK and @java[maven]@scala[sbt] is all that need
1. Start a local PostgresSQL server on default port 5432. The included `docker-compose.yml` starts everything required for running locally.

```shell
docker-compose up -d
docker-compose up --wait
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are still on the old docker-compose

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine, as people will probably just have one docker-compose locally, on v2.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, confusing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, maybe on linux distros generally there can be both docker-compose v1 and docker compose v2? So probably good to update to docker compose everywhere.


# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
@@ -313,7 +313,7 @@ your own workstation. Docker, a JDK and @java[maven]@scala[sbt] is all that need
1. Start a local PostgresSQL server on default port 5432. The included `docker-compose.yml` starts everything required for running locally. Note that for convenience this service and the shopping cart service is sharing the same database, in an actual service consuming events the consuming services are expected to have their own separate databases.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
@@ -339,7 +339,7 @@ your own workstation. Docker, a JDK and @java[maven]@scala[sbt] is all that need
1. Start a local PostgresSQL server on default port 5432. The included `docker-compose.yml` starts everything required for running locally. Note that for convenience this service and the shopping cart service is sharing the same database, in an actual service consuming events the consuming services are expected to have their own separate databases.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@ The complete sample can be downloaded from github, the replicated shopping cart:
1. Start two local PostgresSQL servers, on ports 5101 and 5201. The included `docker-compose.yml` starts everything required for running locally.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
@@ -236,7 +236,7 @@ The complete sample can be downloaded from github, the replicated shopping cart:
1. Start two local PostgresSQL servers, on ports 5101 and 5201. The included `docker-compose.yml` starts everything required for running locally.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
6 changes: 6 additions & 0 deletions docker-files/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
@@ -8,3 +8,9 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
2 changes: 1 addition & 1 deletion samples/grpc/shopping-analytics-service-java/README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
1. Start a local PostgresSQL server on default port 5432. The included `docker-compose.yml` starts everything required for running locally. Note that for convenience this service and the shopping cart service is sharing the same database, in an actual service consuming events the consuming services are expected to have their own separate databases.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
Original file line number Diff line number Diff line change
@@ -8,3 +8,9 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
2 changes: 1 addition & 1 deletion samples/grpc/shopping-analytics-service-scala/README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
1. Start a local PostgresSQL server on default port 5432. The included `docker-compose.yml` starts everything required for running locally. Note that for convenience this service and the shopping cart service is sharing the same database, in an actual service consuming events the consuming services are expected to have their own separate databases.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
Original file line number Diff line number Diff line change
@@ -8,3 +8,9 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
2 changes: 1 addition & 1 deletion samples/grpc/shopping-cart-service-java/README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
1. Start a local PostgresSQL server on default port 5432. The included `docker-compose.yml` starts everything required for running locally.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
6 changes: 6 additions & 0 deletions samples/grpc/shopping-cart-service-java/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -8,3 +8,9 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
2 changes: 1 addition & 1 deletion samples/grpc/shopping-cart-service-scala/README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
1. Start a local PostgresSQL server on default port 5432. The included `docker-compose.yml` starts everything required for running locally.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
6 changes: 6 additions & 0 deletions samples/grpc/shopping-cart-service-scala/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -8,3 +8,9 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
2 changes: 1 addition & 1 deletion samples/replicated/shopping-cart-service-java/README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
1. Start two local PostgresSQL servers, on ports 5101 and 5201. The included `docker-compose.yml` starts everything required for running locally.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
12 changes: 12 additions & 0 deletions samples/replicated/shopping-cart-service-java/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,12 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
postgres-db-2:
image: postgres:latest
container_name: postgres_db_2
@@ -16,3 +22,9 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
2 changes: 1 addition & 1 deletion samples/replicated/shopping-cart-service-scala/README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
1. Start two local PostgresSQL servers, on ports 5101 and 5201. The included `docker-compose.yml` starts everything required for running locally.

```shell
docker-compose up -d
docker-compose up --wait

# creates the tables needed for Akka Persistence
# as well as the offset store table for Akka Projection
12 changes: 12 additions & 0 deletions samples/replicated/shopping-cart-service-scala/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,12 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
postgres-db-2:
image: postgres:latest
container_name: postgres_db_2
@@ -16,3 +22,9 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s