3 # Copyright (C) The Arvados Authors. All rights reserved.
5 # SPDX-License-Identifier: CC-BY-SA-3.0
12 if test "$NODE" != localhost ; then
13 if ! ssh $NODE test -d ${TARGET}.git ; then
14 ssh $NODE git init --bare ${GITTARGET}.git
15 if ! git remote add $NODE $DEPLOY_USER@$NODE:${GITTARGET}.git ; then
16 git remote set-url $NODE $DEPLOY_USER@$NODE:${GITTARGET}.git
18 git push $NODE $BRANCH
19 ssh $NODE git clone ${GITTARGET}.git ${GITTARGET}
22 git push $NODE $BRANCH
23 ssh $NODE git -C ${GITTARGET} checkout $BRANCH
24 ssh $NODE git -C ${GITTARGET} pull
29 if test -z "${NODES[$NODE]}" ; then
30 echo "No roles declared for '$NODE' in local.params"
34 if test $NODE = localhost ; then
35 sudo ./provision.sh --config local.params --roles ${NODES[$NODE]}
37 ssh $DEPLOY_USER@$NODE "cd ${GITTARGET} && sudo ./provision.sh --config local.params --roles ${NODES[$NODE]}"
42 CONFIG_FILE=local.params
43 if ! test -s $CONFIG_FILE ; then
44 echo "Must be run from initialized setup dir, maybe you need to 'initialize' first?"
47 GITTARGET=arvados-deploy-config-${CLUSTER}
51 if test -n "$subcmd" ; then
56 if ! test -f provision.sh ; then
57 echo "Must be run from arvados/tools/salt-install"
66 if test -z "$PARAMS" -o ! -f local.params.example.$PARAMS ; then
67 echo "Not found: local.params.example.$PARAMS"
68 echo "Expected one of multiple_hosts, single_host_multiple_hostnames, single_host_single_hostname"
72 if test -z "$SLS" -o ! -d config_examples/$SLS ; then
73 echo "Not found: config_examples/$SLS"
74 echo "Expected one of multi_host/aws, single_host/multiple_hostnames, single_host/single_hostname"
78 if test -z "$SETUPDIR" -o -z "$PARAMS" -o -z "$SLS" ; then
79 echo "installer.sh <setup dir to initialize> <params template> <config template>"
83 if test -n "$err" ; then
87 echo "Initializing $SETUPDIR"
89 cp -r *.sh tests $SETUPDIR
91 cp local.params.example.$PARAMS $SETUPDIR/local.params
92 cp -r config_examples/$SLS $SETUPDIR/local_config_dir
95 git add *.sh local.params local_config_dir tests
96 git commit -m"initial commit"
98 echo "setup directory initialized, now go to $SETUPDIR, edit 'local.params' and 'local_config_dir' as needed, then run 'installer.sh deploy'"
107 BRANCH=$(git branch --show-current)
110 if ! git diff --cached --exit-code ; then
111 git commit -m"prepare for deploy"
114 if test -z "$NODE"; then
115 for NODE in "${!NODES[@]}"
129 if ! which arvados-client ; then
130 apt-get install arvados-client
133 export ARVADOS_API_HOST="${CLUSTER}.${DOMAIN}"
134 export ARVADOS_API_TOKEN="$SYSTEM_ROOT_TOKEN"
136 arvados-client diagnostics -internal-client
139 echo "Arvados installer"
141 echo "initialize initialize the setup directory for configuration"
142 echo "deploy deploy the configuration from the setup directory"
143 echo "diagnostics check your install using diagnostics"