Wikia/vignette — pull request #10 by drsnyder (2014-08-15 18:26:15+00:00)
Title: Add s3 client and wire it in

This is a WIP. I want to get feedback on the design choices before proceeding.

By adding this capability we also need to consider the architectural / request flow implementations. Because originals (and thus thumbnails) can change if revisions change, I think we should treat thumbnails as ephemeral or subject to change at any moment since they are derivative. Similarly, I don't think we should cache originals anywhere locally on the thumbnailer. This means that for each request we need to:

1. Get the original
2. Thumbnail it
3. Delete the original (at some point soon-ish)
4. Return the thumbnail back to the client
5. Delete the thumbnail (at some point later)

This will ensure that if at any time an original changes the request for the originals and thus the thumbnails will be accurate assuming that varnish/fastly is also being purged when a thumbnail changes.

The implication is that each thumbnail operation is more expensive from a network and time perspective. I don't expect this to be an issue unless there is an upstream issue with varnish/fastly caching. It will happen but I don't think we should build for that case though we should be able to handle it.

It also means that we don't need to periodically clean up thumbnails on CEPH with the new thumbnailer.

/cc @nmonterroso @ljagiello @Wikia/platform-team

Todo:
* [ ] fix the s3 tests
* [ ] confirm that this works with the local storage interface
* [ ] add a thumbnail clean up background task. Consider using [`at-at`](https://github.com/overtone/at-at). Should we also use this for cleaning up originals?
* [ ] replace `throw` with [`throw+`](https://github.com/scgilardi/slingshot)