Execution Environment

Execution classes

A tutorial on execution classes available in the Nextmv Platform.

Execution classes define the characteristics of how instances are executed, such as:

  • cores
  • memory
  • maximum run time

In a nutshell, an execution class is the type of machine that is used to run remotely. Here is the default execution class that is widely available:

ClassCoresMemoryMaximum run timePremium
6c9500mb870s69500 MB14.5 minutes

If an execution class is not specified, this default (6c9500mb870s) one is used.

Premium execution classes

Premium execution classes must be activated on your account. Please contact us for more information.

If you want to run for longer, and with more CPU and memory available, you can use premium execution classes. These are available upon request and are subject to additional charges.

These are the premium execution classes available:

ClassCoresMemoryMaximum run timePremium
8c16gb120m816 GB120 minutes
16c60gb30m1660 GB30 minutes
16c60gb12h1660 GB12 hours

You should expect your runtime to increase with this type of resource by 30-60 seconds compared with the default execution.

Using execution classes

There are two ways to specify an execution class:

  1. As part of an instance’s configuration.

    • When creating an instance:
      • Nextmv CLI. Use the -e, --execution-class flag.
      • Cloud API. Use the configuration.execution_class field.
    • When updating an instance:
      • Nextmv CLI. Use the -e, --execution-class flag.
      • Cloud API. Use the configuration.execution_class field.
  2. As part of the run, when running remotely. Use one of the following interfaces.

  • Nextmv CLI. Use the -e, --execution-class flag. Here is an example:
nextmv app run \
            --app-id $APP_ID \
            --instance $INSTANCE_ID \
            --input $INPUT_FILE \
            --execution-class 16c60gb30m \
            --options "duration=2" \
            --wait \
            --timeout 120

  • Cloud API. Use the configuration.execution_class field. Make sure your NEXTMV_API_KEY is exported as an environment variable. The API uses Bearer Authentication. Here is an example.

New application run.

Create new application run.

curl -sS -L -X POST \
    "https://api.cloud.nextmv.io/v1/applications/$APP_ID/runs?instance_id=$INSTANCE_ID" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $NEXTMV_API_KEY" \
    -d "{
      \"input\": {},
      \"config\": {\"execution_class\": \"8c16gb120m\"},
      \"options\": {
        \"solve.duration\": \"2s\"
    }" | jq
  • Python SDK. Use the configuration argument. Here is an example.
import json
import os

from nextmv.cloud import Application, Client, Configuration, PollingOptions

with open(os.getenv("INPUT_FILE")) as f:
    input = json.load(f)

client = Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = Application(client=client, id="<YOUR_APP_ID>")
result = app.new_run_with_result(
        "solve.duration": "10s",
        "solve.iterations": "20",
    polling_options=PollingOptions(),  # Customize polling options.
print(json.dumps(result.to_dict(), indent=2))  # Pretty print.

Page last updated

Go to on-page nav menu