All Products
Search
Document Center

Machine Learning Platform for AI:Configure network connectivity

Last Updated:Mar 07, 2023

Elastic Algorithm Service (EAS) deploys online services in resource groups. After you configure network connectivity for a resource group, clients can access online services deployed in the group and other cloud services that reside in the same network as the group. This topic describes how to configure network connectivity for dedicated resource groups and the public resource group.

Prerequisites

Configure network connectivity for a dedicated resource group

To configure network connectivity, you must enable the VPC direct connection feature. To enable the feature for a dedicated resource group, you must specify the vSwitch and security group of the VPC that you want to connect. After you enable the feature, the Elastic Compute Service (ECS) instances that reside in the VPC can access EAS services deployed in the dedicated resource group by using the created elastic network interface (ENI). In addition, the EAS services can access other cloud services that reside in the VPC. You can use one of the following methods to enable the VPC direct connection feature:

  1. Go to the Elastic Algorithm Service page.
    1. Log on to the Machine Learning Platform for AI console.
    2. In the left-side navigation pane, click Workspaces. On the Workspace list page, click the name of the workspace that you want to manage.
    3. In the left-side navigation pane, choose Model Deployment > Model Serving (EAS) to go to the Elastic Algorithm Service page.
  2. Enable the VPC direct connection feature.

    You can use one of the following methods to enable the VPC direct connection feature:

    • Method 1:

      1. On the Resource Group tab, find the resource group for which you want to enable the feature and enable VPC Direct Connection in the VPC Direct Connection column.VPC direct connection

      2. In the Enable VPC Direct Connection dialog box, configure the VPC, vSwitch, and Security Group Name parameters and click OK.

    • Method 2:

      1. On the Resource Group tab, find the resource group for which you want to enable the feature and click its name.

      2. Enable VPC Direct Connection.Enable VPC direct connection

      3. In the Enable VPC Direct Connection dialog box, configure the VPC, vSwitch, and Security Group Name parameters and click OK.

Configure network connectivity for the public resource group

To configure network connectivity, you must enable the VPC direct connection feature. To enable the feature for the public resource group, you must specify the vSwitch and security group of the VPC that you want to connect. After you enable the feature, the ECS instances that reside in the VPC can access EAS services deployed in the public resource group by using the created ENI. In addition, the EAS services can access other cloud services that reside in the VPC. You can use one of the following methods to enable the VPC direct connection feature:

  • Enable the VPC direct connection feature when you use a client to deploy a service.

    To enable the feature, you can specify the fields that are prefixed with cloud.networking. For more information, see Run commands to use the EASCMD client.

    • The following table describes the cloud.networking fields.

      Field

      Description

      cloud.networking.security_group_id

      The ID of the security group to which the ECS instance that hosts your client belongs.

      cloud.networking.vswitch_id

      The ID of the vSwitch in which your client resides. An ENI is created for the vSwitch. Make sure that the vSwitch has sufficient idle IP addresses. Otherwise, EAS instances cannot be created.

    • The following code provides an example on how to specify the fields:

      {
        "model_path": "http://exampebucket.oss-cn-shanghai.aliyuncs.com/models/lr_xingke4.pmml",
        "name": "test_pmml",
        "processor": "pmml",
        "metadata": {
          "instance": 1,
          "cpu": 3,
          "memory": 2000
        },
        "cloud": {
          "networking.security_group_id": "sg-2vce4xxvy5hn1hmj****",
          "networking.vswitch_id": "vsw-2vcbbihcy3cg8fjdp****"
        }
      }
  • Enable VPC direct connection in the console.

    You can use one of the following methods to enable the feature:

    • When you deploy a service in the public resource group, enable Direct Connection in the Advanced Settings section and then configure the VPC, Security Group Name, and vSwitch parameters. For more information, see Model service deployment by using the Machine Learning Platform for AI console and Machine Learning Designer.

    • After you deploy the service in the public resource group, perform the following steps to configure the direct connection:

      1. On the EAS-Online Model Services page, click the name of the service that you want to manage.Destination service

      2. On the Service Details tab, click Configure Direct Connection.Configure VPC direct connection

      3. In the Configure Direct Connection dialog box, configure the VPC, vSwitch, and Security Group Name parameters and click OK.

What to do next

By default, EAS services are not connected to the Internet. If you want to use your service to access the Internet or other cloud services that have access control configured, see Configure Internet access and a whitelist.