@@ -59,6 +59,48 @@ OPTIONS=''
59
59
60
60
# ###############################################################################
61
61
62
+ function turtle()
63
+ {
64
+ if [[ -z $1 ]]; then
65
+ eye=" '"
66
+ else
67
+ eye=x
68
+ fi
69
+ echo " __ "
70
+ echo " .,-;-;-,. /${eye} _\\ "
71
+ echo " _/_/_/_|_\\ _\\ ) / "
72
+ echo " '-<_><_><_><_>=/\\ "
73
+ echo " \` /_/====/_/-'\\ _\\ "
74
+ echo " \"\" \"\" \"\" "
75
+ }
76
+
77
+ function thoughtBubble()
78
+ {
79
+
80
+ echo " .-~~~-. "
81
+ echo " .- ~ ~-( )_ _ "
82
+ echo " / ~ -. "
83
+ echo " | CROMSHELL \\ "
84
+ echo " \\ .' "
85
+ echo " ~- . _ _ . -~ "
86
+ echo " ~~~~~~~~~~~"
87
+ echo " () "
88
+ echo " o "
89
+ echo " ."
90
+ }
91
+
92
+ function logo()
93
+ {
94
+ echo
95
+ echo ' +--------------------------+'
96
+ echo ' | CROMSHELL |'
97
+ echo ' +--------------------------+'
98
+ turtle
99
+ echo
100
+ }
101
+
102
+ # ###############################################################################
103
+
62
104
function simpleUsage()
63
105
{
64
106
echo -e " Usage: ${SCRIPTNAME} <subcommand> [options]"
@@ -69,6 +111,7 @@ function simpleUsage()
69
111
function usage()
70
112
{
71
113
simpleUsage
114
+ echo -e
72
115
echo -e " CROMWELL_URL=$CROMWELL_URL "
73
116
echo
74
117
echo -e " If no workflow-id is specified then the last submitted workflow-id is assumed."
@@ -218,7 +261,6 @@ trap at_exit EXIT
218
261
219
262
function populateWorkflowIdAndServerUrl()
220
263
{
221
-
222
264
local userSpecifiedId=$1
223
265
224
266
# If the user specified a negative number, get the nth last workflow:
@@ -252,7 +294,8 @@ function populateWorkflowIdAndServerUrl()
252
294
# Submit a workflow and arguments to the Cromwell Server
253
295
254
296
function submit()
255
- {
297
+ {
298
+ turtle
256
299
assertCanCommunicateWithServer $CROMWELL_URL
257
300
258
301
local response=$( curl --connect-timeout $CURL_CONNECT_TIMEOUT -s -F workflowSource=@${1} ${2: + -F workflowInputs=@ ${2} } ${3: + -F workflowOptions=@ ${3} } ${4: + -F workflowDependencies=@ ${4} } ${CROMWELL_URL} /api/workflows/v1)
@@ -276,6 +319,7 @@ function submit()
276
319
# Check the status of a Cromwell job UUID
277
320
function status()
278
321
{
322
+
279
323
local retVal=0
280
324
281
325
assertCanCommunicateWithServer $2
@@ -287,6 +331,12 @@ function status()
287
331
r=$?
288
332
[[ $r -eq 0 ]] && retVal=1
289
333
334
+ if [[ $retVal -eq 1 ]]; then
335
+ turtle " dead"
336
+ else
337
+ turtle
338
+ fi
339
+
290
340
cat $f | jq .
291
341
checkPipeStatus " Could not read tmp file JSON data." " Could not parse JSON output from cromwell server."
292
342
@@ -300,6 +350,7 @@ function status()
300
350
# Get the logs of a Cromwell job UUID
301
351
function logs()
302
352
{
353
+ turtle
303
354
assertCanCommunicateWithServer $2
304
355
curl --connect-timeout $CURL_CONNECT_TIMEOUT -s ${2} /api/workflows/v1/${1} /logs | jq .
305
356
checkPipeStatus " Could not connect to Cromwell server." " Could not parse JSON output from cromwell server."
@@ -309,6 +360,7 @@ function logs()
309
360
# Get the metadata for a Cromwell job UUID
310
361
function metadata()
311
362
{
363
+ turtle
312
364
assertCanCommunicateWithServer $2
313
365
curl --connect-timeout $CURL_CONNECT_TIMEOUT --compressed -s ${2} /api/workflows/v1/${1} /metadata? ${CROMWELL_METADATA_PARAMETERS} | jq .
314
366
checkPipeStatus " Could not connect to Cromwell server." " Could not parse JSON output from cromwell server."
@@ -318,6 +370,7 @@ function metadata()
318
370
# Get the metadata in condensed form for a Cromwell job UUID
319
371
function slim-metadata()
320
372
{
373
+ turtle
321
374
assertCanCommunicateWithServer $2
322
375
curl --connect-timeout $CURL_CONNECT_TIMEOUT --compressed -s " ${2} /api/workflows/v1/$1 /metadata?includeKey=executionStatus&includeKey=backendStatus" | jq .
323
376
checkPipeStatus " Could not connect to Cromwell server." " Could not parse JSON output from cromwell server."
@@ -327,6 +380,7 @@ function slim-metadata()
327
380
# Get the status of the given job and how many times it was run
328
381
function execution-status-count()
329
382
{
383
+ turtle
330
384
assertCanCommunicateWithServer $2
331
385
f=$( makeTemp )
332
386
curl --connect-timeout $CURL_CONNECT_TIMEOUT --compressed -s ${2} /api/workflows/v1/$1 /metadata? ${CROMWELL_METADATA_PARAMETERS} > $f
@@ -348,6 +402,7 @@ function execution-status-count()
348
402
# Bring up a browser window to view timing information on the job.
349
403
function timing()
350
404
{
405
+ turtle
351
406
echo " Opening timing information in a web browser for job ID: ${1} "
352
407
open ${2} /api/workflows/v1/${1} /timing
353
408
return $?
@@ -356,6 +411,7 @@ function timing()
356
411
# Cancel a running job.
357
412
function abort()
358
413
{
414
+ turtle
359
415
assertCanCommunicateWithServer $2
360
416
response=$( curl --connect-timeout $CURL_CONNECT_TIMEOUT -X POST --header " Content-Type: application/json" --header " Accept: application/json" " ${2} /api/workflows/v1/${1} /abort" )
361
417
local r=$?
@@ -366,7 +422,7 @@ function abort()
366
422
# List all jobs submitted in ${CROMWELL_SUBMISSIONS_FILE}
367
423
function list()
368
424
{
369
-
425
+ turtle
370
426
local doColor=false
371
427
local doUpdate=false
372
428
@@ -449,6 +505,7 @@ function list()
449
505
# output
450
506
function list-outputs()
451
507
{
508
+ turtle
452
509
assertCanCommunicateWithServer $2
453
510
local id=$1
454
511
local cromwellServer=$2
@@ -476,6 +533,7 @@ function list-outputs()
476
533
# Get the root log folder from the cloud and put it in the metadata folder for this run
477
534
function fetch-logs()
478
535
{
536
+ turtle
479
537
assertCanCommunicateWithServer $2
480
538
local id=$1
481
539
local cromwellServer=$2
@@ -511,6 +569,7 @@ function fetch-logs()
511
569
# Includes all logs and output files
512
570
function fetch-all()
513
571
{
572
+ turtle
514
573
assertCanCommunicateWithServer $2
515
574
local id=$1
516
575
local cromwellServer=$2
@@ -637,7 +696,7 @@ if ${ISCALLEDBYUSER} ; then
637
696
638
697
# Special case: notify
639
698
if [[ " ${SUB_COMMAND} " == " notify" ]] ; then
640
-
699
+ turtle
641
700
# Is the next argument our workflow ID?
642
701
# Workflow IDs are standard UUIDs:
643
702
if [[ " ${1} " =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ ]] ; then
0 commit comments