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

Convert non-dev docker-compose too; rename #476

Merged
merged 5 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
22 changes: 12 additions & 10 deletions docker-compose/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker Compose scripts for JSONAPI with DSE 6.8
# Docker Compose scripts for JSONAPI with DSE-next

This directory provides two ways to start the JSON API and Stargate coordinator with DSE 6.8 using `docker compose`.
This directory provides two ways to start the JSON API and Stargate coordinator with DSE-next using `docker compose`.

## Prerequisites

Expand All @@ -19,31 +19,33 @@ You can control the platform using the `-Dquarkus.docker.buildx.platform=linux/a

Follow instructions under the [Script options](#script-options) section to use the locally built image.

## Stargate JSON API with 3-node DSE 6.8 cluster
## Stargate JSON API with 3-node DSE-next cluster

You can start a simple Stargate configuration with the following command:

```
./start_dse_68.sh
./start_dse_next.sh
```

This convenience script verifies your Docker installation meets minimum requirements and brings up the configuration described in the `docker-compose.yml` file. The configuration includes health criteria for each container that is used to ensure the containers come up in the correct order.

The convenience script uses the `-d` and `--wait` options to track the startup progress, so that the compose command exits when all containers have started and reported healthy status within a specified timeout.

The environment settings in the `.env` file include variables that describe the image tags that will be used by default, typically JSON API `v1`, Stargate `v2` and DSE `6.8.X` (where `X` is the latest supported patch version). The `start_dse_68.sh` script supports [options](#script-options) for overriding which image tags are used, including using a locally generated image as described [above](#building-the-local-docker-image). We recommend doing a `docker compose pull` periodically to ensure you always have the latest patch versions of these tags.
The environment settings in the `.env` file include variables that describe the image tags that will be used by default, typically JSON API `v1`, Stargate `v2` and DSE `4.0.7-SHA` (where `SHA` is a unique indicator for commit used to build DSE-next). The `start_dse_next.sh` script supports [options](#script-options) for overriding which image tags are used, including using a locally generated image as described [above](#building-the-local-docker-image).
We recommend doing a `docker compose pull` periodically to ensure you always have the latest patch versions of these tags.

Once done using the containers, you can stop them using the command `docker compose down`.

## Stargate JSON API with embedded DSE 6.8 in coordinator (developer mode)
## Stargate JSON API with embedded DSE-next in coordinator (developer mode)

This alternate configuration runs the Stargate coordinator node in developer mode, so that no separate Cassandra cluster is required. This configuration is useful for development and testing since it initializes more quickly, but is not recommended for production deployments. This can be run with the command:
This alternate configuration runs the Stargate coordinator node in developer mode, so that no separate Cassandra cluster is required.
This configuration is useful for development and testing since it initializes more quickly, but is not recommended for production deployments. It can be run with the command:

```
./start_dse_68_dev_mode.sh
./start_dse_next_dev_mode.sh
```

This script supports the same [options](#script-options) as the `start_dse_68.sh` script.
This script supports the same [options](#script-options) as the `start_dse_next.sh` script.

To stop the configuration, use the command:

Expand All @@ -70,7 +72,7 @@ Both convenience scripts support the following options:

* When using the convenience scripts, the Docker image (`JSONTAG`) is the current (snapshot) version as defined in the top level project `pom.xml` file. It can be overridden with the `-t` option on either script:

`./start_dse_68.sh -t v1.0.0`
`./start_dse_next.sh -t v1.0.0`

* Running more than one of these multi-container environments on one host may require changing the port mapping to be changed to avoid conflicts on the host machine.

Expand Down
40 changes: 9 additions & 31 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ version: '2'

services:
dse-1:
image: datastax/dse-server:${DSETAG}
image: stargateio/dse-next:${DSETAG}
networks:
- stargate
mem_limit: 2G
environment:
- MAX_HEAP_SIZE=1536M
- CLUSTER_NAME=dse-${DSETAG}-cluster
- DC=dc1
- CASSANDRA_CLUSTER_NAME=dse-${DSETAG}-cluster
Copy link
Contributor Author

@tatu-at-datastax tatu-at-datastax Jul 26, 2023

Choose a reason for hiding this comment

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

Apparently OSS Cassandra uses "CASSANDRA_CLUSTERNAME" but DSE "CLUSTER_NAME". Ayayay.

We may need to change this again if and when we switch to upcoming DSE 7.0.

Also noticed that DC/RACK/DS_LICENSE not needed with non-DSE backend.

- DC=datacenter1
- RACK=rack1
- DS_LICENSE=accept
healthcheck:
Expand All @@ -19,7 +19,7 @@ services:
retries: 10

dse-2:
image: datastax/dse-server:${DSETAG}
image: stargateio/dse-next:${DSETAG}
networks:
- stargate
mem_limit: 2G
Expand All @@ -29,8 +29,8 @@ services:
environment:
- MAX_HEAP_SIZE=1536M
- SEEDS=dse-1
- CLUSTER_NAME=dse-${DSETAG}-cluster
- DC=dc1
- CASSANDRA_CLUSTER_NAME=dse-${DSETAG}-cluster
- DC=datacenter1
- RACK=rack1
- DS_LICENSE=accept
healthcheck:
Expand All @@ -39,29 +39,9 @@ services:
timeout: 10s
retries: 10

dse-3:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed 3rd node to make similar to set up for core Stargate project; uses less resources too.

image: datastax/dse-server:${DSETAG}
networks:
- stargate
mem_limit: 2G
depends_on:
dse-2:
condition: service_healthy
environment:
- MAX_HEAP_SIZE=1536M
- SEEDS=dse-1
- CLUSTER_NAME=dse-${DSETAG}-cluster
- DC=dc1
- DS_LICENSE=accept
healthcheck:
test: [ "CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces" ]
interval: 15s
timeout: 10s
retries: 10

coordinator:
image: stargateio/coordinator-dse-68:${SGTAG}
depends_on:
image: stargateio/coordinator-dse-next:${SGTAG}
depends_on:
dse-1:
condition: service_healthy
networks:
Expand All @@ -73,11 +53,9 @@ services:
environment:
- JAVA_OPTS="-Xmx1536M"
- CLUSTER_NAME=dse-${DSETAG}-cluster
- CLUSTER_VERSION=6.8
- DSE=1
- SEED=dse-1
- RACK_NAME=rack1
- DATACENTER_NAME=dc1
- DATACENTER_NAME=datacenter1
- ENABLE_AUTH=true
healthcheck:
test: curl -f http://localhost:8084/checker/readiness || exit 1
Expand Down
File renamed without changes.