aboutsummaryrefslogtreecommitdiff
path: root/src/cli/stasis
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/stasis')
-rw-r--r--src/cli/stasis/args.c4
-rw-r--r--src/cli/stasis/include/args.h2
-rw-r--r--src/cli/stasis/stasis_main.c15
3 files changed, 21 insertions, 0 deletions
diff --git a/src/cli/stasis/args.c b/src/cli/stasis/args.c
index f3ce823..172981a 100644
--- a/src/cli/stasis/args.c
+++ b/src/cli/stasis/args.c
@@ -13,6 +13,7 @@ struct option long_options[] = {
{"unbuffered", no_argument, 0, 'U'},
{"update-base", no_argument, 0, OPT_ALWAYS_UPDATE_BASE},
{"fail-fast", no_argument, 0, OPT_FAIL_FAST},
+ {"task-timeout", required_argument, 0, OPT_TASK_TIMEOUT},
{"overwrite", no_argument, 0, OPT_OVERWRITE},
{"no-docker", no_argument, 0, OPT_NO_DOCKER},
{"no-artifactory", no_argument, 0, OPT_NO_ARTIFACTORY},
@@ -20,6 +21,7 @@ struct option long_options[] = {
{"no-artifactory-upload", no_argument, 0, OPT_NO_ARTIFACTORY_UPLOAD},
{"no-testing", no_argument, 0, OPT_NO_TESTING},
{"no-parallel", no_argument, 0, OPT_NO_PARALLEL},
+ {"no-task-logging", no_argument, 0, OPT_NO_TASK_LOGGING},
{"no-rewrite", no_argument, 0, OPT_NO_REWRITE_SPEC_STAGE_2},
{0, 0, 0, 0},
};
@@ -36,6 +38,7 @@ const char *long_options_help[] = {
"Disable line buffering",
"Update conda installation prior to STASIS environment creation",
"On error, immediately terminate all tasks",
+ "Terminate task after timeout is reached (#s, #m, #h)",
"Overwrite an existing release",
"Do not build docker images",
"Do not upload artifacts to Artifactory",
@@ -43,6 +46,7 @@ const char *long_options_help[] = {
"Do not upload artifacts to Artifactory (dry-run)",
"Do not execute test scripts",
"Do not execute tests in parallel",
+ "Do not log task output (write to stdout)",
"Do not rewrite paths and URLs in output files",
NULL,
};
diff --git a/src/cli/stasis/include/args.h b/src/cli/stasis/include/args.h
index 5bad752..5536735 100644
--- a/src/cli/stasis/include/args.h
+++ b/src/cli/stasis/include/args.h
@@ -17,6 +17,8 @@
#define OPT_FAIL_FAST 1009
#define OPT_NO_PARALLEL 1010
#define OPT_POOL_STATUS_INTERVAL 1011
+#define OPT_NO_TASK_LOGGING 1012
+#define OPT_TASK_TIMEOUT 1013
extern struct option long_options[];
void usage(char *progname);
diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c
index 2ce6831..44ee6d7 100644
--- a/src/cli/stasis/stasis_main.c
+++ b/src/cli/stasis/stasis_main.c
@@ -540,6 +540,18 @@ int main(int argc, char *argv[]) {
case OPT_FAIL_FAST:
globals.parallel_fail_fast = true;
break;
+ case OPT_TASK_TIMEOUT:
+ globals.task_timeout = str_to_timeout(optarg);
+ if (globals.task_timeout < 0) {
+ fprintf(stderr, "Invalid timeout: %s\n", optarg);
+ if (globals.task_timeout == STR_TO_TIMEOUT_INVALID_TIME_SCALE) {
+ fprintf(stderr, "Use format '#s' (seconds), '#m' (minutes), '#h' (hours)\n");
+ } else if (globals.task_timeout == STR_TO_TIMEOUT_NEGATIVE) {
+ fprintf(stderr, "Timeout cannot be negative\n");
+ }
+ exit(1);
+ }
+ break;
case OPT_POOL_STATUS_INTERVAL:
globals.pool_status_interval = (int) strtol(optarg, NULL, 10);
if (globals.pool_status_interval < 1) {
@@ -586,6 +598,9 @@ int main(int argc, char *argv[]) {
case OPT_NO_PARALLEL:
globals.enable_parallel = false;
break;
+ case OPT_NO_TASK_LOGGING:
+ globals.enable_task_logging = false;
+ break;
case '?':
default:
exit(1);