aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrinity Pointard <trinity.pointard@gmail.com>2021-11-18 19:21:58 +0100
committerTrinity Pointard <trinity.pointard@gmail.com>2021-11-18 19:21:58 +0100
commit79bd5f17a68232b7fde4f1c8986ce2b24456d040 (patch)
tree2109df74ad63f3b06a330418583646f07fd594a3
parent179d18fcecafc209d127604f78f18baa7f4926f1 (diff)
downloadmknet-79bd5f17a68232b7fde4f1c8986ce2b24456d040.tar.gz
mknet-79bd5f17a68232b7fde4f1c8986ce2b24456d040.zip
update to support garage new layout concept
-rw-r--r--config.yml2
-rwxr-xr-xexample/deploy_garage.sh20
2 files changed, 16 insertions, 6 deletions
diff --git a/config.yml b/config.yml
index 327a3b1..87d167b 100644
--- a/config.yml
+++ b/config.yml
@@ -40,7 +40,7 @@ servers:
global:
subnet:
- base: fc00:9a7a:9e::
+ base: 'fc00:9a7a:9e::'
local: 64
zone: 16
latency-offset: 3ms
diff --git a/example/deploy_garage.sh b/example/deploy_garage.sh
index 8377673..e91b387 100755
--- a/example/deploy_garage.sh
+++ b/example/deploy_garage.sh
@@ -3,11 +3,15 @@
set -euo pipefail
IFS=$'\n\t'
-GARAGE_PATH=/home/trinity/tmp/garage/target/release/garage
+GARAGE_PATH=garage
STORAGE_PATH=/tmp/garage-testnet
export RPC_SECRET=3e9abff5f9e480afbadb46a77b7a26fe0e404258f0dc3fd5386b0ba8e0ad2fba
-NODE_STORAGE_PATH=${STORAGE_PATH}/${ZONE}/${HOST}
+if [ -z "$ZONE" ]; then
+ NODE_STORAGE_PATH=${STORAGE_PATH}/${HOST}
+else
+ NODE_STORAGE_PATH=${STORAGE_PATH}/${ZONE}/${HOST}
+fi
BOOTSTRAP_FILE=${STORAGE_PATH}/bootstrap_peer
export GARAGE_CONFIG_FILE=${NODE_STORAGE_PATH}/garage.toml
@@ -31,6 +35,7 @@ bootstrap_peers=[]
[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
+root_domain = ".s3.garage"
[s3_web]
bind_addr = "[::]:3902"
@@ -43,9 +48,14 @@ sleep 2
CONFIG_NODE_FPATH=(${STORAGE_PATH}/*{,/*}/garage.toml)
-SELF_ID=$(${GARAGE_PATH} node-id 2>/dev/null)
+SELF_ID=$(${GARAGE_PATH} node id 2>/dev/null)
SHORT_ID=$(echo ${SELF_ID} | cut -c-64)
${GARAGE_PATH} -c ${CONFIG_NODE_FPATH[0]} node connect ${SELF_ID}
-sleep ${ID}
-${GARAGE_PATH} -c ${CONFIG_NODE_FPATH[0]} node configure -z ${ZONE:-unzonned-${HOST}} -c 1 -t ${HOST} ${SHORT_ID}
+${GARAGE_PATH} -c ${CONFIG_NODE_FPATH[0]} layout assign ${SHORT_ID} -z ${ZONE:-unzonned-${HOST}} -c 1 -t ${HOST}
+
+if [ ${CONFIG_NODE_FPATH[0]} == ${GARAGE_CONFIG_FILE} ]; then
+ sleep 2
+ ${GARAGE_PATH} layout show
+ ${GARAGE_PATH} layout apply --version 1
+fi