-
Notifications
You must be signed in to change notification settings - Fork 31
Allow setting the default source for public resources with an environment variable #435
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
Conversation
7be7634
to
ad35a8a
Compare
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.
Looks good, thank you so much for adding, just a small note, and question. Is there somewhere that we should specify that GNOMAD_DEFAULT_PUBLIC_RESOURCE_SOURCE
can now be used like in https://github.com/broadinstitute/gnomad_methods/blob/8bffc35b8101a6095276331f7a1fa9edcec4e86f/docs/resource_sources.rst?
try: | ||
default_source = GnomadPublicResourceSource(default_source_from_env) | ||
return default_source | ||
except ValueError: |
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.
Should we throw a warning that the environment variable defines a source that is not one of those in GnomadPublicResourceSource
?
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.
I debated about this. Users can provide their own source, such as gs://my-bucket/gnomad-resources
, so this is (potentially) valid. I'll add some logging here.
Co-authored-by: jkgoodrich <[email protected]>
Good point. I'll add some docs. |
ba8db66
to
22fcba8
Compare
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.
LGTM! Thanks for the doc/logger additions!
Some users may always prefer to use the AWS or Azure copies of gnomAD resources. This allows them to set a default source in an environment variable instead of having to configure it in every pipeline.
Once hail-is/hail#11230 is merged,
get_default_public_resource_source
can be extended to use Hail's guess for the current cloud provider to set the default resource source.Related to #433