Example for running a Python application on the Nextmv Platform using the Pyvroom package. We solve a vehicle routing problem.
-
Install packages.
-
With
pippip install . -
With
uvuv sync
-
-
Run the app.
-
With
pythoncat input.json | python main.py -
With
uvcat input.json | uv run main.pyOr with custom options:
cat input.json | uv run main.py \ -duration 30 -exploration_level 4 -threads 6
-
Docker needs to be installed.
To run the application in the same Docker image as the one used on Nextmv Cloud, you can use the following command:
cat input.json | docker run -i --rm \
-v $(pwd):/app ghcr.io/nextmv-io/runtime/python:latest \
sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py'You can also debug the application by running it in a Dev Container. This
workspace recommends to install the Dev Container extension for VSCode. If you
have the extension installed, you can open the workspace in a container by
using the command Dev Containers: Reopen in Container.