X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/095e176632bbf81d28a239742a1ecce12404bd2d..ef4f350438ec7465b5fd71aeda834c2a707b80b3:/tools/salt-install/installer.sh diff --git a/tools/salt-install/installer.sh b/tools/salt-install/installer.sh index 439293c296..9930fd7708 100755 --- a/tools/salt-install/installer.sh +++ b/tools/salt-install/installer.sh @@ -449,14 +449,47 @@ diagnostics) arvados-client diagnostics $LOCATION ;; +diagnostics-internal) + loadconfig + set -u + + if [ -z "${ROLE2NODES['shell']:-}" ]; then + echo "No node with 'shell' role was found, cannot run diagnostics-internal" + exit 1 + fi + + export ARVADOS_API_HOST="${DOMAIN}:${CONTROLLER_EXT_SSL_PORT}" + export ARVADOS_API_TOKEN="$SYSTEM_ROOT_TOKEN" + + # Pick the first shell node for test running + declare TESTNODE=$(echo ${ROLE2NODES['shell']} | cut -d\, -f1) + declare SSH=$(ssh_cmd "$TESTNODE") + + # Set up credentials + declare CONFFILE=$(mktemp) + trap 'rm "$CONFFILE"' EXIT INT TERM QUIT + { + echo "ARVADOS_API_HOST=$ARVADOS_API_HOST" + echo "ARVADOS_API_TOKEN=$ARVADOS_API_TOKEN" + } > $CONFFILE + $SSH $DEPLOY_USER@$TESTNODE "sudo bash -c 'mkdir -m 0700 -p ~/.config/arvados'" + cat $CONFFILE | $SSH $DEPLOY_USER@$TESTNODE "sudo bash -c 'cat > ~/.config/arvados/settings.conf'" + + # Run diagnostics + echo "Running diagnostics in $TESTNODE..." + $SSH $DEPLOY_USER@$TESTNODE "sudo arvados-client diagnostics -internal-client" + + ;; + *) echo "Arvados installer" echo "" - echo "initialize initialize the setup directory for configuration" - echo "terraform create cloud resources using terraform" - echo "terraform-destroy destroy cloud resources created by terraform" - echo "generate-tokens generate random values for tokens" - echo "deploy deploy the configuration from the setup directory" - echo "diagnostics check your install using diagnostics" + echo "initialize initialize the setup directory for configuration" + echo "terraform create cloud resources using terraform" + echo "terraform-destroy destroy cloud resources created by terraform" + echo "generate-tokens generate random values for tokens" + echo "deploy deploy the configuration from the setup directory" + echo "diagnostics check your install running diagnostics locally" + echo "diagnostics-internal check your install running diagnostics on a shell node" ;; esac