[arvados] created: 2.1.0-2616-gf48fc867a
git repository hosting
git at public.arvados.org
Sun Jun 26 22:44:25 UTC 2022
at f48fc867a1061b2baf8c16a5e6e8812156122d68 (commit)
commit f48fc867a1061b2baf8c16a5e6e8812156122d68
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Sun Jun 26 18:42:03 2022 -0400
18870: New script to help manage install
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/tools/salt-install/installer.sh b/tools/salt-install/installer.sh
new file mode 100755
index 000000000..7bd789f68
--- /dev/null
+++ b/tools/salt-install/installer.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: CC-BY-SA-3.0
+
+set -e
+
+subcmd="$1"
+if test -n "$subcmd" ; then
+ shift
+fi
+case "$subcmd" in
+ initialize)
+ if ! test -f provision.sh ; then
+ echo "Must be run from arvados/tools/salt-install"
+ exit
+ fi
+
+ SETUPDIR=$1
+ PARAMS=$2
+ SLS=$3
+
+ err=
+ if test -z "$PARAMS" -o ! -f local.params.example.$PARAMS ; then
+ echo "Not found: local.params.example.$PARAMS"
+ echo "Expected one of multiple_hosts, single_host_multiple_hostnames, single_host_single_hostname"
+ err=1
+ fi
+
+ if test -z "$SLS" -o ! -d config_examples/$SLS ; then
+ echo "Not found: config_examples/$SLS"
+ echo "Expected one of multi_host/aws, single_host/multiple_hostnames, single_host/single_hostname"
+ err=1
+ fi
+
+ if test -z "$SETUPDIR" -o -z "$PARAMS" -o -z "$SLS" ; then
+ echo "installer.sh <setup dir to initialize> <params template> <config template>"
+ err=1
+ fi
+
+ if test -n "$err" ; then
+ exit 1
+ fi
+
+ echo "Initializing $SETUPDIR"
+ git init $SETUPDIR
+ cp -r *.sh tests $SETUPDIR
+
+ cp local.params.example.$PARAMS $SETUPDIR/local.params
+ cp -r config_examples/$SLS $SETUPDIR/local_config_dir
+
+ cd $SETUPDIR
+ git add *.sh local.params local_config_dir tests
+ git commit -m"initial commit"
+
+ echo "setup directory initialized, now go to $SETUPDIR, edit 'local.params' and 'local_config_dir' as needed, then run 'installer.sh deploy'"
+ ;;
+ deploy)
+ CONFIG_FILE=local.params
+ if ! test -s $CONFIG_FILE ; then
+ echo "Must be run from arvados-setup, maybe you need to 'initialize' first?"
+ fi
+
+ source ${CONFIG_FILE}
+
+ git commit -m"prepare for deploy"
+ for NODE in "${!NODES[@]}"
+ do
+ if ! ssh $NODE test -d arvados-setup.git ; then
+ ssh $NODE git init --bare arvados-setup.git
+ git add remote $NODE $DEPLOY_USER@$NODE:arvados-setup.git
+ git push $NODE
+ ssh $NODE git clone arvados-setup.git arvados-setup
+ fi
+
+ git push $NODE master
+ ssh $NODE git -C arvados-setup pull
+
+ ssh $DEPLOY_USER@$NODE "cd arvados-setup && sudo ./provision.sh --config local.params --roles ${NODES[$NODE]}"
+ done
+ ;;
+ *)
+ echo "Arvados installer"
+ echo ""
+ echo "initialize initialize the setup directory for configuration"
+ echo "deploy deploy the configuration from the setup directory"
+ ;;
+esac
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list