Step 10: Start the application

Process Supervisor Demo

Running your application with the Habitat Supervisor enables you to do things such as

  • update runtime configuration,
  • connect application services using built-in topologies,
  • and roll out changes according to built-in update strategies, to name a few.

In this demo, we'll use the at-once update strategy to update our running application to the latest stable version. Enter the Habitat Studio* and start the application as follows.

$ hab studio enter
[1][default:/src:0]# hab sup run
[2][default:/src:0]# hab svc load yourorigin/sample-node-app --strategy at-once

The first command starts the Habitat Supervisor, and the second instructs it to download, install and run the latest stable version of the package from the public Habitat Builder Depot. Passing the --strategy at-once option tells the Supervisor to watch the Depot for new packages in the stable channel, and to download, install and run them automatically.

*If you would like to preview the running application locally in your web browser, then you will need to expose a port before you enter the Habitat Studio. Since the Studio is built with Docker, you can do this by running export HAB_DOCKER_OPTS="-p 8000:8000" before you enter the studio.

Once the application has been started, you can then preview it at http://localhost:8000.

Next, tail the Supervisor log for the running application using the following command:

[1][default:/src:0]# sup-log

Keep the log open as we'll be using it in the next step.

CLI screenshot after running build