Instances¶
Learn how to manage application instances (create, get, update, delete) with your tool of choice.
- CLI: the Nextmv Command Line Interface (CLI).
- Python SDK: a Software Development Kit (SDK) for Python developers.
- Cloud API: an HTTP API for developers to integrate with the Nextmv platform.
An application instance is a representation of a version and optional configuration (including options/parameters). Instances are the mechanism by which a run is made. When you make a new run, the app determines which instance to use and then uses the executable code associated to the version for the run.
Examples include:
- You want to use different optimization logic for different regions.
- You want to test two different app version/configuration combinations.
- You want to have different environments for staging and production. You can specify one instance for staging, and one for production.
- You want to give each developer their own instance so they can push their working code to their own endpoints.
Every time your application is pushed, there is a special instance created
called latest. As the name suggests, this instance always points to the
latest executable code that has been pushed to the application. This is the
default instance of an application, so every time you run an application
without specifying an instance, the latest instance will be used. Every time
you push an app, the latest instance is overwritten with the new code.
Info
You cannot delete the latest instance.
The same version can be used by multiple application instances, and an instance's version can be changed as well. This allows you to publish model updates to a specific environment in a controlled way. Instances are the way to manage which versions are used for runs, as well as a way to manage consistent configuration per run.
An application knows which instance to use by two ways:
- You can specify an instance explicitly when starting a new run.
- You can set a default instance for your app and this instance is always used when no instance is specified. If no application instance is specified, and no default application instance is defined, then the run will fail.
Application instances can be locked to prevent accidental changes to the version or configuration. For example, if you are using an instance for production traffic, you may want to lock the instance to prevent changes. You can unlock the instance to make changes, and then lock it again when you are done.
Configuration¶
An instance can be assigned a specific configuration. The configuration that lives at the instance level is passed to every run that is executed for that instance. The run may override the configurations herein described. The configuration is composed of:
- Execution class: the machine on which the run will be executed.
- Content format: the input/output format for the run.
- Options: parameters in the form of key-value pairs.
- Secrets collection: one or more secrets stored in environment variables or files.
- Queuing: configuration for prioritizing runs.
- Integration ID: the ID of the integration that will be used to execute the run.