How To Guides

Manage apps in Nextmv Cloud

A how-to guide for managing decision applications on Nextmv Cloud

This how-to guide assumes you already completed the steps described in the 5-minute getting started experience. To test that the Nextmv CLI is correctly configured, you can optionally run the following command on your terminal. It will get some files that are necessary to work with the Nextmv Platform. You can see the expected output as well.

nextmv sdk install
Copy

Setup

To deploy an application with Nextmv Cloud, we'll start with a template.

For this example, we'll use the routing app. Initiate a new template and then navigate into the new directory.

nextmv sdk init -t routing
Copy

Creating an Application

You are now ready to start using applications. An application is hosted by Nextmv and gets run in Nextmv Cloud. You'll first create the application. You must provide an id and name, and can optionally provide a description.

nextmv app create \
    --app-id 'pizza-delivery' \
    --name 'Pizza Delivery' \
    --description 'My pizza delivery app'
Copy

You can now see the application by running the list comnand.

nextmv app list
Copy

Running an Application

Once an app is created, you'll need to push the app that you want to run to the cloud. When you push an application, you update the application's latest binary with the binary from your local project. To update the working cloud binary run the following command:

nextmv app push \
    --app-id 'pizza-delivery'
Copy

Once this completes successfully you can go ahead and run the application on the cloud platform.

nextmv app run \
    --app-id  'pizza-delivery' \
    --input './input.json' \
    --wait
Copy

When you append the --wait flag, the cli will continue to poll until the run is complete.

Promoting an Application

When your app is at a point that you want to use it for a more formal case, like running with production, you can promote a version of the app to generate an instance you can refer to when performing a run.

nextmv app promote \
    --app-id 'pizza-delivery' \
    --name 'Prod version' \
    --description 'my first prod version'
Copy

To see a list of promoted versions of your app, run the following command:

nextmv app version list \
    --app-id 'pizza-delivery'
Copy

You can now run that specific version by running the default flag. Only the default instance is supported in this release. Note: if you perform a run using the REST endpoint, and do not specify a version, then the default instance will be used.

nextmv app run \
    --app-id  'pizza-delivery' \
    --input './input.json' \
    --default \
    --wait
Copy

If you don't wish to --wait, you’ll receive the run id for your run. You'd now have a unique cloud native endpoint and can use the result command to retrieve the results of your run.

Default Instance

If you get your application, you’ll see that it now has a default instance id set. Here is an example:

nextmv app get \
    --app-id 'pizza-delivery'
Copy

If you make a change and push a new update the default version will not be affected. If you want to run the working app you will simply execute run without the --default flag. If you promote again, another version is created, and the default instance is updated to that recently promoted version.

Page last updated

Go to on-page nav menu