#6390 closed (wontfix)
File storage backend for Amazon S3
Reported by: | Marty Alchin | Owned by: | David Larlet |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | fs-rf-docs | |
Cc: | cmawebsite@…, larlet@…, prufrocks@…, sebastian.serrano@… | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | UI/UX: |
Description
Based on the work in #5361, this ticket offers a storage backend for Amazon's Simple Storage Service.
Attachments (3)
Change History (30)
Changed 15 years ago by
comment:1 Changed 15 years ago by
Needs documentation: | set |
---|---|
Needs tests: | set |
Patch needs improvement: | set |
This first draft was started using Amazon's own library, but during the last sprint, I started to migrate it to boto, per Jacob's recommendation. As such, it's a bit between the two, and doesn't provide everything it needs anyway. I'm putting it up now to allow other people to flesh it out and make it work.
comment:2 Changed 15 years ago by
Cc: | cmawebsite@… added |
---|
comment:3 Changed 15 years ago by
Triage Stage: | Unreviewed → Design decision needed |
---|
Do we want this in trunk?
comment:4 Changed 15 years ago by
I feel that something like an s3 backend should not be in trunk. I think it stifles competition. I would rather the framework provide the hooks and let the plugable backends be provide by the community.
comment:5 Changed 15 years ago by
Cc: | larlet@… added |
---|
comment:6 Changed 15 years ago by
After having compared Amazon's S3 library and boto's S3 module I have to say that neither of them is really great. Amazon can't stream, but unlike boto it supports EU buckets and virtual hosts. Also, boto has a lot of redundant code and adding EU bucket support (in a clean way) would require quite a few refactorings.
Do you want the backend to make the browser upload via PUSH, so files don't have to be routed through the server (which would consume a lot of resources)? In that case, Amazon's library wins because boto's streaming support wouldn't be used. The best solution would of course be to merge boto with Amazon's library.
comment:7 Changed 15 years ago by
After trying both libs too, I give up with boto because it looks really messy. The uploaded version requires only Amazon's S3 library. This is just a functional example from the broken first draft of Gulopine.
I think it could be interesting to have it in trunk (batteries included?).
comment:8 Changed 15 years ago by
I've implemented two patches for boto: EU support (and vhosts, but haven't tested that) and an S3 code cleanup (though still not *perfect* :), but I don't know when they'll be committed. You can get them here:
http://freenet-homepage.de/wkornewald/eu-bucket.diff
http://freenet-homepage.de/wkornewald/simplified.diff
Or did you mean the API is messy? There are a few hacky places (e.g., set_key_class), but it doesn't look so bad to me.
BTW, why did you use CallingFormat.REGULAR instead of SUBDOMAIN?
comment:9 Changed 15 years ago by
Really interesting patches. I'll try to find the time to try at least the simplified one, yes I mean code cleanup by messy :).
I use REGULAR instead of SUBDOMAIN in order to be consistent with default arguments in S3.py but I always instantiate with CallingFormat.SUBDOMAIN for my own needs.
comment:10 Changed 15 years ago by
If you take a look at EU bucket support please reload my patch. It now passes all tests and has a nasty connection cache.
comment:11 Changed 15 years ago by
EU bucket support is now in boto trunk. Next, I'll send my simplification patch for review.
Changed 15 years ago by
Attachment: | S3_6390.20080225.py added |
---|
Functional S3 backend, use only Amazon's S3 lib (warning it overwrites filename)
comment:12 Changed 15 years ago by
Keywords: | fs-rf-docs added; fs-rf removed |
---|
comment:13 Changed 15 years ago by
Just a quick note to anybody working on this, or even just watching it. The most recent patch to #5361, which is likely to be applied to trunk soon, renames most of the things that this patch relies on, as well as how it must be instantiated. The docs in #5361 have been updated to reflect these new requirements, but the best reference will be looking at the django.core.filestorage.filesystem.FileSystemStorage
class.
Changed 15 years ago by
Attachment: | S3_6390.20080321.py added |
---|
New S3 storage which works with the latest storage patch (14) with new functions' names, I'm not totally satisfied with the way arguments are passed, I'll try to do it better
comment:14 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:15 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Opps, my bad. A bit of dyslexia ;) I meant #6930.
comment:17 Changed 15 years ago by
Owner: | changed from nobody to David Larlet |
---|---|
Status: | reopened → new |
That's a possible option. I already use boto for SQS so I plan to switch to a full boto Amazon access in a "near" future, let me know if you need it quickly.
comment:18 Changed 15 years ago by
Cc: | prufrocks@… added |
---|
comment:19 Changed 15 years ago by
milestone: | → 1.0 beta |
---|
comment:20 Changed 15 years ago by
Latest version of this patch is now hosted at http://code.larlet.fr/django-storages/
Do not hesitate to add your own storage if you want or contact me.
comment:21 Changed 15 years ago by
Cc: | sebastian.serrano@… added |
---|
comment:22 Changed 15 years ago by
I've put up a new patch on #5361 that pretty much destroys whatever patches are left on this ticket. Also, that patch makes it a bit less straightforward to include other backends in Django core, so this is more likely now to be closed as a wontfix. That's still awaiting official word, but that's how it looks at the moment.
comment:23 Changed 15 years ago by
As I previously said, I have no problem with that and that's why I set up an external repository (I know you know, my comment is just here for the "official" decision).
comment:25 Changed 15 years ago by
Bugs aren't the only things planned for 1.0 beta. This is being partially addressed as part of #5361, which is planned to make it into 1.0 beta. Even though it won't be included directly, these types of backends will be quite possible once that goes in. Per Jacob, all such related tickets should be placed in the 1.0 beta milestone.
comment:26 Changed 15 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I am of the opinion that this should be implemented outside of django core in some sort of Amazon library for Django. A quick search turns up django-aws and boto. Might be others. Once such a library matured, then we could maybe think about inclusion into django.contrib.
Broken first draft