Closed jandudulski closed 10 years ago
I. Codebase - One codebase tracked in revision control, many deploys
git, done
II. Dependencies - Explicitly declare and isolate dependencies
Gemfile + rails-assets, done
III. Config - Store config in the environment
Figaro, dotenv, hsr config, done
IV. Backing Services - Treat backing services as attached resources
Her, Faraday, Drivers/Adapters, any questions here?
V. Build, release, run - Strictly separate build and run stages
we do not build, only release, one click/command in most cases
VI. Processes - Execute the app as one or more stateless processes
Procfile, hsr ps, you name it, done
VII. Port binding - Export services via port binding
hsr - done
VIII. Concurrency - Scale out via the process model
hsr scale (but puma/jruby/sidekiq -> threading is also good)
IX. Disposability - Maximize robustness with fast startup and graceful shutdown
fast startup -> derailed!, graceful - sidekiq retry
X. Dev/prod parity - Keep development, staging, and production as similar as possible
Not gonna happen until docker for osx is fully operational, for now it's *NIX - not bad
XI. Logs - Treat logs as event streams
hsr logs, gem 'rails_12factor' redirects logs to stdout - done
XII. Admin processes - Run admin/management tasks as one-off processes
hsr run, done
Sure, we follow these rules, but I think it's not a bad idea to have close at hand well described reasons behind :) - for us, for newcomers or whatever.
Make PR plz :)
Here is PaaS, based on those principles:
http://docs.deis.io/en/latest/
On Wed, Jan 15, 2014 at 9:11 PM, Jan Dudulski notifications@github.comwrote:
I think that 12 factor http://12factor.net/ are solid, well described rules which we can recommend to follow in our guidelines. They describes 12 aspects how apps should be developed, run and maintained during development.
— Reply to this email directly or view it on GitHubhttps://github.com/monterail/guidelines/issues/190 .
Another aspect of config management is grouping. Sometimes apps batch config into named groups (often called “environments”) named after specific deploys, such as the development, test, and production environments in Rails.
This method does not scale cleanly: as more deploys of the app are created, new environment names are necessary, such as staging or qa. As the project grows further, developers may add their own special environments like joes-staging, resulting in a combinatorial explosion of config which makes managing deploys of the app very brittle.
We could take this guideline to the heart, and do not use environments like staging (just dev, test, and production).
There is problem that staging is somewhat mixed development and production. You wish that everything works just like in prod to test it, but you also do not want production keys for things like s3 for upload or payments.
That's what configuration is for
RAILS_ENV=staging is mostly for convenience to distinguish it from production (e.g. in tools like sentry)
(btw, nowdays most PaaSes are 12-factor.)
btw @jandudulski, prprprprprprprprprpr!
I was waiting for moar input ;)
I think the only way to add this to guidelines is to describe each factor having in mind Rails..
This is far too general.
There is also difference between applying 12factor to rails app and to infrastructure. I think we should stick to rails app side here.
Yeah, @teamon explanations are weird mix of infrastructure and application customs
I see here codetunes article
Anyone interested in this one? I personally think mentioning rails 12 factor in guidelines is enough.
PR added
@jandudulski diff is kinda weird...
removed trailing spaces, sorry ;]
I think that 12 factor are solid, well described rules which we can recommend to follow in our guidelines. They describes 12 aspects how apps should be developed, run and maintained during development.