hackoregon / civic-devops

Master collection point for issues, procedures, and code to manage the HackOregon Civic platform
MIT License
11 stars 4 forks source link

Clarify S3 asset storage instructions for project and platform production resources #219

Open jaronheard opened 6 years ago

jaronheard commented 6 years ago

Appreciate the instructions for how to upload small files to S3, they are very helpful!

I have a few questions and clarifications about getting files into S3 for assets that are destined to be incorporated into civicplatform.org or cards on civicplatform.org.

I have two real examples that I think illustrate two types of storage patterns that we need:

  1. Project specific assets: I have SVGs of infographics that will be used in a card for the 2018-disaster-resilience project. Maybe these should just be incorporated into the civic repo, since they are not especially large. If this is the case, maybe all that is needed is a clarification in the instructions.

  2. Platform specific assets: I have headshot images of team members that will live on the civicplatform.org main page. Where should these assets be stored? Again, the civic repo is an option.

https://github.com/hackoregon/civic-devops/blob/master/docs/HOWTO-upload-small-files-to-S3.md

MikeTheCanuck commented 6 years ago

Hey Jaron, good questions. This strikes me as having significant overlap with the problems raised in #206, for which the hacko-cdn bucket was created as a quick-and-dirty starter kit for uploading static assets like these.

I imagine that someday in the grand future we'll look to invest in a real-life CDN - and any static assets that would live in a caching layer would need to be decoupled from the applications that rely on those assets. Figuring that we might as well take one incremental step in that direction, I'd stuck with S3 as the cheap storage mechanism for what we'd had in three of the 2017 apps (emergency response, housing and homelessness) and had needed for the 2018 housing affordability app.

I'm not married to it, but at our scale and traffic levels it's far cheaper than the full-blown CDN offerings from Amazon, and seems not-unreasonably-unsuitable to the task.

We could spawn additional folders in that bucket for each of the examples you've named, if that seems like a reasonable approach for now.

What do you think?

jaronheard commented 6 years ago

Hey Mike, thanks for the response!

I'll go ahead and make folders within the hacko-cdn bucket for now for the assets that I mentioned. If you think that's a good medium-term solution, I can also make a PR for updates to the instructions.