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 s3 provider #1009

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

dolfandringa
Copy link

This addresses #630 . It allows downloading notebooks from s3 buckets through the S3 uri (s3://bucket/path/to/key). If the file/bucket is public, this should work straight away. But if it is a private bucket, it can be configured by setting the appropriate environmental variables in the docker container or providing the Shared credentials file to the same user running NBViewer.

I attempted to write a test too, but since the test server is started with subprocess.POpen we can't mock boto3. So that test has been commented for now. If there is a way to start the server without using subprocess, that would allow mocking, I could uncomment (and expand) that test.

"Content-Disposition",
"attachment; filename={};".format(filename.replace(",", "_")),
)
if self._downloaded_path == path and self._downloadable_data is not None:
Copy link
Author

Choose a reason for hiding this comment

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

I wanted to prevent re-fetching the file from s3. Maybe there is a beter way to cache the boto3 s3 transfer using memcached somehow. Any suggestions are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant