From 7ae95cd88f8de821b56d81a49a6999669d823c76 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Sat, 1 Nov 2014 20:41:48 -0400 Subject: [PATCH] Add first version of the easy-evaluation script. refs #4383 --- install/easy-evaluation.sh | 83 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100755 install/easy-evaluation.sh diff --git a/install/easy-evaluation.sh b/install/easy-evaluation.sh new file mode 100755 index 0000000..16139d9 --- /dev/null +++ b/install/easy-evaluation.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + +# This script is intended for easy Arvados evaluation. It will download the +# latest copy of the Arvados docker images as well as the arvdock command. It +# then uses arvdoc to spin up Arvados on this computer. +# +# A version of this script is available at http://get.arvados.org, so that this +# command does the right thing: +# +# $ \curl -sSL http://get.arvados.org | bash +# + +COLUMNS=80 + +fail () { + title "$*" + exit 1 +} + +title () { + printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********" +} + +docker_pull () { + $DOCKER pull $* + + ECODE=$? + + if [[ "$ECODE" != "0" ]]; then + title "$DOCKER pull $* failed" + exit $ECODE + fi +} + +main () { + + \which which >/dev/null 2>&1 || fail "Error: could not find 'which' command." + + # find the docker binary + DOCKER=`which docker.io` + + if [[ "$DOCKER" == "" ]]; then + DOCKER=`which docker` + fi + + if [[ "$DOCKER" == "" ]]; then + fail "Error: you need to have docker installed. Could not find the docker executable." + fi + + echo + echo "If necessary, this command will download the latest arvados docker images." + echo "The download can take a long time, depending on the speed of your internet connection." + echo "When the images are downloaded, it will then start an Arvados environment on this computer." + echo + docker_pull arvados/workbench + docker_pull arvados/doc + docker_pull arvados/keep + docker_pull arvados/shell + docker_pull arvados/compute + docker_pull arvados/keep + docker_pull arvados/api + docker_pull crosbymichael/skydns + docker_pull crosbymichael/skydock + + # Now download arvdock and start the containers + echo + echo Downloading arvdock + echo + \curl -sSL https://raw.githubusercontent.com/curoverse/arvados/master/docker/arvdock -o arvdock + chmod 755 arvdock + + echo + echo Starting the docker containers + echo + ./arvdock start + + echo To stop the containers, run + echo + echo ./arvdock stop + echo +} + +main -- 2.30.2