Skip to content

Commit

Permalink
Add BanyanDB to docker-compose quickstart (#12006)
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 authored Mar 12, 2024
1 parent 8c16fdd commit 0fad582
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 25 deletions.
7 changes: 4 additions & 3 deletions docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# export UI_IMAGE=apache/skywalking-ui:<tag>
# docker compose up

ES_VERSION=7.4.2
OAP_IMAGE=skywalking/oap:latest
UI_IMAGE=skywalking/ui:latest
ELASTICSEARCH_IMAGE=docker.elastic.co/elasticsearch/elasticsearch-oss:7.4.2
BANYANDB_IMAGE=ghcr.io/apache/skywalking-banyandb:84f32b3969cdcc676aaee428383b34b3b67dbdf5
OAP_IMAGE=ghcr.io/apache/skywalking/oap:latest
UI_IMAGE=ghcr.io/apache/skywalking/oap:latest
23 changes: 20 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ You can use `Makefile` located at the root folder to build a docker image with t

```shell
make docker
# OR skip the tests
make docker SKIP_TEST=true
```

It not only contains the process of building a docker image but also includes all the required steps, for instance, init
Expand Down Expand Up @@ -50,10 +52,25 @@ The tag of docker image. The default value is `latest`.

## Running containers with docker-compose

We can start up backend cluster by docker-compose
We can start up backend cluster by docker-compose. There are two profiles with
different storage options that you can choose, `elasticsearch` and `banyandb`.

To start up the backend cluster with `elasticsearch` as the storage, run the
following command:

```shell
docker compose --profile elasticsearch up
```

To start up the backend cluster with `banyandb` as the storage, run the
following command:

```shell
docker compose up
docker compose --profile banyandb up
```

[docker/.env](./.env) file contains the default elasticsearch tag (`ES_TAG`).
[docker/.env](./.env) file contains some configurations that you can customize,
such as the Docker image registry and tags.

After the services are up and running, you can send telemetry data to
localhost:11800 and access the UI at http://localhost:8080.
76 changes: 57 additions & 19 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:${ES_VERSION}
profiles:
- "elasticsearch"
image: ${ELASTICSEARCH_IMAGE:-docker.elastic.co/elasticsearch/elasticsearch-oss:7.4.2}
container_name: elasticsearch
ports:
- "9200:9200"
networks:
- demo
healthcheck:
test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1" ]
interval: 30s
Expand All @@ -36,40 +40,74 @@ services:
soft: -1
hard: -1

oap:
image: ${OAP_IMAGE}
container_name: oap
depends_on:
elasticsearch:
condition: service_healthy
links:
- elasticsearch
banyandb:
profiles:
- "banyandb"
image: ${BANYANDB_IMAGE:-ghcr.io/apache/skywalking-banyandb:84f32b3969cdcc676aaee428383b34b3b67dbdf5}
container_name: banyandb
networks:
- demo
expose:
- 17912
command: standalone --stream-root-path /tmp/stream-data --measure-root-path /tmp/measure-data
healthcheck:
test: [ "CMD", "sh", "-c", "nc -nz 127.0.0.1 17912" ]
interval: 5s
timeout: 60s
retries: 120

oap-base: &oap-base
profiles: [ "none" ]
image: ${OAP_IMAGE:-ghcr.io/apache/skywalking/oap:latest}
ports:
- "11800:11800"
- "12800:12800"
networks:
- demo
healthcheck:
test: [ "CMD-SHELL", "/skywalking/bin/swctl ch" ]
test: [ "CMD-SHELL", "curl http://localhost:12800/internal/l7check" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
environment:
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
environment: &oap-env
SW_HEALTH_CHECKER: default
SW_TELEMETRY: prometheus
JAVA_OPTS: "-Xms2048m -Xmx2048m"

ui:
image: ${UI_IMAGE}
container_name: ui
oap-es:
<<: *oap-base
profiles:
- "elasticsearch"
container_name: oap
depends_on:
oap:
elasticsearch:
condition: service_healthy
links:
- oap
environment:
<<: *oap-env
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200

oap-bdb:
<<: *oap-base
profiles:
- "banyandb"
container_name: oap
environment:
<<: *oap-env
SW_STORAGE: banyandb
SW_STORAGE_BANYANDB_TARGETS: banyandb:17912

ui:
image: ${UI_IMAGE:-ghcr.io/apache/skywalking/ui:latest}
container_name: ui
ports:
- "8080:8080"
networks:
- demo
environment:
SW_OAP_ADDRESS: http://oap:12800
SW_ZIPKIN_ADDRESS: http://oap:9412

networks:
demo:
1 change: 1 addition & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Upgrade PostgreSQL driver to `42.4.4` to fix CVE-2024-1597.
* Remove CLI(`swctl`) from the image.
* Remove CLI_VERSION variable from Makefile build.
* Add BanyanDB to docker-compose quickstart.

#### OAP Server

Expand Down

0 comments on commit 0fad582

Please sign in to comment.