Skip to content

Commit cabbd3d

Browse files
committed
[raft] Make raft runnable-locally
1 parent 95eb833 commit cabbd3d

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

build/dev/docker-compose_dss.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ services:
111111
- $PWD/../test-certs:/var/test-certs:ro
112112
- $PWD/startup/core_service.sh:/startup/core_service.sh:ro
113113
- $PWD/startup/coverdata:/startup/coverdata:rw # we will save coverage info here
114+
- raftdata:/raftdata
114115
environment:
115116
COMPOSE_PROFILES: ${COMPOSE_PROFILES}
116117
# Note: requires the Dockerfile to have been built with "-cover" in the EXTRA_GO_INSTALL_FLAGS var
@@ -142,7 +143,7 @@ services:
142143
interval: 3m
143144
start_period: 30s
144145
start_interval: 5s
145-
profiles: ["", "with-yugabyte"]
146+
profiles: ["", "with-yugabyte", "with-raft"]
146147

147148
local-dss-dummy-oauth:
148149
build:
@@ -166,3 +167,4 @@ networks:
166167

167168
volumes:
168169
local-dss-data:
170+
raftdata:

build/dev/startup/core_service.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ if [ "${COMPOSE_PROFILES#*"with-yugabyte"}" != "${COMPOSE_PROFILES}" ]; then
1010
echo "Using Yugabyte"
1111
DATASTORE_CONNECTION="-datastore_host local-dss-ybdb -datastore_user yugabyte --datastore_port 5433"
1212
else
13-
echo "Using CockroachDB"
14-
DATASTORE_CONNECTION="-datastore_host local-dss-crdb"
13+
if [ "${COMPOSE_PROFILES#*"with-raft"}" != "${COMPOSE_PROFILES}" ]; then
14+
echo "Using raft"
15+
DATASTORE_CONNECTION="-store_type raft -raft_node_id=1 -rid_raft_peers=1=http://127.0.0.1:9011 -scd_raft_peers=1=http://127.0.0.1:9021 -aux_raft_peers=1=http://127.0.0.1:9031 -raft_datadir /raftdata"
16+
else
17+
echo "Using CockroachDB"
18+
DATASTORE_CONNECTION="-datastore_host local-dss-crdb"
19+
fi
1520
fi
1621

1722
if [ "$DEBUG_ON" = "1" ]; then

0 commit comments

Comments
 (0)