A Nextmv Cloud Application is a decision model that be executed remotely on the Nextmv Platform. An application is an executable program that fulfills the following minimum requirements:
- Must read from either
Stdin
or a file. - Must write results either to
Stdout
or a file. - Must contain an
app.yaml
manifest in the root of your app project.
To push an app to Nextmv Cloud using the nextmv
Python SDK, you can use one of the following strategies:
- External strategy: push an app that is composed of files in a directory.
- Internal strategy: push an app that is created from a
nextmv.Model
.
External strategy
The external strategy consists of specifying app_dir
, which is the path to an app’s root directory. The app is composed of files in a directory and those apps are packaged and pushed to Nextmv Cloud. This is language-agnostic and can work for an app written in any language.
Place the following script in the root of your app directory and run it to push your app to the Nextmv Cloud. This is equivalent to using the Nextmv CLI and running nextmv app push
.
Internal strategy
The internal strategy consists of specifying a model
and model_configuration
. This acts as a Python-native strategy called "Apps from Models", where an app is created from a Nextmv.Model
. The model is encoded, some dependencies and accompanying files are packaged, and the app is pushed to Nextmv Cloud. To push a nextmv.Model
to Nextmv Cloud, you need optional dependencies. You can install them by running:
Once all the optional dependencies are installed, you can push the app to Nextmv Cloud.