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

Detailed discussion and complete code for "Discover shared projects" #4153

Closed
wants to merge 6 commits into from

Conversation

harshit-soora
Copy link
Contributor

Related to Issue #4120

Added support for env variable "VENDOR_SHARED_FILESYSTEM" to allow users to set up shared path in case those are different from /fs/scratch and /fs/project

During brute force looking for project we just need to check if there exists a .ondemand folder in any project path, if so, then it is an OOD project
<shared_projects_paths>/<group_id>/<brute force all child folders>/.ondemand

@harshit-soora
Copy link
Contributor Author

harshit-soora commented Feb 16, 2025

One issue I have seen is
In UMD, our shared path looks like /scratch/zt1/project/sussman-lab/user/hsoora

So,
VENDOR_SHARED_FILESYSTEM = /scratch/zt1/project
group_id = sussman-lab

But, CurrentUser.group_names returns zt-sussman-lab instead of sussman-lab. This seems to be some conventions that we have at UMD. But my question is how to handle these?

Comment on lines 13 to 19
vendor_path = ENV['VENDOR_SHARED_FILESYSTEM'] || ''
[
Pathname.new('/fs/projects'),
Pathname.new('/fs/scratch'),
Pathname.new(vendor_path)
]
end
Copy link
Contributor

Choose a reason for hiding this comment

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

This should come from the configuration_singleton.rb and likely shouldn't have hard coded paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, will update

Project.new({ id: id, directory: directory })
end

shared_projects_paths.each do |path|
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should be searching this all the time. Maybe we need a new view to import projects where we can trigger a search and potentially add an item to their own lookup file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you suggest

  1. Using Rails.application.config.after_initialize function at dashboard/config/initializer and search for all path and save to .project_lookup or may be .shared_project_lookup. So will happpen everytime a user logs into dashboard (but may not end up using projects)

  2. Create a _helper.rb, which will be called from project_controller.rb:index() and update the .project_lookup. So if a user route to project index then we add new entries to lookup file. To track single time edit we can keep a class variable. {also will have to track if any project already exists in the lookup}

  3. Any better and easier suggestion

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.

I think the workflow is more like

  • the pages load all projects that you've imported into your lookup table
  • we add a new page to import projects
    • on this new page, that's when we search the shared projects paths
    • We generate this list of possible projects to import and the user imports one
    • This shared project is then added to their lookup table so they don't have to search for it anymore

I guess my point is we shouldn't be searching these paths all the time. Instead we make a page specific to importing shared projects and when the user "imports" the project, that adds it to the lookup so we don't have to search for it again.

@johrstrom
Copy link
Contributor

Can you separate this functionality? I mean make 1 pull request for the the search path functionality, then another to actually use it in a page?

@harshit-soora
Copy link
Contributor Author

I am closing this PR, right now it have all the code, I will split it into 3 separate PRs

  1. To create a form to import a project path, internally it will do nothing
  2. Next to use the import directory from the form and save it to .lookup_file
  3. Show paths which are shared with you inside of form, earlier it will be just empty text box, now will provide a drop down menu

@harshit-soora harshit-soora changed the title Added brute force lookup into shared_projects_paths to look for potential shared projects Detailed discussion and complete code for "Discover shared projects" Feb 21, 2025
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.

3 participants