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

Support building on S3 vs just publishing #95

Closed
sheats opened this issue Mar 1, 2017 · 4 comments
Closed

Support building on S3 vs just publishing #95

sheats opened this issue Mar 1, 2017 · 4 comments

Comments

@sheats
Copy link
Contributor

sheats commented Mar 1, 2017

Is there any reason why django bakery shouldn't support building on S3 as well as publishing? I was trying to deploy this on a serverless architecture using https://github.com/Miserlou/Zappa but hit a snag when I realized that building required a local file system.

I'm thinking about adding support for this but wanted to get input first. My idea was to have settings specify a build bucket and a publish bucket and then update all code that writes to the file system to write to a S3 bucket.

As far as code design seems like you'd then want some sort of file system backend to be able to do this. Was thinking about trying to use django storages but that might be a little too much plus it introduces another dependency.

@palewire
Copy link
Owner

palewire commented Mar 1, 2017

I have never considered this model.

The standard assumption is that a newbie developer will build locally and push to s3, a use case that can handle most one-off and simple sites.

Our more complex deployment scheme at the LA Times Data Desk handles this by having the TravisCI buildbot do the building and S3 syncing. A GitHub hook triggers the job there. Travis pulls the repo, builds the pages, and syncs the HTML with S3.

If you've got another model in mind, I'm of course open to it.

@sheats
Copy link
Contributor Author

sheats commented Mar 1, 2017

Well the model in mind was that the production code would only be served in AWS lambda functions and the production database would only be accessible inside the AWS environment. Lambda functions don't really have filesystems that can be used for writing hence the need to allow them to write to S3. The reason to host the site publicly would be to allow multiple people to create content through the admin.

I don't really want to run additional servers or processes but I guess I could spin up a docker container or allow my local machine (or build server) to access the DB to build and publish. The challenge with that approach then is being able to react to realtime changes with celery tasks.

@palewire
Copy link
Owner

palewire commented Mar 1, 2017

I'm totally open to expanding the library to better support Lambda. I just don't have the personal expertise with that platform to have a clear idea of how to approach it.

@sheats
Copy link
Contributor Author

sheats commented Mar 2, 2017

OK, good to know. I'm probably going to start with another route like just building somewhere else but if I feel inspired I'll put something together for building on S3 and let you know.

@sheats sheats closed this as completed Mar 2, 2017
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