Announcing new Cloud Foundry Buildpacks

Elliott Shanks
 

TL;DR:


In the coming weeks, the CF Buildpacks team will be releasing a new Node.js buildpack, composed of modular buildpacks, that implements the Cloud Native Buildpacks (CNB) API. This buildpack can be used with any platform that supports CNB.


A buildpack release that contains a compatibility layer for use on the Cloud Foundry Application Runtime can be found in the nodejs-cnb repo. Add the buildpack to your list of buildpacks and `cf push` to begin building Node.js applications with the new Node.js buildpack.


Introduction to new buildpacks

Over the past year, the buildpacks team has worked to build the next set of Cloud Foundry buildpacks using the Cloud Native Buildpacks (CNB) API. In the coming weeks, we will be releasing the Node.js CNB. This new buildpack is compatible with any CNB platform (such as the pack CLI or kpack) and additionally contains a limited compatibility layer for the Cloud Foundry Application Runtime. (Note that the compatibility layer produces a droplet, while CNB platforms output special, rebasable OCI images.)


What are Cloud Native Buildpacks?

Cloud Native Buildpacks, a CNCF sandbox project, uses a modular approach to building applications by splitting major dependencies and operations on applications into their own dedicated CNBs. What was once the Node.js buildpack is now a combination of the node-engine, yarn, and npm CNBs. This allows for a transparent build process that is easier to debug when a build fails. CNB also employs better caching and data deduplication, and as a result, faster builds and faster deploys on platforms that support OCI images. 


Note: Due to the modular nature of CNB, the new Node.js buildpack does not currently include certain external integration helpers, such as those for APM agents. It has been difficult to manage and test these integrations, and we plan to shift towards modular integration CNBs that are maintained outside the project by integration authors and platform vendors.

Using CNBs on Cloud Foundry Application Runtime

To use the new Node.js CNB, it is as simple as grabbing the shimmed release artifact from the nodejs-cnb repo and adding the buildpack to your list of buildpacks on your foundation. 


Note: Because the CNB API results in an OCI image, a compatibility (shim) is required in order to translate the new Cloud Native Buildpacks API to the existing CF Buildpack API. This compatibility layer is less performant than CNB, but fully supports CF multi-buildpack mode when multiple CNBs are specified, by translating it to CNB’s native modular buildpack mode. Additionally, it provides compatibility with older supply-only CF buildpacks, as long as those buildpacks precede the CNBs.



To add the new buildpack to CFAR:

cf create-buildpack <buildpack-name> <path/to/downloaded_shimmed_nodejs_buildpack> <detection order>


If you want to cf push without -b <buildpack-name> use a <detection order> number smaller than the current Node.js buildpack detection order number during `create-buildpack`. To see the detection order of buildpacks run `cf buildpacks`.


Ways to Provide Feedback

The buildpacks team would love to gather feedback from the CF community about your experience using the Node.js CNB when it is released. As always, you can drop into the Cloud Foundry slack in the #buildpacks channel to reach out. 


We hope that you are as excited as we are about the new future of buildpacks.


Respectfully,

CF Buildpacks Team


Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.