Background
I've recently become acquainted with Pivotal Web Services (PWS) - or more specifically, Pivotal Cloud Foundry (PCF). I've racked up quite a monthly bill running a few apps on Heroku with SSL. It's been worth it - its JTBD is DevOps - and I'm willing to pay for it. Pivotal Web Services is a hosted version of the open source Cloud Foundry platform, and is provides similar PaaS functionality.
This post documents some of the resources I read getting a Rails and Ember application running with PostGIS, in the cloud.
Learning the Ropes
PCF has a command line tool, cf
, which is similar to Heroku's heroku
. cf push
pushes the current working folder to a location that is specified in a manifest.yml
file.
Gotchas
Heroku's buildpack outlines a few things, including a postInstall script in package.json that calls /bin/heroku_install. Turns out, Heroku doesn't really require it, but PCF did.
I also ran into an issue around Heroku's Multi Buildpack and discovered while it currently does work in PCF, a change has been made that has yet to be deployed, and the change will break the Multi Buildpack that I'm currently using. A workaround for my very-specific ember-cli-rails
issue is TBD.
References
Pivotal Cloud Foundry (PCF)
- https://run.pivotal.io
- Overview - http://docs.run.pivotal.io/concepts/architecture/
- https://docs.pivotal.io/pivotalcf/buildpacks/ruby/sample-ror.html
- http://blog.altoros.com/creating-a-custom-cloud-foundry-buildpack-from-scratch-whats-under-the-hood.html
- http://www.activestate.com/blog/2014/09/cloud-foundry-diego-explained-onsi-fakhouri
- https://github.com/cloudfoundry-incubator/diego-design-notes
- https://github.com/cloudfoundry-incubator/diego-release
- http://docs.pivotal.io/archives/pcf-docs-1.4.pdf
- Blue-green Deploys - https://docs.cloudfoundry.org/devguide/deploy-apps/blue-green.html
- https://docs.pivotal.io/pivotalcf/buildpacks/ruby/rake-config.html (for migrations in PCF)
- Buildpack Testing Framework - https://github.com/cloudfoundry/machete
- Node.js Buildpack https://github.com/cloudfoundry/nodejs-buildpack
- Ruby Buildpack https://github.com/cloudfoundry/ruby-buildpack
- When bumping into the error:
Copying into the container failed
- https://support.run.pivotal.io/entries/105844873-Migrating-Applications-from-DEAs-to-Diego - pass a-k
tocf push
, likecf push -k
- https://github.com/Pivotal-Field-Engineering/PCF-Workshop-101/blob/master/labs/lab1/lab-node.adoc
- Scheduled Jobs with Clockwork - http://blog.anynines.com/how-to-schedule-background-jobs-using-the-clockwork-gem/
Spring, a Java development framework
- https://projects.spring.io/spring-framework/#quick-start
- https://spring.io/guides
- http://spring.io/blog/2014/11/20/screencast-how-to-create-a-restful-app-in-five-minutes-or-less
Notes
When deploying a worker, make sure manifest.yml has:
no-route: true
and set-health-check: none
Note: Disable Health Check for a Worker Application
cf set-health-check app-name none