-
Notifications
You must be signed in to change notification settings - Fork 47
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
Shell Function: run_dir #1646
Comments
Hi @RINO-GAELICO, thanks for taking this time to write up this issue. This was one of the options in consideration while
ShellFunction("mkdir -p {rundir}; cd {rundir}; ...", rundir=/path/to/run/dir) Let me know what you think. If we get more folks asking for similar functionality, we are definitely open to supporting it. |
Hi @yadudoc thanks for your reply. Regarding your points:
|
Hi @RINO-GAELICO,
>>> from globus_compute_sdk import Executor, ShellFunction
>>> ex = Executor(endpoint_id="a1e677f9-c08a-4b70-8b70-4a51b13128cd") # This is my local EP, please update before testing
>>> future = ex.submit(ShellFunction("pwd; cd {run_dir}; pwd"), run_dir="/tmp")
>>> future.result().stdout
'/Users/yadu/.globus_compute/prod/tasks_working_dir\n/tmp\n'
>>> print(future.result().stdout)
/Users/yadu/.globus_compute/prod/tasks_working_dir
/tmp Thanks again for your care in evaluating these options. |
Also, in a multi-user endpoint context, |
In relation to the new feature of Shell Function , it might be useful to add an additional argument for the user to specify the run_dir. Right now it uses a sandbox or the working task dir.
Describe the solution you'd like
A possible solution could be to pass the run_dir as one the optional arguments in the Shell constructor. Then checking if the run_dir is
not None
and let the user choice take priority over sandboxing.run_dir = self.run_dir
The text was updated successfully, but these errors were encountered: