A run is a single execution of an app. It is the basic functionality encompassed of receiving an input, running the app, and returning an output. This tutorial will walk you through running an app locally on your machine.
- Custom apps: given you control the code, you can test it locally before deploying it to Nextmv Cloud.
- Subscription apps: test a subscription app locally by using the community app it is based on. This is a good way to get started in the path to customization.
The following languages are supported:
Go
Use a Go installation.
Here is an example of running the nextroute
community app. Learn more about vehicle routing here.
Java
Use a Java installation.
Run the following command to generate a main.jar
in the root directory of the project.
For example, to run the knapsack community app, execute the main.jar
file with the following command:
Python
Use a Python installation. We suggest you use a virtual environment (venv) as well.
Make sure that the requirements.txt
are installed in that local venv.
Here are some examples of how to run an app locally, from the app's root.
ortools
. Learn more about mixed integer programming here.
pyomo
. Learn more about mixed integer programming here.
Running in a docker container
You can also run the app in a docker container. This is useful for testing because we can ensure that the app runs in the same environment as it would on our platform.
If you clone the knapsack community app, you will find that it has a .devcontainer
folder with a .devcontainer
file in it. If you use Visual Studio Code, and you have the Dev Containers extension and Docker installed, you can open the project in a docker container. We have prepared the Dev Container so that it mirrors the environment that the app will run in on the platform.
Alternatively, you can run the app in a docker container without using Visual Studio Code. Here is an example of how to run the knapsack community app in a docker container: