-
Notifications
You must be signed in to change notification settings - Fork 7.1k
resolve redirection for HTTP resources #5151
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
💊 CI failures summary and remediationsAs of commit d573acc (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
Job | Step | Action |
---|---|---|
curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh | ||
sh conda.sh -b | ||
source $HOME/miniconda3/bin/activate | ||
conda install -yq conda-build cmake | ||
packaging/build_cmake.sh | ||
🔁 rerun |
This comment was automatically generated by Dr. CI (expand for details).
Please report bugs/suggestions to the (internal) Dr. CI Users group.
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 @pmeier ,
I mostly have questions but I'll approve to unlock. For my own understanding, did we face cases in the past where not handling redirections was a problem?
gdrive_id = _get_google_drive_file_id(redirect_url) | ||
if gdrive_id: | ||
return GDriveResource(gdrive_id, **meta) |
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.
Do we have current cases where an HTTP resource redirects to a Google drive?
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.
Yes. It is one of the datasets not yet ported to prototype. I've also hit this while doing #5154.
|
||
def _download(self, root: pathlib.Path) -> None: | ||
if not self.resolved: | ||
return cast(OnlineResource, self.resolve())._download(root) | ||
|
||
for url in itertools.chain((self.url,), self.mirrors or ()): | ||
try: | ||
download_url(url, str(root), filename=self.file_name, md5=None) |
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.
In your first comment you wrote
This is far from perfect, since the mirrors do not get resolved
Could we instead do the redirection here and handle the mirrors?
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.
We could, but that would make stuff more complicated. Given that the plan is to refactor this anyway with iopath
and we currently only have a single datasets that has official mirrors, I wouldn't sweat it at the moment.
Summary: * resolve redirection for HTTP resources * appease mypy * address review Reviewed By: kazhang Differential Revision: D33927505 fbshipit-source-id: a6b39b2809fd63419620523f6b84a60e91147818
This is far from perfect, since the
mirrors
do not get resolved. So far we never hit an issue where this would be a problem, but still.In the future, the plan is to switch the resources to
iopath
. If that is available, resolving will no longer generate a new resource, but rather change the underlying path in place.cc @pmeier @bjuncek