-
Notifications
You must be signed in to change notification settings - Fork 20
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
Implement ROOT_DIR for GCR #416
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoanneBogart a few suggestions for you to consider --- I realize that some suggestions might become irrelevant or needs updates as you develop further.
@JoanneBogart @yymao I'd like to try this out in a docker container - is now a good time? If I were to do that - can you provide a brief set of instructions to do such an install with the new ROOT_DIR? |
@heather999 I don't think there is anything special you need to do. I tried running the bit of code which determines site from within a shifter image and it worked; everything else follows from that. |
test_reader_modules.py is now failing for the "right" reason: site is not found and my additional test configs require it since they have relative paths. |
…der_modules to use public routine rather than back-door to set root dir
@yymao How do you feel about requiring some string (like ${ROOT_DIR}) when root dir is supposed to be prepended? Earlier I believe you said it wasn't necessary and I thought the same, but now I'm not so sure. The advantage is that it would allow people to use a relative path during development without interfering with access to production catalogs. I can imagine this would be useful for someone developing a composite catalog or developing a new catalog of any sort for an application which also needs access to production catalogs in the usual place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving some inline suggestions here. I'll add a few high-level comments in a bit.
@JoanneBogart thanks for the comments/revision. Here's some general thoughts:
Let's review a few use cases:
|
Concerning your general comments above:
My thinking is that _ROOT_DIR is the responsibility of register.py. If it doesn't have a sensible value and there is an attempt to use it (where here "use it" means directly or indirectly invoking I agree that using a string that looks like a shell environment variable is not a good idea because it's subject to misinterpretation. I need to come up with a better alternative. But I do think the concept is valuable so that a) the paths in config files mean what they appear to mean (relative path is always relative to current directory) and b) users can refer to catalogs which are stable and in production as well as those under development in the same process without having to resort to absolute paths for the development ones. You suggested a way to handle this with |
Again, my fundamental request is that As for supporting relative paths, I feel like we are creating imaginary use cases here. I am not sure we've ever encountered such a need. And if it we do, I think it is rare enough that it is not unreasonable to ask them to specify absolute path during development stage. If you think it is important that we must support such use case, that's fine by me, and my request would be not to use a syntax that is suggestive that users can do more than that can (which I feel it's really difficult to avoid). |
I think it will be less confusing if something that looks like a relative path has its usual meaning (as it has up till now): relative to current directory.
|
That's fine. I feel "relative to current directory" use case would be much more rare than the "relative to rootdir" use case? How about using "./" for the former? i.e.,
|
I agree that relative-to-rootdir is going to be much more common than relative-to-current-dir, but I think clarity is more important than saving people typing an extra character. At the command line |
It's ok. But I think it'll hard to guess what I anticipate this is going to cause some confusion (in fact, any of these proposals will) but I don't have better idea so go ahead. |
Yes, it is by no means obvious! The best we can hope for is to not be misleading. We need to document it clearly and extensively. When I change all the existing config files I can add a comment at the top of each explaining. Perhaps we can also add one or more example files either in the catalog_configs directory or somewhere else in the repo. |
…d and not defined
@heather999 The code in branch u/jrbogart/root_dir is getting close to final. Before it can be used as intended we need a directory to act as the root dir for catalogs which will probably mostly contain sym links to wherever each catalog actually is. Where should this directory be? Once this is determined I can make the sym links and update config files (still on the branch until we're sure it's working). |
Copy the site_config directory into the miniconda directory tree
Update setup.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @JoanneBogart -- I have made some minor comments/suggestions.
This work-around is no longer necessary Co-Authored-By: Yao-Yuan Mao <yymao.astro@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments @JoanneBogart. I'm approving now.
Have you tried running pytest
on nersc? This will include a full test suite that tries to load each of the catalogs. It takes a few hours to run though.
Thanks for the tip - I've started up pytest. If the run looks ok I will go ahead and merge. |
Meant to fix #346