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

Support for setting working_dir and sandboxing in GlobusComputeEngine #1543

Merged
merged 1 commit into from
May 30, 2024

Conversation

yadudoc
Copy link
Collaborator

@yadudoc yadudoc commented Apr 23, 2024

Description

This PR fixes the issue where the endpoints using GCE would have functions run in the directory from which the endpoint was started rather than some well-defined location. This PR adds support for setting a working_dir option to
configure function's working directory and for functions that create files a new sandboxing feature is added. Setting run_in_sandbox: True each function executes in a sandbox directory set to function_uuid as the name.

Here's a config example:

    display_name: WorkingDirExample
    engine:
      type: GlobusComputeEngine
      # Set working dir to /projects/MY_PROJ
      working_dir: /projects/MY_PROJ
      # Enable sandboxing to have functions run under /projects/MY_PROJ/<function_uuid>/
      run_in_sandbox: True

[sc-32391]

Type of change

Choose which options apply, and delete the ones which do not apply.

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)

Copy link
Contributor

@khk-globus khk-globus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly there, with a request to address the inline comment around test cleanup.

compute_endpoint/tests/unit/test_working_dir.py Outdated Show resolved Hide resolved
@yadudoc yadudoc force-pushed the gce_working_dir branch 2 times, most recently from 071a772 to bf3fd11 Compare May 22, 2024 20:05
@yadudoc
Copy link
Collaborator Author

yadudoc commented May 29, 2024

@khk-globus Recommend adding a test on the endpoint interchange to confirm that the run_dir is set appropriately.

@yadudoc
Copy link
Collaborator Author

yadudoc commented May 30, 2024

[sc-32391]

* Functions run in `GCE.working_dir` if specified.

* If `GCE.working_dir` is not specified or set to None, functions default to
  running in the endpoint_dir which defaults to
  `~/.globus_compute/<endpoint_name>`

* If `GCE.run_in_sandbox` is enabled, functions run in
  `working_dir/<task_uuid>`. This option is disabled by default.

* Specify this option via config.yaml like:

    ```yaml
    .. code-block:: yaml
       engine:
          type: GlobusComputeEngine
          working_dir: /tmp/foo
          run_in_sandbox: True
    ```

[sc-32391]
@khk-globus khk-globus merged commit 6de719c into main May 30, 2024
23 checks passed
@khk-globus khk-globus deleted the gce_working_dir branch May 30, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants