Skip to content

Commit f4372b0

Browse files
committed
add run_info_dir
1 parent 69e4db8 commit f4372b0

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

taskvine/src/bindings/python3/ndcctools/taskvine/manager.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ class Manager(object):
6565
# @param port The port number to listen on. If zero, then a random port is chosen. A range of possible ports (low, hight) can be also specified instead of a single integer. Default is 9123
6666
# @param name The project name to use.
6767
# @param shutdown Automatically shutdown workers when manager is finished. Disabled by default.
68-
# @param run_info_path Directory to write log (and staging if staging_path not given) files per run. If None, defaults to "vine-run-info"
68+
# @param run_info_path Directory to archive workflow log directories, it is the upper level directory to run_info_dir. If None, defaults to "vine-run-info"
69+
# @param run_info_dir Directory to write log (and staging if staging_path not given) files per run. If None, defaults by a %Y-%m-%dT%H%M%S format.
6970
# @param staging_path Directory to write temporary files. Defaults to run_info_path if not given.
7071
# @param ssl A tuple of filenames (ssl_key, ssl_cert) in pem format, or True.
7172
# If not given, then TSL is not activated. If True, a self-signed temporary key and cert are generated.
@@ -78,6 +79,7 @@ def __init__(self,
7879
name=None,
7980
shutdown=False,
8081
run_info_path="vine-run-info",
82+
run_info_dir=None,
8183
staging_path=None,
8284
ssl=None,
8385
init_fn=None,
@@ -113,6 +115,9 @@ def __init__(self,
113115
try:
114116
if run_info_path:
115117
self.set_runtime_info_path(run_info_path)
118+
if run_info_dir:
119+
os.environ["VINE_RUNTIME_INFO_DIR"] = run_info_dir
120+
# self.set_runtime_info_dir(run_info_dir)
116121

117122
self._stats = cvine.vine_stats()
118123
self._stats_hierarchy = cvine.vine_stats()
@@ -559,8 +564,16 @@ def set_property(self, name, value):
559564
#
560565
# @param self Reference to the current manager object.
561566
# @param dirname A directory name
562-
def set_runtime_info_path(self, dirname):
563-
cvine.vine_set_runtime_info_path(dirname)
567+
def set_runtime_info_path(self, path):
568+
cvine.vine_set_runtime_info_path(path)
569+
570+
##
571+
# Specify the runtime info directory of this workflow, by default is a %Y-%m-%dT%H%M%S format.
572+
#
573+
# @param self Reference to the current manager object.
574+
# @param dirname A directory name
575+
def set_runtime_info_dir(self, dirname):
576+
cvine.vine_set_runtime_info_dir(dirname)
564577

565578
##
566579
# Add a mandatory password that each worker must present.

taskvine/src/manager/taskvine.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,11 @@ void vine_initialize_categories(struct vine_manager *m, struct rmsummary *max, c
14891489
*/
14901490
void vine_set_runtime_info_path(const char *path);
14911491

1492+
/** Sets the directory where a workflow-specific runtime logs are directly written into.
1493+
@param dir A directory
1494+
*/
1495+
void vine_set_runtime_info_dir(const char *dir);
1496+
14921497
/** Adds a custom APPLICATION entry to the debug log.
14931498
@param m Reference to the current manager object.
14941499
@param entry A custom debug message.

taskvine/src/manager/vine_runtime_dir.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,9 @@ void vine_set_runtime_info_path(const char *path)
163163
assert(path);
164164
vine_runtime_info_path = xxstrdup(path);
165165
}
166+
167+
void vine_set_runtime_info_dir(const char *dir)
168+
{
169+
assert(dir);
170+
setenv("VINE_RUNTIME_INFO_DIR", dir, 1);
171+
}

0 commit comments

Comments
 (0)