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

Implement S3 storage. #4

Open
DinoBektesevic opened this issue Apr 5, 2021 · 3 comments
Open

Implement S3 storage. #4

DinoBektesevic opened this issue Apr 5, 2021 · 3 comments

Comments

@DinoBektesevic
Copy link
Member

Abandon the "static" storage workarounds we have now in favor of hosting data on S3.

Can this be made to load from the browser-side and not go through server-side or will we have to give too many access privileges to our buckets/objects?

@spenczar
Copy link
Collaborator

spenczar commented Apr 6, 2021

I would recommend against this, and for using WhiteNoise instead. See http://whitenoise.evans.io/en/stable/#shouldn-t-i-be-pushing-my-static-files-to-s3-using-something-like-django-storages.

@DinoBektesevic
Copy link
Member Author

Oh sorry, this is my mistake because I did a drive by and opened a bunch of issues today. I should have been clearer when explaining them.

As it stands, for faster turnaround I store all uploaded fits files to static/upload/fits. This is a no-no.
I store the thumbnails into media dir. This can pass.

Fits files need to be stored in S3, otherwise we will soon-ish (hopefully) be renting some very large drives to keep up with demand. This is why static is in quotation marks. These aren't your classic files, these files shouldn't be in "static".
It helpful when debugging because you can see them from the browser and that's essentially why they are there now.

I was considering moving thumbnails to S3, but given your link - perhaps we shouldn't?
Do you think it's smarter to leave them in media? They are about 4 times smaller than the original image, with some leeway to make them even smaller, but they could grow to be sizable in the long term. It would be a fixable problem though...

@spenczar
Copy link
Collaborator

spenczar commented Apr 6, 2021

Ah, got it! Yeah, static is not the right place, as you say.

I don't think anything user-provided belongs in static, yeah. You probably want to just store them with FileFields. Django has a lot of good stuff for managing uploaded files, see https://docs.djangoproject.com/en/3.2/topics/files.

I think media is probably fine, even for large files.

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

No branches or pull requests

2 participants