Archivev1.5.0

Source available Nextroute

March 15, 2024

Source available Nextroute

We are thrilled to announce the availability of Nextroute source code, a significant milestone in our commitment to transparency and collaboration within our community. This release marks a pivotal moment as we open up access to the inner workings of Nextroute, allowing developers to build nextroute custom models without the complexity of working with Go plugins.

Key Highlights:

  • Licensing Requirements: It's important to note that access to the Nextroute source code is subject to our licensing terms. While the source code is available, users are required to adhere to our licensing terms.

  • Source Code Access: With the release of the Nextroute source code, developers gain access to the underlying framework powering the routing engine. This empowers our users to customize features and more easily debug for local development. As part of this release, we have unlocked customization of the solve operators to have even more control and customization of solutions.

How to Access:

To access the Nextroute source code, simply visit our official nextroute repository.

Upgrading

If you run into any issues migrating to the new nextroute, please contact support.

To update and tidy your Go project and reference nextroute v1.5.0 see below. Note there are multiple breaking changes, some of which may not be covered in this guide.

For an example of how to use the new code, you can clone the nextroute community app locally.

nextmv community clone -a nextroute
Copy

Update the CLI to v1.5.0

This upgrade guide assumes you’ve previously installed and configured the Nextmv CLI.

Open up your terminal and run the following command:

nextmv update
Copy

Alternatively, you can specify the version.

nextmv update v1.5.0
Copy

Change the import paths

The import path has changed since nextroute now lives in its own repository. To migrate, you will need to find and replace:

  • github.com/nextmv-io/sdk/nextroute 👉 github.com/nextmv-io/nextroute

Following this, you should stand at the location of the go.mod and run:

go get github.com/nextmv-io/nextroute@v1.5.0
go mod tidy
Copy

New signature for Last()

The signature of Last() (the method to retrieve the last / best solution) has changed to now return error in addition to the Solution. To migrate, you will need to handle the error in the return as shown below:

last := solutions.Last()
Copy

Running locally

The nextmv sdk command suite has been marked as deprecated and will be removed in a future release. To run locally, use your native Go installation:

nextmv sdk run . -- \
    -runner.input.path input.json \
    -runner.output.path output.json \
    -solve.duration 10s
Copy

App manifest

An app manifest is now required for nextroute applications. To upgrade to nextroute v1.5.0, you will need to modify / create a file in the same location as your go.mod called app.yaml which contains the following:

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: go
runtime: ghcr.io/nextmv-io/runtime/default:latest
pre-push: GOOS=linux GOARCH=arm64 go build -o main
files:
  - main
Copy

If you run into any issues migrating to the new nextroute, please contact support.

Page last updated

Go to on-page nav menu