Using models
DataSphere provides tools for releasing services available to third-party resources. You can deploy a model trained in DataSphere and use the same tools to develop a fully featured service based on a Docker image.
To publish a service, DataSphere provides special resources, such as nodes and aliases.
Nodes
A node is an isolated group of specially created VMs (instances) the computing load is distributed across. Node instances are created with a preset environment and fixed interpreter state. Depending on your needs, you can select different instance configurations.
Warning
When deploying models, you pay for the uptime of each node instance: from its start to its deletion.
If you no longer need the deployed service, delete the node.
You can access the nodes using the API. API requests can change the state of the node's interpreter. To return to the initial state, you will have to recreate the entire node.
Note
The maximum size of a request to and a response from the node API is 16 MB.
To create a node, specify your organization's cloud folder where the node will deploy its instances and store its logs. In the folder, set up a subnet with internet access via a NAT gateway and create a service account with the vpc.user
role. Specify this service account in the DataSphere project settings.
A node from a checkpoint
Nodes from a checkpoint are good for testing and checking hypotheses. To create a node, pin the checkpoint of the cell where the input and output parameters of your future microservice are defined. DataSphere will use this information to automatically generate gRPC and REST APIs.
By default, node instances use standard system Docker images and do not copy the libraries set by the user. If your microservice requires packages that are not included in the pre-installed software, configure the Docker image for deployment of the node environment.
A node from an arbitrary Docker image
Nodes deployed from a Docker image hosted in a container registry will run as a fully featured service. The Docker image does not necessarily have to contain a model trained in DataSphere. You can create any image and place it in any registry that you find appropriate. To learn how to push a Docker image to a Yandex Container Registry registry, see Pushing a Docker image to a registry.
Note
To use Yandex Container Registry, the project service account needs the container-registry.images.puller
role.
When creating a node from a Docker image, you set, on your own, the node's API, the port your service will use, the connection time, the format of metrics to collect, and other parameters. Once the node is created, DataSphere will track its state, maintain the performance of instances, and, if required, scale the node within the instance range specified.
Node statuses
A DataSphere node can have one of the following statuses:
Healthy
: Number of instances with theHealthy
status in the node is equal to the minimum number of instances needed.Unhealthy
: Number of instances with theHealthy
status in the node is below the allowable minimum.Created
: The node has just been created.Deleting
: The node is being deleted.
Instance statuses
Node instances can have one of the following statuses:
Healthy
: The instance is healthy and available for balancing.Unhealthy
: There are issues with the instance and it has been excluded from balancing.Created
: A VM has been created for the instance.Started
: A connection has been established with the instance's VM.Preparing
: The instance is being prepared for processing requests.Deleting
: The instance is being deleted.Undefined
: The initial state of the instance when the VM has not yet been created.
Alias
An alias is a special resource used for publishing and updating a service. It allows you to replace nodes and update the running service without affecting the user experience.
Create an alias and use it as your service endpoint. You can update related nodes, balance the load across them, and remove deprecated Docker image versions without affecting the user experience.