What's New

Bluemix Node.js Buildpack v2.0 – Configurable npm, better cache control, shell access and more!

Share this post:

The IBM SDK for Node.js Buildpack v2.0 is now live on Bluemix! In this release, we’ve synced our Node.js buildpack with the latest CF community Node.js buildpack, which comes with a number of new features from the community. In addition, we have also revamped the App Management feature in the Node.js buildpack, which enables utilities like shell, node-inspector, Bluemix Live Sync, and more! Simply repush your application to pick up v2.0.

==============================================

Due to security vulnerabilities, the legacy buildpack is no longer available, and the information about specifying it is outdated.

Note: The legacy buildpack, v1.18, will be available on Bluemix for some time and can be specified using the CF CLI:

cf push your_app_name <strong>-b sdk-for-nodejs_v1-18-20150519-1759</strong>

Or in your manifest.yml:
buildpack: <strong>sdk-for-nodejs_v1-18-20150519-1759</strong>

==============================================

Community Features

  1. Custom NPM versions — Add the engines.npm entry to your package.json file:
    "engines": {
    "node": "0.12.2",
    <strong> "npm": "2.7.4"</strong>
    },
  2. Installation of devDependencies — In addition to dependencies in your package.json, set the production flag to false by setting the following application environment variable: NPM_CONFIG_PRODUCTION false
  3. Configure buildpack caching
    • Disable caching of node_modules entirely by setting NODE_MODULES_CACHE false
    • Custom cache directories are also available. For example, set the following in your package.json to cache bower_components folder in addition to node_modules:
      "cacheDirectories": ["node_modules", "bower_components"]
  4. Revamped staging output — You’ll find that the staging log is updated, and provides insightful information during staging to how your application is configured (like caching, binary versions and service extensions). It also provides hints and warnings if you have misconfigured your application.
  5. Support for simple Node apps — For running quick node tests, you can push a directory with just a server.js file in it.

App Management on Bluemix

App Management is a set of development and management utilities that are enabled via environment variables for your Node.js application on Bluemix. Here’s what you need to know:

  • By default, App Management artifacts are installed to your application container, but are not enabled. To completely disable installation, set the following environment variable and restage your application.
    BLUEMIX_APP_MGMT_INSTALL = false # default is true
  • Explicit enablement of the individual App Management utilities — simply set the following environment variable and restart your application with the cf restart command.
    BLUEMIX_APP_MGMT_ENABLE = devconsole | shell | inspector | trace | proxy

    Enable multiple utilities by separating utilities with a “+”. For example: BLUEMIX_APP_MGMT_ENABLE = devconsole+shell+inspector
  • ENABLE_BLUEMIX_DEV_MODE variable is still supported, but deprecated. Enabling it will start the “proxy+devconsole+shell+inspector” utilities, as before.

For a more detailed explanation of all the available utilities, see below!

App Management Utilities Overview

IMPORTANT: Most App Management utilities will not work if you set your start command in manifest.yml (command) or CF CLI (-c). Those methods are buildpack overrides, and are anti-patterns for starting Node.js applications. Recommended practice is to set start command in package.json or Procfile.

IMPORTANT: Please add 256MB to your application to support installation of the additional utilities.

  1. proxy: Minimal application management that serves as a proxy between your application and Bluemix. Allows enablement of most other app management utilities. By enabling this, your application container will continue to live even if the application crashes (granted your start script is properly specified), which is great for checking out the file structure, logs and more. This also allows for incremental file update, which enables “Live Edit” feature available through DevOps.
  2. devconsole (also starts proxy): Starts a development console utility which is accessible at http://app_name.mybluemix.net/bluemix-debug/manage (login with your CF credentials)
  3. node-inspector (also starts proxy): Accessible from devconsole, or at http://app_name.mybluemix.net/bluemix-debug/inspector. Create CPU usage profiles, add breakpoints, and debug code, all while your application is running on Bluemix!
  4. shell (also starts proxy). Accessible from the devconsole, or at http://app_name.mybluemix.net/bluemix-debug/shell is a shell running in your application container. You can do everything supported by shell, even editing files while your app is running! Great for debugging.
  5. trace (does NOT start proxy) This feature used to be enabled by default, but is now disabled. trace allows you to dynamically set trace levels if your application is using log4js, ibmbluemix or bunyan logging modules. Navigate to the “Instance Details” page in the Bluemix web console and select the “Actions” button to see the UI:

Developer Advocate

More stories
April 30, 2019

Introducing IBM Analytics Engine v1.2 and Announcing the Deprecation of IBM Analytics Engine v1.0

We are excited to inform you about the new version of IBM Analytics Engine v1.2 that will be available starting May 15, 2019. Along with this release, Analytics Engine v1.0 will be retired.

Continue reading

April 23, 2019

Announcing the Deprecation of the Watson Machine Learning JSON Token Authentication Service

We’d like to inform you about the deprecation of the Watson Machine Learning JSON Token Authentication service. This method of authentication will be retired on May 30, 2019.

Continue reading

April 19, 2019

Introducing IBM Cloud Object Storage Firewall: Further Secure Your Data

IBM Cloud Object Storage (COS) is giving you more control over who can access your data. We have introduced a new capability allowing you to configure your buckets with trusted IP address(es) that will dictate access to the data in COS.

Continue reading