Run App Remotely

Run remotely with Nextmv CLI

A tutorial for running an app remotely with Nextmv CLI.

Complete run workflow

Execute the complete run workflow (submit a run, poll for status, get the results). The output key will contain the actual output of the run. This is an aggregation of the other steps.

nextmv app run \
    --app-id $APP_ID \
    --instance $INSTANCE_ID \
    --input $INPUT_FILE \
    --options "solve.duration=10s,solve.iterations=20" \
    --wait
Copy

New run

Submit a new run. The run_id is returned.

nextmv app run \
    --app-id $APP_ID \
    --instance $INSTANCE_ID \
    --input $INPUT_FILE \
    --options "solve.duration=10s,solve.iterations=20"
Copy

Run metadata

Get a run metadata. The metadata.status key will contain the status of the run. Use the run_id obtained from submitting a run.

nextmv app metadata \
    --app-id $APP_ID \
    --run-id $RUN_ID
Copy

Run result

Get a run result. The output key will contain the actual output of the run. Use the run_id obtained from submitting a run.

nextmv app result \
    --app-id $APP_ID \
    --run-id $RUN_ID
Copy

Get the logs of a run

You can get the logs of a run after it is finished. The logs contain everything that was printed to stderr during the run.

nextmv app logs \
    --app-id $APP_ID \
    --run-id $RUN_ID
Copy

Running with log tailing

You can also tail logs while running, which will show you any output your application prints to stderr about every 30 seconds. If you use the --verbose flag then the results will also show when the run completes.

nextmv app run \
    --instance $INSTANCE_ID \
    --input $INPUT_FILE \
    --tail \
    --verbose
Copy

Cancel a run

To cancel a run, use the nextmv app cancel command.

nextmv app cancel \
   --app-id "<YOUR-APP-ID>" \
   --run-id "<YOUR-RUN-ID>"
Copy

Account queue

Get the queue of runs for the account. A run is queued when the status_v2 in the metadata is queued. Use the nextmv account queue command.

nextmv account queue
Copy

Page last updated

Go to on-page nav menu