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

Replace cb-store with etcd #1695

Merged
merged 26 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d707e85
Add `etcd` auth
yunkon-kim Jul 25, 2024
bd8a13f
Exclude `key not found` from errors
yunkon-kim Jul 26, 2024
b4973c4
Replace `cb-store` with `kvstore`
yunkon-kim Jul 26, 2024
f9ae7b3
Relocate `etcd` and `kvstore` initialization section
yunkon-kim Jul 26, 2024
93b1c11
Update configs and dependencies
yunkon-kim Jul 26, 2024
c333010
Update README.md
yunkon-kim Jul 26, 2024
74ac071
Add etcd-centric kvstore and replace cb-store
cb-github-robot Jul 26, 2024
9dfb368
Add and update docker-compose configuration to customize or set envs
yunkon-kim Jul 29, 2024
edfbd08
Ignore docker-compose files and `.env` files
yunkon-kim Jul 29, 2024
9ab10ba
Fix env name and disable cb-tumblebug build
yunkon-kim Jul 29, 2024
b28bc3f
Add and update docker-compose configuration to customize or set envir…
cb-github-robot Jul 29, 2024
1c20f63
Add `etcd` auth
yunkon-kim Jul 25, 2024
ce10210
Exclude `key not found` from errors
yunkon-kim Jul 26, 2024
471844f
Replace `cb-store` with `kvstore`
yunkon-kim Jul 26, 2024
a3980fc
Relocate `etcd` and `kvstore` initialization section
yunkon-kim Jul 26, 2024
39989e5
Update configs and dependencies
yunkon-kim Jul 26, 2024
e7a0670
Update README.md
yunkon-kim Jul 26, 2024
cb23136
Add and update docker-compose configuration to customize or set envs
yunkon-kim Jul 29, 2024
fc500b7
Ignore docker-compose files and `.env` files
yunkon-kim Jul 29, 2024
6279ae7
Fix env name and disable cb-tumblebug build
yunkon-kim Jul 29, 2024
57c71f0
Merge branch 'replace-with-etcd' into 240730-09
yunkon-kim Jul 30, 2024
ad90808
Rebase replace-with-etcd onto upstream latest main
cb-github-robot Jul 30, 2024
79c3ebd
Finalize docker-compose and etcd
yunkon-kim Jul 30, 2024
457c16c
Finalize docker-compose and etcd
cb-github-robot Jul 30, 2024
aeac076
Update cleanDB.sh
yunkon-kim Jul 30, 2024
c46749d
Update cleanDB.sh
cb-github-robot Jul 30, 2024
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
165 changes: 165 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@

#############################################################
# Variables to customize servcies in the docker-compose.yml #
#############################################################

## ETCD
# see https://github.com/etcd-io/etcd/releases
COMPOSE_ETCD_VERSION_TAG=${ETCD_VERSION_TAG:-v3.5.14}
# default: COMPOSE_ETCD_VERSION_TAG=v3.5.14

