Skip to content

Add s3 provider#1009

Open
dolfandringa wants to merge 4 commits intojupyter:mainfrom
dolfandringa:add_s3_provider
Open

Add s3 provider#1009
dolfandringa wants to merge 4 commits intojupyter:mainfrom
dolfandringa:add_s3_provider

Conversation

@dolfandringa
Copy link
Copy Markdown

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
Copy Markdown
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