-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add defaults to all service related endpoints and add to dbnode endpo…
…int (#1984)
- Loading branch information
1 parent
b11760f
commit 9d8415a
Showing
24 changed files
with
485 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
scripts/docker-integration-tests/dedicated_etcd_embedded_coordinator/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: "3.5" | ||
services: | ||
dbnode01: | ||
expose: | ||
- "9000-9004" | ||
- "7201" | ||
ports: | ||
- "0.0.0.0:9000-9004:9000-9004" | ||
- "0.0.0.0:7201:7201" | ||
networks: | ||
- backend | ||
image: "m3dbnode_integration:${REVISION}" | ||
environment: | ||
- M3DB_HOST_ID=dbnode01 | ||
volumes: | ||
- "./m3dbnode.yml:/etc/m3dbnode/m3dbnode.yml" | ||
etcd01: | ||
expose: | ||
- "2379-2380" | ||
ports: | ||
- "0.0.0.0:2379-2380:2379-2380" | ||
networks: | ||
- backend | ||
image: quay.io/coreos/etcd:v3.3.10 | ||
command: | ||
- "etcd" | ||
- "--name" | ||
- "etcd01" | ||
- "--listen-peer-urls" | ||
- "http://0.0.0.0:2380" | ||
- "--listen-client-urls" | ||
- "http://0.0.0.0:2379" | ||
- "--advertise-client-urls" | ||
- "http://etcd01:2379" | ||
- "--initial-cluster-token" | ||
- "etcd-cluster-1" | ||
- "--initial-advertise-peer-urls" | ||
- "http://etcd01:2380" | ||
- "--initial-cluster" | ||
- "etcd01=http://etcd01:2380" | ||
- "--initial-cluster-state" | ||
- "new" | ||
- "--data-dir" | ||
- "/var/lib/etcd" | ||
networks: | ||
backend: |
85 changes: 85 additions & 0 deletions
85
scripts/docker-integration-tests/dedicated_etcd_embedded_coordinator/m3dbnode.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
coordinator: | ||
listenAddress: | ||
type: "config" | ||
value: "0.0.0.0:7201" | ||
|
||
logging: | ||
level: info | ||
|
||
metrics: | ||
scope: | ||
prefix: "coordinator" | ||
prometheus: | ||
handlerPath: /metrics | ||
listenAddress: 0.0.0.0:7203 # until https://github.com/m3db/m3/issues/682 is resolved | ||
sanitization: prometheus | ||
samplingRate: 1.0 | ||
extended: none | ||
|
||
tagOptions: | ||
idScheme: quoted | ||
|
||
db: | ||
logging: | ||
level: info | ||
|
||
metrics: | ||
prometheus: | ||
handlerPath: /metrics | ||
sanitization: prometheus | ||
samplingRate: 1.0 | ||
extended: detailed | ||
|
||
listenAddress: 0.0.0.0:9000 | ||
clusterListenAddress: 0.0.0.0:9001 | ||
httpNodeListenAddress: 0.0.0.0:9002 | ||
httpClusterListenAddress: 0.0.0.0:9003 | ||
debugListenAddress: 0.0.0.0:9004 | ||
|
||
hostID: | ||
resolver: environment | ||
envVarName: M3DB_HOST_ID | ||
|
||
client: | ||
writeConsistencyLevel: majority | ||
readConsistencyLevel: unstrict_majority | ||
|
||
gcPercentage: 100 | ||
|
||
writeNewSeriesAsync: true | ||
writeNewSeriesLimitPerSecond: 1048576 | ||
writeNewSeriesBackoffDuration: 2ms | ||
|
||
bootstrap: | ||
# Intentionally disable peers bootstrapper to ensure it doesn't interfere with test. | ||
bootstrappers: | ||
- filesystem | ||
- commitlog | ||
- uninitialized_topology | ||
commitlog: | ||
returnUnfulfilledForCorruptCommitLogFiles: false | ||
|
||
cache: | ||
series: | ||
policy: lru | ||
|
||
commitlog: | ||
flushMaxBytes: 524288 | ||
flushEvery: 1s | ||
queue: | ||
calculationType: fixed | ||
size: 2097152 | ||
|
||
fs: | ||
filePathPrefix: /var/lib/m3db | ||
|
||
config: | ||
service: | ||
env: foo-namespace/foo-cluster | ||
zone: bar-zone | ||
service: m3db | ||
cacheDir: /var/lib/m3kv | ||
etcdClusters: | ||
- zone: bar-zone | ||
endpoints: | ||
- etcd01:2379 |
43 changes: 43 additions & 0 deletions
43
scripts/docker-integration-tests/dedicated_etcd_embedded_coordinator/test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -xe | ||
|
||
source $GOPATH/src/github.com/m3db/m3/scripts/docker-integration-tests/common.sh | ||
REVISION=$(git rev-parse HEAD) | ||
SCRIPT_PATH=$GOPATH/src/github.com/m3db/m3/scripts/docker-integration-tests/dedicated_etcd_embedded_coordinator | ||
COMPOSE_FILE=$SCRIPT_PATH/docker-compose.yml | ||
export REVISION | ||
|
||
echo "Run etcd and m3dbnode containers" | ||
docker-compose -f ${COMPOSE_FILE} up -d --renew-anon-volumes etcd01 | ||
docker-compose -f ${COMPOSE_FILE} up -d --renew-anon-volumes dbnode01 | ||
|
||
DUMP_DIR="${SCRIPT_PATH}/dump" | ||
DUMP_ZIP="${DUMP_DIR}/dump.zip" | ||
|
||
function defer { | ||
if [ -d $DUMP_DIR ]; then | ||
rm -rf $DUMP_DIR | ||
fi | ||
docker-compose -f ${COMPOSE_FILE} down || echo "unable to shutdown containers" # CI fails to stop all containers sometimes | ||
} | ||
trap defer EXIT | ||
|
||
# Should be able to setup single db node with custom environment and zone | ||
# using the embedded coordinator without special headers | ||
DBNODE_ID="dbnode01" ZONE="bar-zone" setup_single_m3db_node | ||
|
||
echo "Test the debug dump endpoint works with custom env and zone" | ||
mkdir -p $DUMP_DIR | ||
curl -s http://localhost:9004/debug/dump > $DUMP_ZIP | ||
|
||
unzip -d $DUMP_DIR $DUMP_ZIP | ||
|
||
EXPECTED_FILES="cpu.prof heap.prof goroutine.prof host.json namespace.json placement-m3db.json" | ||
for file in $(echo "${EXPECTED_FILES}" | tr " " "\n"); do | ||
if ! [ -f "${DUMP_DIR}/${file}" ]; then | ||
echo "Expected ${file} but not in dump:" | ||
echo $(ls $DUMP_DIR) | ||
exit 1 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.