{"action":"created","issue":{"url":"https://api.github.com/repos/progrium/buildstep/issues/109","labels_url":"https://api.github.com/repos/progrium/buildstep/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/progrium/buildstep/issues/109/comments","events_url":"https://api.github.com/repos/progrium/buildstep/issues/109/events","html_url":"https://github.com/progrium/buildstep/pull/109","id":44114580,"number":109,"title":"Modernize buildstep for cedar-14 stack and Heroku buildpack requirements","user":{"login":"yabawock","id":203423,"avatar_url":"https://avatars.githubusercontent.com/u/203423?v=3","gravatar_id":"","url":"https://api.github.com/users/yabawock","html_url":"https://github.com/yabawock","followers_url":"https://api.github.com/users/yabawock/followers","following_url":"https://api.github.com/users/yabawock/following{/other_user}","gists_url":"https://api.github.com/users/yabawock/gists{/gist_id}","starred_url":"https://api.github.com/users/yabawock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yabawock/subscriptions","organizations_url":"https://api.github.com/users/yabawock/orgs","repos_url":"https://api.github.com/users/yabawock/repos","events_url":"https://api.github.com/users/yabawock/events{/privacy}","received_events_url":"https://api.github.com/users/yabawock/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":46,"created_at":"2014-09-26T23:06:40Z","updated_at":"2015-01-06T20:07:41Z","closed_at":"2014-10-17T22:53:31Z","pull_request":{"url":"https://api.github.com/repos/progrium/buildstep/pulls/109","html_url":"https://github.com/progrium/buildstep/pull/109","diff_url":"https://github.com/progrium/buildstep/pull/109.diff","patch_url":"https://github.com/progrium/buildstep/pull/109.patch"},"body":"# Goal\r\n\r\nModernization of the builder architecture so that the build process more closely resembles the Heroku\r\nworkflow. This involves the following high level changes:\r\n \r\n  * ubuntu-deboostrap:14.04 base image for a smaller surface area to begin with.\r\n  * unmodified cedar-14 stack install script from Heroku. Ensures the installed packages match closely.\r\n  * integrate the flynn buildback installer. Removes code duplication and allows versioning installed buildpacks\r\n  * correctly identify the stack as cedar-14 so that the buildpacks know which binaries to install\r\n  * switch to Heroku buildpacks for Go and PHP\r\n  * Remove all preinstalled custom buildpacks. Lesser maintenance burden, fair for all custom buildpack authors\r\n\r\n# Actions\r\n\r\n## Removed packages\r\n    \r\nThe following packages are no longer be installed on build:\r\n  * `libjpeg62`, `libpng12-0`, `libpng12-dev`, `libreadline5`\r\n    By choosing the right binaries for the stack these packages are no longer required\r\n  * `libmagickcore-dev`, `postgresql-server-dev-9.3`\r\n    These packages are implicitly installed due to dependencies of other packages\r\n  * `nodejs`\r\n    The official heroku buildpacks install a node version if it is required\r\n  * `libssl0.9.8`\r\n    Superseded by libssl1.0.0\r\n  * `mercurial`\r\n    The official heroku buildpacks install mercurial as required\r\n  * `openjdk-7-jdk`, `openjdk-7-jre-headless`\r\n    Will be automatically installed by the java buildpack, otherwise the multi buildpack should be used\r\n  * `postgresql-client`, `mysql-client`\r\n    Open for discussion. In favor of an unmodified cedar-14 stack I removed them since the benefit of having them in the container is small with a database server that should be reachable from the admin workstation.\r\n  * `libsqlite3-dev`, `sqlite3`\r\n    SQLite is not available on cedar-14 and not really useful on ephemeral filesystems\r\n  * `libmcrypt-dev`\r\n    Removed in favor of an unmodified cedar-14 stack image. Could be installed by a custom buildpack if required.  \r\n\r\n## Removed custom buildpacks\r\n\r\nThe following custom buildpacks are no longer preinstalled in the buildstep image:\r\n\r\n  * Metorite - `https://github.com/oortcloud/heroku-buildpack-meteorite.git`\r\n  * Perl - `https://github.com/miyagawa/heroku-buildpack-perl.git`\r\n  * Dart - `https://github.com/igrigorik/heroku-buildpack-dart.git`\r\n  * NGINX - `https://github.com/rhy-jot/buildpack-nginx.git`\r\n  * Apache - `https://github.com/Kloadut/heroku-buildpack-static-apache.git`\r\n  * Jekyll - `https://github.com/bacongobbler/heroku-buildpack-jekyll.git`\r\n\r\n# Validation\r\n\r\nValidation of buildstep has been performed with all sample apps provided on the [Getting Started on Heroku](https://devcenter.heroku.com/start) website.\r\n\r\nThe following deploys worked without modification:\r\n\r\n  * Ruby - OK (Ruby 2.0.0, PostgreSQL)\r\n  * PHP - OK (PHP 5.5.11, Apache 2.4.10)\r\n  * node.js - OK (Node.JS 0.10.32)\r\n  * Python - OK (Python 2.7.8)\r\n  * Java - OK (OpenJDK 1.7, Jetty 7.6.0.v20120127)\r\n  * Clojure - OK (OpenJDK 1.6, Leinigen 2.4.2, Jetty 7.x.y-SNAPSHOT)\r\n  * Scala - OK (OpenJDK 1.7, SBT 0.13.5, Scala 2.10.4)\r\n  \r\n# Known Quirks\r\n\r\nSince buildstep runs as root within the container newer PHP Versions (after 5.5.11) don't work without a modified php-fpm.conf. Due to CVE-2014-0185 PHP changed the default permissions for the listening socket from 0666 to 0660. Since PHP-FPM and Apache both get run as root this results in the PHP-FPM process creating the listening socket belonging to `root:root` with mode 0660 and Apache running as `daemon:daemon` which can't read the PHP socket.\r\n\r\nThe workaround for dokku involves telling PHP-FPM to set the socket to 0666 mode:\r\n\r\nTell the startup script to include a config fragment for PHP-FPM:\r\n**Procfile**\r\n```\r\nweb: vendor/bin/heroku-php-apache2 -F conf/php-fpm.inc.conf web/\r\n```\r\n\r\nAdd a conf folder with the following `php-fpm.inc.conf` to your application\r\n**php-fpm.inc.conf**\r\n```\r\nlisten.owner = nobody\r\nlisten.mode = 0666\r\n```\r\n\r\nWith this workaround enable the example app has been validated using PHP 5.5.16 and PHP 5.6.0 as well.\r\nHeroku doesn't have this problems as the daemons don't get started as root and run as the same unprivileged user.\r\n\r\n# Results\r\n\r\n## Closed issues\r\n\r\nThese changes should close the following issues:\r\n\r\n  * #36 Allow to switch the buildpack branch (due to flynn buildpack installer)\r\n  * #61 Ruby 1.8 app won't start on image generated with buildstep (bundler is no longer installed globally)\r\n  * #66 Use $app_root and $build_root instead of hard coding /app and /build\r\n  * #80 scala buildpack is broken due to config_vars and quoting\r\n  * #82 HHVM support (switch to official PHP buildpack with HHVM)\r\n  * #84 Cannot pull down buildpack for Ruby 2.0\r\n  * #91 `make build` fails because rubygems are not installed\r\n  * #93 PHP after switch to Trusty (PHP buildback defaulted to `cedar` stack binaries due to missing STACK env var)\r\n  * #94 update-alternatives fails in prepare script (no longer gets called)\r\n\r\n## Closed pull requests\r\n  \r\nThese changes should close the following pull requests:\r\n\r\n  * #38 - Generate en_US.UTF-8 locale \r\n  * #41 - Install language-pack-en-base\r\n  * #71 - Removed old perl buildpack, using new one\r\n  * #95 - locale utf8 issue solved\r\n  * #97 - Use official php buildpack\r\n  * #100 - Don't add config_vars from release to .profile.d\r\n  * #103 - Copy and run prepare before builder to better leverage docker caching\r\n  * #104 - Fix bundler cache that was not working.\r\n  * #106 - Make sure libreadline5 is installed.\r\n  * #107 - Hardcode stack name\r\n  * #108 - Replaced CHH's buildpack with official one.\r\n"},"comment":{"url":"https://api.github.com/repos/progrium/buildstep/issues/comments/68925141","html_url":"https://github.com/progrium/buildstep/pull/109#issuecomment-68925141","issue_url":"https://api.github.com/repos/progrium/buildstep/issues/109","id":68925141,"user":{"login":"progrium","id":647,"avatar_url":"https://avatars.githubusercontent.com/u/647?v=3","gravatar_id":"","url":"https://api.github.com/users/progrium","html_url":"https://github.com/progrium","followers_url":"https://api.github.com/users/progrium/followers","following_url":"https://api.github.com/users/progrium/following{/other_user}","gists_url":"https://api.github.com/users/progrium/gists{/gist_id}","starred_url":"https://api.github.com/users/progrium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/progrium/subscriptions","organizations_url":"https://api.github.com/users/progrium/orgs","repos_url":"https://api.github.com/users/progrium/repos","events_url":"https://api.github.com/users/progrium/events{/privacy}","received_events_url":"https://api.github.com/users/progrium/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T20:07:41Z","updated_at":"2015-01-06T20:07:41Z","body":"I'm having a hard time understanding how it being symlinked is causing a\r\nproblem. Can you elaborate more on what you're doing?\r\n\r\nOn Tue, Jan 6, 2015 at 11:50 AM, Ken Ip <notifications@github.com> wrote:\r\n\r\n> @yabawock <https://github.com/yabawock> sorry I know this has been merged\r\n> for a while... but just running into an issue with /exec symlinked to\r\n> /start. Was that intentional and why? Need a way to source all files and\r\n> run a command and /exec is now gone (while /start is doing way too much).\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/progrium/buildstep/pull/109#issuecomment-68922446>.\r\n>\r\n\r\n\r\n\r\n-- \r\nJeff Lindsay\r\nhttp://progrium.com"}}