3 # Copyright (C) The Arvados Authors. All rights reserved.
5 # SPDX-License-Identifier: CC-BY-SA-3.0
10 if test "$NODE" != localhost ; then
11 if ! ssh $NODE test -d arvados-setup ; then
12 ssh $NODE git init --bare arvados-setup.git
13 if ! git remote add $NODE $DEPLOY_USER@$NODE:arvados-setup.git ; then
14 git remote set-url $NODE $DEPLOY_USER@$NODE:arvados-setup.git
16 git push $NODE $BRANCH
17 ssh $NODE git clone arvados-setup.git arvados-setup
20 git push $NODE $BRANCH
21 ssh $NODE git -C arvados-setup checkout $BRANCH
22 ssh $NODE git -C arvados-setup pull
27 if test -z "${NODES[$NODE]}" ; then
28 echo "No roles declared for '$NODE' in local.params"
32 if test $NODE = localhost ; then
33 sudo ./provision.sh --config local.params --roles ${NODES[$NODE]}
35 ssh $DEPLOY_USER@$NODE "cd arvados-setup && sudo ./provision.sh --config local.params --roles ${NODES[$NODE]}"
40 CONFIG_FILE=local.params
41 if ! test -s $CONFIG_FILE ; then
42 echo "Must be run from arvados-setup, maybe you need to 'initialize' first?"
48 if test -n "$subcmd" ; then
53 if ! test -f provision.sh ; then
54 echo "Must be run from arvados/tools/salt-install"
63 if test -z "$PARAMS" -o ! -f local.params.example.$PARAMS ; then
64 echo "Not found: local.params.example.$PARAMS"
65 echo "Expected one of multiple_hosts, single_host_multiple_hostnames, single_host_single_hostname"
69 if test -z "$SLS" -o ! -d config_examples/$SLS ; then
70 echo "Not found: config_examples/$SLS"
71 echo "Expected one of multi_host/aws, single_host/multiple_hostnames, single_host/single_hostname"
75 if test -z "$SETUPDIR" -o -z "$PARAMS" -o -z "$SLS" ; then
76 echo "installer.sh <setup dir to initialize> <params template> <config template>"
80 if test -n "$err" ; then
84 echo "Initializing $SETUPDIR"
86 cp -r *.sh tests $SETUPDIR
88 cp local.params.example.$PARAMS $SETUPDIR/local.params
89 cp -r config_examples/$SLS $SETUPDIR/local_config_dir
92 git add *.sh local.params local_config_dir tests
93 git commit -m"initial commit"
95 echo "setup directory initialized, now go to $SETUPDIR, edit 'local.params' and 'local_config_dir' as needed, then run 'installer.sh deploy'"
104 BRANCH=$(git branch --show-current)
107 if ! git diff --cached --exit-code ; then
108 git commit -m"prepare for deploy"
111 if test -z "$NODE"; then
112 for NODE in "${!NODES[@]}"
126 if ! which arvados-client ; then
127 apt-get install arvados-client
130 export ARVADOS_API_HOST="${CONTROLLER_INT_IP}"
131 export ARVADOS_API_TOKEN="$SYSTEM_ROOT_TOKEN"
133 arvados-client diagnostics -internal-client
135 echo "Arvados installer"
137 echo "initialize initialize the setup directory for configuration"
138 echo "deploy deploy the configuration from the setup directory"