# see https://etcd.io/docs/v3.5/op-guide/configuration/
COMPOSE_ETCD_LISTEN_CLIENT_PORT=${ETCD_LISTEN_CLIENT_PORT:-2379}
# default: COMPOSE_ETCD_LISTEN_CLIENT_PORT=2379
COMPOSE_ETCD_LISTEN_PEER_PORT=${ETCD_LISTEN_PEER_PORT:-2380}
# default: COMPOSE_ETCD_LISTEN_PEER_PORT=2380
COMPOSE_ETCD_VOLUME_HOST_PATH=${ETCD_VOLUME_HOST_PATH:-./container-volume/etcd/data}
# default: COMPOSE_ETCD_VOLUME_HOST_PATH=./container-volume/etcd/data
COMPOSE_ETCD_VOLUME_CONTAINTER_PATH=${ETCD_VOLUME_CONTAINTER_PATH:-/etcd-data}
# default: COMPOSE_ETCD_VOLUME_CONTAINTER_PATH=/etcd-data
COMPOSE_ETCD_NAME_OF_THIS_MEMBER=${ETCD_MEMBER_NAME:-s1}
# default: COMPOSE_ETCD_NAME_OF_THIS_MEMBER=s1
COMPOSE_ETCD_LISTEN_CLIENT_URLS=${ETCD_LISTEN_CLIENT_URLS:-http://0.0.0.0:2379}
# default: COMPOSE_ETCD_LISTEN_CLIENT_URLS=http://localhost:2379
COMPOSE_ETCD_ADVERTISE_CLIENT_URLS=${ETCD_ADVERTISE_CLIENT_URLS:-http://0.0.0.0:2379}
# default: COMPOSE_ETCD_ADVERTISE_CLIENT_URLS=http://localhost:2379
COMPOSE_ETCD_LISTEN_PEER_URLS=${ETCD_LISTEN_PEER_URLS:-http://0.0.0.0:2380}
# default: COMPOSE_ETCD_LISTEN_PEER_URLS=http://localhost:2380
COMPOSE_ETCD_INITIAL_ADVERTISE_PEER_URLS=${ETCD_INITIAL_ADVERTISE_PEER_URLS:-http://0.0.0.0:2380}
# default: COMPOSE_ETCD_INITIAL_ADVERTISE_PEER_URLS=http://localhost:2380
COMPOSE_ETCD_INITIAL_CLUSTER=${ETCD_INITIAL_CLUSTER:-s1=http://0.0.0.0:2380}
# default: COMPOSE_ETCD_INITIAL_CLUSTER=s1=http://localhost:2380
COMPOSE_ETCD_INITIAL_CLUSTER_TOKEN=${ETCD_INITIAL_CLUSTER_TOKEN:-tkn}
# default: COMPOSE_ETCD_INITIAL_CLUSTER_TOKEN=tkn
COMPOSE_ETCD_INITIAL_CLUSTER_STATE=${ETCD_INITIAL_CLUSTER_STATE:-new}
# default: COMPOSE_ETCD_INITIAL_CLUSTER_STATE=new
COMPOSE_ETCD_LOG_LEVEL=${ETCD_LOG_LEVEL:-info}
# default: COMPOSE_ETCD_LOG_LEVEL=info
COMPOSE_ETCD_LOGGER=${ETCD_LOGGER:-zap}
# default: COMPOSE_ETCD_LOGGER=zap
COMPOSE_ETCD_LOG_OUTPUTS=${ETCD_LOG_OUTPUTS:-stderr}
# default: COMPOSE_ETCD_LOG_OUTPUTS=stderr
COMPOSE_ETCD_AUTH_TOKEN=${ETCD_AUTH_TOKEN:-simple}
# default: COMPOSE_ETCD_AUTH_TOKEN=simple


## ETCD_CONF
COMPOSE_ETCD_CONF_VERSION_TAG=${ETCD_VERSION_TAG:-v3.5.14}
# default: COMPOSE_ETCD_CONF_VERSION_TAG=v3.5.14
COMPOSE_ETCD_CONF_ENDPOINTS=${ETCD_ENDPOINTS:-http://etcd:2379}
# default: COMPOSE_ETCD_CONF_ENDPOINTS=http://etcd:2379
COMPOSE_ETCD_CONF_ETCD_PATH=${ETCD_PATH:-/tmp/etcd-download-test}
# default: COMPOSE_ETCD_CONF_ETCD_PATH=/tmp/etcd-download-test
COMPOSE_ETCD_CONF_AUTH_ENABLED=${ETCD_AUTH_ENABLED:-true}
# default: COMPOSE_ETCD_CONF_AUTH_ENABLED=true
COMPOSE_ETCD_CONF_ROOT_PASSWORD=${ETCD_ROOT_PASSWORD:-default}
# default: COMPOSE_ETCD_CONF_ROOT_PASSWORD=default
COMPOSE_ETCD_CONF_ADMIN_USERNAME=${ETCD_ADMIN_USERNAME:-default}
# default: COMPOSE_ETCD_CONF_ADMIN_USERNAME=default
COMPOSE_ETCD_CONF_ADMIN_PASSWORD=${ETCD_ADMIN_PASSWORD:-default}
# default: COMPOSE_ETCD_CONF_ADMIN_PASSWORD=default


## CB_SPIDER
COMPOSE_SP_VERSION_TAG=${SP_VERSION_TAG:-0.9.0}
# default: COMPOSE_SP_VERSION_TAG=0.9.0
COMPOSE_SP_REST_PORT=${SP_REST_PORT:-1024}
# default: COMPOSE_SP_REST_PORT=1024
COMPOSE_SP_VOLUME_HOST_PATH=${SP_VOLUME_HOST_PATH:-./container-volume/cb-spider-container}
# default: COMPOSE_SP_VOLUME_HOST_PATH=./container-volume/cb-spider-container
COMPOSE_SP_VOLUME_CONTAINTER_PATH=${SP_VOLUME_CONTAINTER_PATH:-/root/go/src/github.com/cloud-barista/cb-spider}
# default: COMPOSE_SP_VOLUME_CONTAINTER_PATH=/root/go/src/github.com/cloud-barista/cb-spider
COMPOSE_SP_PLUGSIN_SW=${PLUGSIN_SW:-OFF}
# default: COMPOSE_SP_PLUGSIN_SW
COMPOSE_SP_SERVER_ADDRESS=${SERVER_ADDRESS:-localhost}
# default: COMPOSE_SP_SERVER_ADDRESS=localhost
COMPOSE_SP_API_USERNAME=${SP_API_USERNAME:-}
# default: COMPOSE_SP_API_USERNAME=
# Note - Use SP_API_USERNAME instead of API_USERNAME because API_USERNAME is used in CB-Tumblebug
COMPOSE_SP_API_PASSWORD=${SP_API_PASSWORD:-}
# default: COMPOSE_SP_API_PASSWORD=
# Note - Use SP_API_PASSWORD instead of API_PASSWORD because API_PASSWORD is used in CB-Tumblebug
COMPOSE_SP_LOG_LEVEL=${LOG_LEVEL:-error}
# default: COMPOSE_SP_LOG_LEVEL=error
COMPOSE_SP_HISCALL_LOG_LEVEL=${HISCALL_LOG_LEVEL:-error}
# default: COMPOSE_SP_HISCALL_LOG_LEVEL=error
COMPOSE_SP_ID_TRANSFORM_MODE=${ID_TRANSFORM_MODE:-ON}
# default: COMPOSE_SP_ID_TRANSFORM_MODE=ON


## CB_TUMBLEBUG
COMPOSE_TB_VERSION_TAG=${TB_VERSION_TAG:-0.9.1}
# default: COMPOSE_TB_VERSION_TAG=0.9.1
COMPOSE_TB_REST_PORT=${TB_REST_PORT:-1323}
# default: COMPOSE_TB_REST_PORT=1323
COMPOSE_TB_VOLUME_HOST_PATH=${TB_VOLUME_HOST_PATH:-./container-volume/cb-tumblebug-container}
# default: COMPOSE_TB_VOLUME_HOST_PATH=./container-volume/cb-tumblebug-container
COMPOSE_TB_VOLUME_CONTAINTER_PATH=${TB_VOLUME_CONTAINTER_PATH:-/app}
# default: COMPOSE_TB_VOLUME_CONTAINTER_PATH=/app
COMPOSE_TB_CBTUMBLEBUG_ROOT=${CBTUMBLEBUG_ROOT:-/app}
# default: COMPOSE_TB_CBTUMBLEBUG_ROOT=/app
COMPOSE_TB_SPIDER_CALL_METHOD=${SPIDER_CALL_METHOD:-REST}
# default: COMPOSE_TB_SPIDER_CALL_METHOD=REST
COMPOSE_TB_SPIDER_REST_URL=http://cb-spider:1024/spider
# default: COMPOSE_TB_SPIDER_REST_URL=http://cb-spider:1024/spider
COMPOSE_TB_DRAGONFLY_CALL_METHOD=${DRAGONFLY_CALL_METHOD:-REST}
# default: COMPOSE_TB_DRAGONFLY_CALL_METHOD=REST
COMPOSE_TB_DRAGONFLY_REST_URL=http://cb-dragonfly:9090/dragonfly
# default: COMPOSE_TB_DRAGONFLY_REST_URL=http://cb-dragonfly:9090/dragonfly
COMPOSE_TB_DB_URL=${DB_URL:-localhost:3306}
# default: COMPOSE_TB_DB_URL=localhost:3306
COMPOSE_TB_DB_DATABASE=${DB_DATABASE:-cb_tumblebug}
# default: COMPOSE_TB_DB_DATABASE=cb_tumblebug
COMPOSE_TB_DB_USER=${DB_USER:-cb_tumblebug}
# default: COMPOSE_TB_DB_USER=cb_tumblebug
COMPOSE_TB_DB_PASSWORD=${DB_PASSWORD:-cb_tumblebug}
# default: COMPOSE_TB_DB_PASSWORD=cb_tumblebug
COMPOSE_TB_ETCD_ENDPOINTS=http://etcd:2379
# default: COMPOSE_TB_ETCD_ENDPOINTS=http://etcd:2379
COMPOSE_TB_ETCD_AUTH_ENABLED=${TB_ETCD_AUTH_ENABLED:-true}
# default: COMPOSE_TB_ETCD_AUTH_ENABLED=true
COMPOSE_TB_ETCD_USERNAME=${TB_ETCD_USERNAME:-default}
# default: COMPOSE_TB_ETCD_USERNAME=default
COMPOSE_TB_ETCD_PASSWORD=${TB_ETCD_PASSWORD:-default}
# default: COMPOSE_TB_ETCD_PASSWORD=default
COMPOSE_TB_ALLOW_ORIGINS=${ALLOW_ORIGINS:-*}
# default: COMPOSE_TB_ALLOW_ORIGINS=*
COMPOSE_TB_AUTH_ENABLED=${AUTH_ENABLED:-true}
# default: COMPOSE_TB_AUTH_ENABLED=true
COMPOSE_TB_API_USERNAME=${API_USERNAME:-default}
# default: COMPOSE_TB_API_USERNAME=default
COMPOSE_TB_API_PASSWORD=${API_PASSWORD:-default}
# default: COMPOSE_TB_API_PASSWORD=default
COMPOSE_TB_AUTOCONTROL_DURATION_MS=${AUTOCONTROL_DURATION_MS:-10000}
# default: COMPOSE_TB_AUTOCONTROL_DURATION_MS=10000
COMPOSE_TB_SELF_ENDPOINT=${SELF_ENDPOINT:-localhost:1323}
# default: COMPOSE_TB_SELF_ENDPOINT=localhost:1323
COMPOSE_TB_API_DOC_PATH=${API_DOC_PATH:-/app/src/api/rest/docs/swagger.json}
# default: COMPOSE_TB_API_DOC_PATH=/app/src/api/rest/docs/swagger.json
COMPOSE_TB_DEFAULT_NAMESPACE=${DEFAULT_NAMESPACE:-ns01}
# default: COMPOSE_TB_DEFAULT_NAMESPACE=ns01
COMPOSE_TB_DEFAULT_CREDENTIALHOLDER=${DEFAULT_CREDENTIALHOLDER:-admin}
# default: COMPOSE_TB_DEFAULT_CREDENTIALHOLDER=admin
COMPOSE_TB_LOGFILE_PATH=${LOGFILE_PATH:-/app/log/tumblebug.log}
# default: COMPOSE_TB_LOGFILE_PATH=/app/log/tumblebug.log
COMPOSE_TB_LOGFILE_MAXSIZE=${LOGFILE_MAXSIZE:-10}
# default: COMPOSE_TB_LOGFILE_MAXSIZE=10
COMPOSE_TB_LOGFILE_MAXBACKUPS=${LOGFILE_MAXBACKUPS:-3}
# default: COMPOSE_TB_LOGFILE_MAXBACKUPS=3
COMPOSE_TB_LOGFILE_MAXAGE=${LOGFILE_MAXAGE:-30}
# default: COMPOSE_TB_LOGFILE_MAXAGE=30
COMPOSE_TB_LOGFILE_COMPRESS=${LOGFILE_COMPRESS:-false}
# default: COMPOSE_TB_LOGFILE_COMPRESS=false
COMPOSE_TB_LOGLEVEL=${LOGLEVEL:-debug}
# default: COMPOSE_TB_LOGLEVEL=debug
COMPOSE_TB_LOGWRITER=${LOGWRITER:-both}
# default: COMPOSE_TB_LOGWRITER=both
COMPOSE_TB_NODE_ENV=${NODE_ENV:-development}
# default: COMPOSE_TB_NODE_ENV=development


## CB-MapUI
COMPOSE_MAP_VERSION_TAG=${MAP_VERSION_TAG:-0.9.0}
# default: COMPOSE_MAP_VERSION_TAG=0.9.0
COMPOSE_MAP_PORT=${MAP_PORT:-1324}
# default: COMPOSE_MAP_PORT=1324
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ log/
*docker-compose*.yaml
!docker-compose.yaml

# (TBD) .env file for docker-compose
#
# .env file for docker-compose
.env
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ COPY --from=builder /go/src/github.com/cloud-barista/cb-tumblebug/src/cb-tumbleb

# Setting various environment variables required by the application
ENV CBTUMBLEBUG_ROOT=/app \
CBSTORE_ROOT=/app \
CBLOG_ROOT=/app \
SPIDER_CALL_METHOD=REST \
DRAGONFLY_CALL_METHOD=REST \
SPIDER_REST_URL=http://cb-spider:1024/spider \
Expand All @@ -54,6 +52,10 @@ ENV CBTUMBLEBUG_ROOT=/app \
DB_DATABASE=cb_tumblebug \
DB_USER=cb_tumblebug \
DB_PASSWORD=cb_tumblebug \
TB_ETCD_ENDPOINTS=http://etcd:2379 \
TB_ETCD_AUTH_ENABLED=true \
TB_ETCD_USERNAME=default \
TB_ETCD_PASSWORD=default \
ALLOW_ORIGINS=* \
AUTH_ENABLED=true \
AUTH_MODE=basic \
Expand Down
Loading