The Model Service feature in DataWorks lets you quickly deploy large, pre-trained models through a simple, guided interface. This topic describes how to deploy a model service using a DataWorks Serverless resource group.
Billing
This feature consumes DataWorks resources and resources from other cloud services. The fees are as follows:
|
Fee type |
Description |
|
DataWorks fees |
A running model service in DataWorks consumes resources from a Serverless resource group. For services deployed in a pay-as-you-go resource group, you are charged based on CU-hours. For more information on pricing, see Billing of Serverless resource groups. |
|
Non-DataWorks fees |
|
Usage notes
For secure private network access, you must enable the relevant services during deployment. The system automatically configures PrivateLink and Private Hosted Zone for the following reasons:
-
PrivateLink enables cross-VPC access, allowing you to access the fully managed model service deployed in DataWorks from a VPC within your account that can communicate with the DataWorks resource group.
-
Private Hosted Zone provides custom domain name resolution within your account, allowing you to access a specific DataWorks Model Service using a domain name within your VPC.
When you invoke a model service by its domain name, traffic flows from your VPC through the PrivateLink channel to the DataWorks resource group's VPC, where it reaches the model instances to complete the invocation. You can view service details in the PrivateLink console and the Alibaba Cloud DNS - Private Hosted Zone console.
Prerequisites
-
Enable the PrivateLink service.
To access it from your VPC, use PrivateLink to establish a secure, cross-VPC connection.
-
Enable the Private Hosted Zone service.
Private Hosted Zone provides custom domain name resolution within your VPC. It forwards requests made to the service's domain name to the DataWorks model service.
-
Create a DataWorks workspace and associate it with a Serverless resource group.
Ensure the services are enabled in the same region as your DataWorks workspace. Otherwise, the services may not function correctly.
Limits
-
The Model Service feature is available only in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Ulanqab), China (Shenzhen), China (Hong Kong), Japan (Tokyo), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Germany (Frankfurt), US (Silicon Valley), and US (Virginia).
-
Only model deployment is supported. Model training is not supported.
-
In a single region, each Alibaba Cloud account can deploy a maximum of 50 model services.
-
This feature supports only Serverless resource groups, and a single resource group can host a maximum of 5 model services.
-
Each model service can be associated with a maximum of 3 VPCs.
Entry points
-
Log on to the DataWorks console. In the top navigation bar, switch to the target region.
-
In the left-side navigation pane, click Model Service to open the Model Service page.
Deploy a model
On the Model Service page, click Deploy Model to open the Model List page. Select the model that you want to deploy and click Deploy. The Model Deployment configuration page opens. Follow the on-screen instructions to complete the deployment.
Configure basic information
-
Model: Confirm the type of model to deploy to the DataWorks resource group. For more information, see Supported models.
-
Service Name: Specify a custom name for the model service. This name is used to identify the deployed model service in DataWorks.
-
Description: (Optional) A description to help manage and identify the service.
Configure resource information
Configure the deployment environment for the model based on the following parameters.
|
Parameter |
Description |
|
Resource Group |
Specify the deployment location for the model service. Select the Serverless resource group that you created. After the deployment is complete, log on to the DataWorks console, switch to the target region, and then click Resource Group in the left-side navigation pane to go to the resource group list page. Click the name of the target Resource Group Name. On the resource group Details page, view the usage of the Serverless resource group for the Model Service. |
|
vSwitch |
Specify the vSwitch for the model service deployment. Based on the on-screen instructions, select a vSwitch that is associated with the Serverless resource group in the appropriate availability zone. |
|
Deployment Specification |
Select the resource specification for a single instance that is used to deploy the model service. |
|
Number of Instances |
Configure the number of instances for the model service deployment. Deploying multiple instances improves high availability for the model service. |
|
Total Occupancy |
The total CUs required for this model service deployment, calculated as Deployment Specification × Instances. Ensure that the available CUs for Model Service in the resource group are sufficient to deploy the current model service. You can go to the resource group quota management page to adjust the CU limit that is allocated to Model Service. For more information, see Allocate CU quotas for tasks.
|
After you complete the configuration, click Deployment.
When creating a model service, the platform automatically generates PrivateLink, Alibaba Cloud DNS Private Hosted Zone, and security group resources. Do not manually delete or edit these resources. The platform automatically cleans up these resources when you delete the model service.
After the deployment is complete, the system takes the following actions in your account:
-
A PrivateLink endpoint is created in the default VPC associated with the DataWorks resource group and establishes an encrypted communication channel with the PrivateLink endpoint service in the DataWorks resource group VPC.
-
A resolution record is automatically added to your account's Private Hosted Zone service, associating the internal domain name with the VPC environment of the DataWorks resource group.
Manage a model
After a model service is created, you can manage its status, view service information, manage network settings and API keys, and adjust resources as needed from the Model Service list.
Manage model status
A model service starts by default after it is successfully created. You can manage the model status based on your business requirements in the Operation column of the Model Service list.
|
Actions |
Service state |
Resource consumption |
|
Start |
Running |
Consumes resources from the Serverless resource group. |
|
Stop |
Stopped |
Does not consume resources from the Serverless resource group. |
|
Restart |
Restarting → Running |
The model service is temporarily unavailable during the restart. After the restart is complete, it resumes consuming resources from the Serverless resource group. |
|
Delete |
— |
Permanently releases the resources from the Serverless resource group. |
View model service
The Overview tab displays the configuration information for the current model service. On the Overview tab, you can manage the Basic Information, Resource Configurations, and Invocation Information of the model service.
-
In the Model Service list, find the target model service and click its Service Name to go to the Overview tab.
-
You can view the basic, resource, and invocation information of the model service.
-
Basic Information: includes the model's Service Name, Service ID, and Model type.
-
Resource Information: view information such as Deployment Specification and Instances.
-
Invocation Information: If you need to use a large model in a node task, click the
icon next to VPC Address Invocation Domain Name to copy the domain name.
-
Modify model resources
You can modify an existing model service's name, deployment resource specifications, and number of instances.
-
In the Model Service list, find the target model service and click its Service Name to go to the Overview tab.
-
Click Modify to the right of Resource Configurations to open the Modify Resources page and configure the settings.
ImportantModifying resources restarts the service, which causes a temporary interruption.
Manage model network
The Network Configuration tab displays the VPC environments that can currently access this model service over the internal network. On the Network Configuration tab, you can add or manage the VPCs used to access the Model Service.
-
In the Model Service list, find the target model service and click its Service Name to go to the Overview tab.
-
Click the Network Configuration tab to view the VPC environments that can access the model service over a private network.
-
To expand the access scope, you can Add Network to allow more VPC environments to access the Model Service deployed on DataWorks over a private network.
When adding a network, you must specify a VPC and a vSwitch. After the VPC Status changes to Enabled, you can access the model service from that VPC.
Note-
Billing: When you add a VPC to the Model Service, the system creates a PrivateLink endpoint in the selected VPC to establish a network connection with the DataWorks resource group. At the same time, a new private domain resolution record is added to Private Hosted Zone. This process incurs instance fees, data processing fees, and domain name resolution fees. For more information, see Billing of PrivateLink and Billing of Private Hosted Zone.
-
Limits: You can add a maximum of three VPCs for a single model service.
-
-
If you no longer want a specific VPC to access the model service, you can click Delete for the target VPC environment on the model service details page.
When you remove a VPC from the model service, the PrivateLink endpoint created in that VPC is also removed.
Manage API keys
An API key is a credential for authenticating callers and verifying their permissions. You can manage all API keys for the service on the API KEY tab.
-
In the Model Service list, find the target model service and click its Service Name to go to the Overview tab.
-
Switch to the API KEY tab to create, manage, and use API keys:
-
Add API key: After the model service is deployed, the platform includes a built-in API key for calls from other DataWorks modules. To call the service model from other environments using the service
endpoint, click Add API Key to create a new API key.We recommend that you create separate API keys for different application scenarios.
-
View API key: In the Operation column for the target API key, click View, and then click Copy to obtain the API key.
-
Delete API key: DataWorks API keys support the Disable and Delete features.
ImportantBefore you Disable or Delete an enabled API key, assess the potential impacts. After an API key is Disable or Delete, all tasks that use the API key to invoke the model will fail.
A Disable or Delete operation takes effect after approximately
5min.
-
View logs
On the model service details page, switch to the Logs tab to view the operational logs of the model service. This helps you troubleshoot service invocation errors or performance issues.
Next steps
After the model is deployed, you can use it to develop related tasks.
How it works
The following diagram and description explain how the model service is invoked:
When you deploy a model service in a DataWorks resource group or configure a VPC for it, the system automatically takes the following actions:
-
To establish a cross-VPC connection, the system automatically creates a PrivateLink endpoint in your VPC (a VPC in your account that can connect to the DataWorks resource group) and establishes an encrypted communication channel with the PrivateLink endpoint service in the DataWorks resource group VPC.
This operation automatically creates a PrivateLink endpoint in your account and requires that the service is enabled for your account.
-
To configure domain name resolution, DNS resolution rules are automatically configured in the VPC associated with the model service to forward DNS requests within the VPC to the DataWorks model service.
This operation automatically deploys the Private Hosted Zone service in your account and requires that the service is enabled for your account.