Execution Classes

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
8c16gb12h816 GB12 hours
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-id $INSTANCE_ID \
            --input $INPUT_FILE \
            --execution-class 8c16gb12h \
            --options "duration=2" \
            --wait \
            --timeout 240
Copy
  • 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.
POSThttps://api.cloud.nextmv.io/v1/applications/{application_id}/runs

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\": \"8c16gb12h\"},
      \"options\": {
        \"solve.duration\": \"2s\"
      }
    }" | jq
Copy
  • 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(
    input=input,
    instance_id="<YOUR_INSTANCE_ID>",
    run_options={
        "solve.duration": "10s",
        "solve.iterations": "20",
    },
    polling_options=PollingOptions(),  # Customize polling options.
    configuration=Configuration(execution_class="8c16gb12h"),
)
print(json.dumps(result.to_dict(), indent=2))  # Pretty print.
Copy

Page last updated

Go to on-page nav menu