Data Science Workshop (DSW) provides a cloud-based Integrated Development Environment (IDE) for AI development. Developers who are familiar with Notebook or VSCode can start model development quickly. This topic describes how to create a DSW instance and provides solutions to common issues that may occur during instance startup and release.
Quickly create a basic DSW instance
Log on to the PAI console, select the target Region, click Workspaces in the left navigation pane, and then select the target workspace.
In the left navigation pane, click Interactive Modeling (DSW) > Create Instance. Configure the following key parameters and leave the other parameters at their default values. For a complete list of console parameters, see List of All Console Parameters.
Parameter
Description
Instance Name
Example:
dsw_test.Resource Type
Select Public Resources, which uses the pay-as-you-go billing method.
Instance Type
Select an instance type, such as
ecs.gn7i-c8g1.2xlarge(1 A10 GPU, 8 vCPUs, 30 GiB memory).If this instance type is out of stock, try another instance type from the list or switch to another region.
WarningIf you use a DSW free trial resource plan, make sure that the selected instance type is covered by the plan (ecs.g6.xlarge, ecs.gn7i-c8g1.2xlarge, or ecs.gn6v-c8g1.2xlarge). If you select an unsupported instance type, its fees cannot be deducted. For more information, see Obtain, use, and release a free trial.
After your free quota is used up or expires, if the DSW instance is still in the "Running" state, the system automatically switches to the pay-as-you-go billing method and deducts fees from your account balance. Make sure to release the instance promptly.
Image config
Select Alibaba Cloud Image, search for and select
modelscope:1.31.0-pytorch2.8.0-gpu-py311-cu124-ubuntu22.04(Python version: 3.11, CUDA version: 12.4).We recommend that you use the ModelScope image because it offers good compatibility and includes a comprehensive set of third-party libraries.
Click OK to create the instance. A status of Running indicates that the instance has been created successfully.
If the instance fails to start, refer to DSW instance startup.
On the DSW instance list page, click the Open button in the Actions column to open the DSW instance and start model development.
For more information about the DSW instance interface features and how to stop, release, and change the configuration of the DSW instance, see Console access and management of DSW.
ImportantHourly billing for a DSW instance created with public resources begins as soon as its status changes to Running, even if you do not open the WebIDE or run code.
Closing the browser or logging out does not stop the instance or the billing.
If you use a free trial resource plan, the billing method automatically switches to pay-as-you-go after the quota is used up. The instance is not automatically stopped.
Stop the instance. When you have finished your development tasks and no longer need the DSW instance, return to the DSW instances page:
If you want to temporarily stop the instance, click the Stop button to the right of the instance. Note that if the system disk has been scaled out, billing for the system disk continues after the instance is stopped.
ImportantBy default, data is stored on a free cloud disk. If the instance is stopped for more than 15 days, the data on the cloud disk is deleted and cannot be recovered. This restriction does not apply if you have expanded the system disk.
If you no longer need the instance, click More > Delete to the right of the instance to delete it and permanently stop all billing. Before you delete the instance, back up any important data. Data from a deleted instance cannot be recovered.
Configuration for typical application scenarios
The basic configuration of a DSW instance may not meet your AI development needs. The following table summarizes configurations for typical application scenarios.
Scenario | Requirement/Pain Point | Key configurations | References |
Persistently store code and data | The system disk of a DSW instance is temporary storage. Data is cleared when the instance is deleted or stopped for an extended period. You need to save important files for a long time or share data among multiple instances. | You can use Dataset Mounting or Mount storage to mount cloud storage, such as Object Storage Service (OSS), to a specified directory within an instance. | |
Improve public network download speed | By default, DSW instances use a shared gateway. Because of bandwidth limits, the network speed may be insufficient when you download large files. | In the Network Information section, configure a VPC to use a Private Gateway. You also need to create a NAT Gateway and an Elastic IP Address (EIP) for the VPC. | |
Develop remotely using SSH | You are accustomed to using local tools such as VSCode or PyCharm for development and debugging and do not want to be limited to a web IDE. | In the access configuration, select Enable SSH, enter your SSH Public Key, select the Access over Internet method, and associate an existing NAT Gateway and Elastic IP Address (EIP). | |
Access web services within the instance | Publish a web application that is running in the instance to the Internet so that it can be directly accessed or shared through a URL. | In the access configuration, add a Custom Services, configure the service port, and enable public network access. Then, add an inbound rule in the security group to allow traffic on this port. |
Complete list of console parameters
Basic Information
Parameter | Description |
Instance Name | Configure the instance name based on the prompts on the interface. |
Tag | Add tags to instances as needed. This helps you search for, locate, manage, and allocate costs for resources from multiple dimensions. |
Resource Information
Parameter | Description |
Resource Type |
|
Environment Information
Parameter | Description |
Image Configuration | The following image types are supported:
|
System Disk | This is used to store files during the development process. When Resource Type is set to Public Resources, or when Resource Quota is set to a subscription general computing resource (with at least 2 CPU cores and 4 GB of memory, or a GPU), each instance includes a 100 GiB free cloud disk as a system disk. The cloud disk can be expanded. For specific pricing, refer to the console. Warning
If you need persistent storage, you can configure Dataset Mounting or Mount storage. |
Dataset Mounting | Can be used to store datasets that need to be read or to persistently store files during development. The following two dataset types are supported:
Mount Path: The path where the dataset is mounted in DSW, for example, Note
For more information about mounting, see Mount a dataset, OSS, NAS, or CPFS. |
Mount storage | You can also use storage mounting to store datasets that need to be read or to persistently store files during development.
For more information about mounting, see Mount a dataset, OSS, NAS, or CPFS. |
Working Directory | This parameter can be configured when you select public resources. The working directory is the startup path for Notebook and the Web IDE. The default is |
Network Information
Parameter | Description |
VPC Settings | You can configure this parameter only when Resource Type is set to Public Resources. When you want to use a DSW instance in a Virtual Private Cloud (VPC), you can create a VPC in the same region as the DSW instance and configure this parameter. You also need to configure a vSwitch and a Security Group. For details about configuration policies for different scenarios, see Network Configuration. |
vSwitch | This parameter can be configured when a VPC is configured. A vSwitch is a subnet within a VPC. Your DSW instance and other cloud resources are connected to the vSwitch. |
Security Group | This parameter must be configured when a VPC is configured. A security group is a virtual firewall for your DSW instance that controls all inbound and outbound network traffic. |
Internet Access Gateway | The following configuration methods are supported:
You can configure the following parameters only when you select a CPFS-type dataset for Mount Configuration:
Note If you select a CPFS dataset for the mounting configuration, you must configure a VPC, and the selected VPC must be the same as the CPFS. |
Extended CIDR Block | You can configure this parameter after a vSwitch is configured. If the number of available IP addresses in the VPC is insufficient for business expansion or if the initial network planning was inadequate, you can use a secondary CIDR block to expand the VPC address space. For more information, see Expand a CIDR block using a secondary CIDR block. |
Access Configuration
Parameter | Description |
Enable SSH | This option enables you to remotely connect to the instance and can be configured after you select a virtual private cloud (VPC). When you enable this option, a Custom Services named SSH appears. If you configure a custom image, you must ensure that sshd is installed on the custom image. |
SSH Public Key | After you enable the SSH Configuration switch, you can configure this parameter. Note To support both VPC logon and public network logon, you must add the public keys of multiple clients. Add the public keys one by one, each on a new line. You can add up to 10 public keys. |
Service Access and Port Configuration | You can use this to configure SSH remote access or access services in an instance over the Internet.
|
Create Private Zone in VPC | Creates a built-in authoritative domain name (PrivateZone). You can use this domain name within the VPC to access services on the instance, such as SSH, without having to use the instance's IP address, which may change. Note that creating a built-in authoritative domain name incurs fees. For more information, see Alibaba Cloud DNS Billing. |
Public Network Access | NLB:
DNAT + EIP:
|
Roles and Permissions
Parameter | Description |
Visibility | You can select Visible to the Instance Owner or Visible to Current Workspace. |
Instance Owner | Only a workspace administrator can change the instance owner. |
FAQ
DSW instance startup
Stopping or releasing a DSW instance
DSW instance free trial
For more information about how to obtain, use, and release a DSW free trial, see Obtain, use, and release a free trial.
Appendix: Create an instance using the Python SDK
The Alibaba Cloud SDK uses the Credentials tool to obtain credential information. Before you call the API, you must install and configure this tool. The requirements are as follows:
Python version >= 3.7.
Use the V2.0 generation of the Alibaba Cloud SDK.
The installation command is as follows:
pip install alibabacloud_credentialsObtain an AccessKey. This example uses AccessKey information to configure access credentials. To prevent this information from being exposed, we recommend that you configure the AccessKey as environment variables. The environment variable for the AccessKey ID is named
ALIBABA_CLOUD_ACCESS_KEY_IDand the variable for the AccessKey Secret is namedALIBABA_CLOUD_ACCESS_KEY_SECRET.For more information, see Create an AccessKey.
For information about how to set environment variables, see Configure environment variables.
For other credential configuration methods, see Install the Credentials tool.
Install the PAI-related Python SDK.
# Install the workspace SDK. pip install alibabacloud-aiworkspace20210204 -U -q # Install the DSW SDK. pip install alibabacloud_pai_dsw20220101 -U -q # OpenAPI dependency. pip install alibabacloud_tea_openapi -U -q # Install the SDK for querying subscription resource groups. pip install https://sdk-portal-us-prod.oss-accelerate.aliyuncs.com/downloads/u-b8602de7-c468-436c-8a02-2eca4a30d376-python-paistudio.zip -U -qCreate a DSW instance.
For more information, see API overview.










