Example for running a Go application on the Nextmv Platform using the HiGHS solver. We solve an order fulfillment problem. We need to decide which distribution centers are used and which carriers should be considered for the transportation of the order to the customer.
-
Run the app.
go run . -runner.input.path input.json \ -runner.output.path output.json -solve.duration 10s
To push your app to the Nextmv platform via nextmv app push ...
, you will
need to have zig installed and available on your $PATH
.
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:
GOOS=linux go build -o main . && \
cat input.json | docker run -i --rm \
-v $(pwd):/app ghcr.io/nextmv-io/runtime/default:latest \
/app/main
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
.