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

Add a Globus button to make transfers easier #2858

Merged
merged 5 commits into from
Jul 5, 2023
Merged

Add a Globus button to make transfers easier #2858

merged 5 commits into from
Jul 5, 2023

Conversation

DavidKelly-Praedictus
Copy link
Contributor

Preliminary integration between Open OnDemand and Globus Transfer. When an OOD admin defines 'globus_endpoints' in their config, a Globus button will appear in the user interface. When clicked, this button will open a link to the Globus transfer web app using the correct transfer endpoint and directory info.

I will be submitting the documentation shortly, but briefly the easiest way to configure this is to add a globus_endpoints parameter to ondemand.d that looks like this:

For a single Globus endpoint

  globus_endpoints:
    "/": "716de4ac-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

For multiple endpoints at different locations

  globus_endpoints:
    "/home": "716de4ac-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    "/project": "8c33758b-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

…en an OOD admin defines 'globus_endpoints' in their config, a Globus button will appear in the user interface. When clicked, this button will open a link to the Globus transfer web app using the correct transfer endpoint and directory info
@johrstrom
Copy link
Contributor

The e2e tests a broken for a bit while we work on new packaging in 3.1.

That said - unit tests seem to be failing because there are not updates to apps/dashboard/config/configuration_singleton.rb.

…he endpoint paths are not a one-to-one match with the filesystem
@DavidKelly-Praedictus
Copy link
Contributor Author

Made the changes related to situations where endpoint paths do not match filesystem paths. The updated globus_endpoints parameter should now look something like this:

globus_endpoints:

  - path: "/home"
    endpoint: "716de4ac-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    endpoint_path: "/home"

  - path: "/project"
    endpoint: "9f1fe759-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    endpoint_path: "/"

I removed the css I added and used a link instead of a button. The only other change I had make was to set the title/tooltips on a span around the link so that it would still appear when the link was disabled.

@johrstrom
Copy link
Contributor

Thank you for the update (and the documentation!). I'll take a look at this shortly.

@johrstrom johrstrom closed this Jun 5, 2023
@johrstrom johrstrom reopened this Jun 5, 2023
@johrstrom johrstrom closed this Jun 8, 2023
@johrstrom johrstrom reopened this Jun 8, 2023
@johrstrom johrstrom closed this Jun 14, 2023
@johrstrom johrstrom reopened this Jun 14, 2023
@johrstrom
Copy link
Contributor

Sorry for the delay - there are more coming as this week (and last 2) I've been buried with OSC work. Then next week I'm on vacation

Made the changes related to situations where endpoint paths do not match filesystem paths.

I still don't believe this is correct, at least for your HOME directories.

I got this configuration to work for me (my user johrstrom), but that would only work for me. OSC could not deploy this configuration globally because path is my own $HOME directory so it would not match others.

globus_endpoints:
  - path: "/users/PZS0714/johrstrom"
    endpoint: "06758ab7-9cb0-4f90-b79f-098b41e90dcd"
    endpoint_path: "/"

If I use this, the globus url has origin_path=/PZS0714/johrstrom which is incorrect.

globus_endpoints:
  - path: "/users"
    endpoint: "06758ab7-9cb0-4f90-b79f-098b41e90dcd"
    endpoint_path: "/"

I still need to look into Project or Scratch filesystems (outside of HOME), but I suspsect we need to treat HOME directories as a special case.

@DavidKelly-Praedictus
Copy link
Contributor Author

DavidKelly-Praedictus commented Jun 20, 2023

Hi Jeff,

For that type of setup, I think you can do something like this:

globus_endpoints:
  - path: "/users/PZS0714/<%= CurrentUser.name %>"
    endpoint: "06758ab7-9cb0-4f90-b79f-098b41e90dcd"
    endpoint_path: "/"

@DavidKelly-Praedictus
Copy link
Contributor Author

DavidKelly-Praedictus commented Jun 20, 2023

Or, alternatively:

globus_endpoints:
  - path: "<%= CurrentUser.home %>"
    endpoint: "06758ab7-9cb0-4f90-b79f-098b41e90dcd"
    endpoint_path: "/"

@johrstrom
Copy link
Contributor

Yea I thought the same after I left that comment. Would like to avoid ERB if we can (most folks just don't know it), but that seems like our best bet at the moment.

@DavidKelly-Praedictus
Copy link
Contributor Author

I added an example of how to use this in the docs (OSC/ood-documentation#819)

Copy link
Contributor

@johrstrom johrstrom left a comment

Choose a reason for hiding this comment

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

Thanks and sorry for the delay. You may see another PR from me to fix this up just slightly and another issue to refactor that inline javascript. It's fine for now, we don't need to get to it immediately, but we would like to stop inlining javascipt in <script> tags.

@johrstrom johrstrom merged commit 5d8419b into OSC:master Jul 5, 2023
45 of 51 checks passed
@johrstrom
Copy link
Contributor

I see your reactions here, so I'll add another note here or we can open another ticket. One thing that I'm still not super keen on is having to use ERB for the HOME directory. I think I'll open a ticket to explore what other possibilities there could be to make configuration simpler.

johrstrom added a commit to OSC/ood-documentation that referenced this pull request Jul 13, 2023
* Add reference documentation for the globus_endpoints parameter, to enable the Globus button (OSC/ondemand#2858)

* Updated with new format of globus_endpoints property

* Add an example using the home directory of the current user

* use etc instead of currentuser

 Etc.getpwnam(Etc.getlogin).dir is safer to use than currentuser at the moment.

---------

Co-authored-by: David Kelly <davidkelly@uchicago.edu>
Co-authored-by: Jeff Ohrstrom <johrstrom@osc.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants