parent
0a482607d5
commit
98e5f4c98c
@ -0,0 +1,20 @@ |
||||
# shellcheck source=../utils/with-single-node-cluster.sh |
||||
source "$UTILS"/with-single-node-cluster.sh |
||||
|
||||
adminBS="$XDG_DATA_HOME"/isle/bootstrap.yml |
||||
bs=create-bootstrap-out.yml |
||||
|
||||
isle admin create-bootstrap \ |
||||
--admin-path admin.yml \ |
||||
--hostname secondus \ |
||||
--ip 10.6.9.2 \ |
||||
> "$bs" |
||||
|
||||
[ "$(yq <"$bs" '.admin_creation_params')" = "$(yq <admin.yml '.creation_params')" ] |
||||
[ "$(yq <"$bs" '.hostname')" = "secondus" ] |
||||
|
||||
[ "$(yq <"$bs" '.hosts.primus.nebula.signed_public_credentials')" \ |
||||
= "$(yq <"$adminBS" '.nebula.signed_public_credentials')" ] |
||||
|
||||
[ "$(yq <"$bs" '.hosts.primus.garage.instances|length')" = "3" ] |
||||
|
@ -0,0 +1,14 @@ |
||||
( |
||||
set -e |
||||
|
||||
TMPDIR="$TMPDIR/shared/single-node.tmp" |
||||
if [ ! -d "$TMPDIR" ]; then exit 0; fi |
||||
|
||||
lock_file="$TMPDIR/.run/isle/lock" |
||||
if [ ! -e "$lock_file" ]; then exit 0; fi |
||||
|
||||
pid="$(cat "$lock_file")" |
||||
echo "killing shared single node cluster (process: $pid)" |
||||
kill "$pid" |
||||
while [ -e "$TMPDIR/.run/isle" ]; do sleep 1; done |
||||
) |
@ -0,0 +1,48 @@ |
||||
set -e |
||||
|
||||
TMPDIR="$TMPDIR/shared/single-node.tmp" |
||||
XDG_RUNTIME_DIR="$TMPDIR/.run" |
||||
XDG_DATA_HOME="$TMPDIR/.data" |
||||
|
||||
mkdir -p "$TMPDIR" "$XDG_RUNTIME_DIR" "$XDG_DATA_HOME" |
||||
|
||||
cd "$TMPDIR" |
||||
|
||||
if [ ! -d "$XDG_RUNTIME_DIR/isle" ]; then |
||||
echo "Initializing shared single node cluster" |
||||
|
||||
mkdir a |
||||
mkdir b |
||||
mkdir c |
||||
|
||||
cat >daemon.yml <<EOF |
||||
vpn: |
||||
public_addr: 127.0.0.1:60000 |
||||
tun: |
||||
device: isle-test-shared |
||||
storage: |
||||
allocations: |
||||
- data_path: a/data |
||||
meta_path: a/meta |
||||
capacity: 100 |
||||
- data_path: b/data |
||||
meta_path: b/meta |
||||
capacity: 100 |
||||
- data_path: c/data |
||||
meta_path: c/meta |
||||
capacity: 100 |
||||
EOF |
||||
|
||||
isle admin create-network \ |
||||
--config-path daemon.yml \ |
||||
--domain shared.test \ |
||||
--hostname primus \ |
||||
--ip-net "10.6.9.1/24" \ |
||||
--name "testing" \ |
||||
> admin.yml |
||||
|
||||
isle daemon --config-path daemon.yml >daemon.log 2>&1 & |
||||
echo "Waiting for daemon (process $!) to initialize" |
||||
|
||||
while ! isle hosts list >/dev/null; do sleep 1; done |
||||
fi |
Loading…
Reference in new issue