Re: Buildpack deep dive questions...
Daniel Mikusa
On Mon, Mar 25, 2019 at 10:45 AM Cade Thacker <cade@...> wrote:
If your buildpack itself needs to be compiled, you have two choices: 1.) Compile locally, package a buildpack and install with `cf create-buildpack`. 2.) Use a shim script to build then run your buildpack. If you want to support `cf push -b https://git-url/my-buildpack` then you have to do this. See here for an example: https://github.com/cloudfoundry/nodejs-buildpack/blob/master/bin/supply#L10 and the script it runs to install Golang.
The final buildpack can basically do what ever it wants, since it gets to dictate the start command. If you want it to start Envoy + some other stuff you can do that. A couple things to keep in mind. First, if you're starting multiple processes in the app container you need to manage them. If one fails, you need to make it so that they all fail, or you'll have unexpected behavior. For example, if Envoy is running but your second process, presumably your actual app, crashes then you need to make sure they all crash so that the platform can detect the crash and restart your app. Second, multiple processes in the container makes it harder to reason about available memory, be especially careful if you're running a Java app. Lastly, only the supply script will run for non-final buildpacks. If you need finalize to run for a non-final buildpack, like to get the proper Java start command, then that's not going to be easy. Hope that helps! Dan
|
|