Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vine: a manager argument to rename runtime directory #4041

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions taskvine/src/bindings/python3/ndcctools/taskvine/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class Manager(object):
# @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
# @param name The project name to use.
# @param shutdown Automatically shutdown workers when manager is finished. Disabled by default.
# @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"
# @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"
# @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.
# @param staging_path Directory to write temporary files. Defaults to run_info_path if not given.
# @param ssl A tuple of filenames (ssl_key, ssl_cert) in pem format, or True.
# If not given, then TSL is not activated. If True, a self-signed temporary key and cert are generated.
Expand All @@ -78,6 +79,7 @@ def __init__(self,
name=None,
shutdown=False,
run_info_path="vine-run-info",
run_info_dir=None,
staging_path=None,
ssl=None,
init_fn=None,
Expand Down Expand Up @@ -113,6 +115,9 @@ def __init__(self,
try:
if run_info_path:
self.set_runtime_info_path(run_info_path)
if run_info_dir:
os.environ["VINE_RUNTIME_INFO_DIR"] = run_info_dir
# self.set_runtime_info_dir(run_info_dir)

self._stats = cvine.vine_stats()
self._stats_hierarchy = cvine.vine_stats()
Expand Down Expand Up @@ -559,8 +564,16 @@ def set_property(self, name, value):
#
# @param self Reference to the current manager object.
# @param dirname A directory name
def set_runtime_info_path(self, dirname):
cvine.vine_set_runtime_info_path(dirname)
def set_runtime_info_path(self, path):
cvine.vine_set_runtime_info_path(path)

##
# Specify the runtime info directory of this workflow, by default is a %Y-%m-%dT%H%M%S format.
#
# @param self Reference to the current manager object.
# @param dirname A directory name
def set_runtime_info_dir(self, dirname):
cvine.vine_set_runtime_info_dir(dirname)

##
# Add a mandatory password that each worker must present.
Expand Down
5 changes: 5 additions & 0 deletions taskvine/src/manager/taskvine.h
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,11 @@ void vine_initialize_categories(struct vine_manager *m, struct rmsummary *max, c
*/
void vine_set_runtime_info_path(const char *path);

/** Sets the directory where a workflow-specific runtime logs are directly written into.
@param dir A directory
*/
void vine_set_runtime_info_dir(const char *dir);

/** Adds a custom APPLICATION entry to the debug log.
@param m Reference to the current manager object.
@param entry A custom debug message.
Expand Down
6 changes: 6 additions & 0 deletions taskvine/src/manager/vine_runtime_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,9 @@ void vine_set_runtime_info_path(const char *path)
assert(path);
vine_runtime_info_path = xxstrdup(path);
}

void vine_set_runtime_info_dir(const char *dir)
{
assert(dir);
setenv("VINE_RUNTIME_INFO_DIR", dir, 1);
}
Loading