Data Science Workshop (DSW) provides a cloud-based integrated development environment (IDE) for AI development. Developers who are familiar with Notebook or VS Code can quickly begin developing models. This topic describes how to create a DSW instance and provides solutions for common issues that may occur during instance startup and deletion.
Create a basic DSW instance quickly
Log on to the PAI console and select the target Region. In the navigation pane on the left, click Workspaces and select the target workspace.
In the navigation pane on the left, click Interactive Modeling (DSW) > Create Instance. Configure the following key parameters and use the default settings for the remaining parameters. For more information about the console parameters, see List of all console parameters.
Parameter
Description
Instance Name
Example:
dsw_test.Resource Type
Select Public Resources (pay-as-you-go billing).
Instance Type
Example:
ecs.gn7i-c8g1.2xlarge(1 × A10 GPU, 8 vCPUs, 30 GiB memory).If this instance type is out of stock, try to select 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 within the deductible range (ecs.g6.xlarge, ecs.gn7i-c8g1.2xlarge, or ecs.gn6v-c8g1.2xlarge). If you select an unsupported instance type, the fees cannot be deducted. For more information, see Claim, use, and release free trial resources.
After the 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 in a timely manner.
Image config
Select Alibaba Cloud Image. Search for and select
modelscope:1.31.0-pytorch2.8.0-gpu-py311-cu124-ubuntu22.04(Python 3.11, CUDA 12.4).ModelScope images are recommended because they offer good compatibility and a comprehensive set of third-party libraries.
Click OK to create the instance. The instance is successfully created when the instance status is Running.
If the instance fails to start, see DSW instance startup.
On the DSW instance list page, click Open in the Actions column to open the DSW instance and start model development.
For more information about the DSW instance UI and how to stop, delete, or change the configuration of a DSW instance, see Access and manage DSW instances in the console.
ImportantYou are billed by the hour for DSW instances that use public resources once the instance 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 stop billing.
If you use a free trial resource plan, the system automatically switches to the pay-as-you-go billing method after the quota of the resource plan is used up. The instance is not automatically stopped.
Stop the instance. When you finish your development task and no longer need the DSW instance, return to the DSW instance list page.
To pause the instance, click the Stop button to the right of the instance. Note: You will continue to be billed for a scaled-out system disk 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 content on the cloud disk is deleted and cannot be recovered. This restriction does not apply if the system disk has been expanded.
If you no longer need the instance, click More > Delete on the right side of the instance to stop all billing. Before you delete the instance, make sure to back up important data. Data cannot be recovered after the instance is deleted.
Configurations for typical application scenarios
A basic DSW instance may not meet all your AI development needs. The following table summarizes configurations for typical application scenarios.
Scenario | Need/Pain point | Configuration points | References |
Persistently storing code and data | The system disk of a DSW instance provides only temporary storage. Data is cleared if the instance is deleted or stopped for an extended period. You may need to save important files for long-term use or share data among multiple instances. | You can mount cloud storage, such as Object Storage Service (OSS), to a specified folder on the instance via Dataset Mounting or Mount storage. | Mount a dataset, OSS bucket, NAS file system, or CPFS file system |
Increasing the Internet download speed | By default, DSW instances use a shared gateway with limited bandwidth. The network speed may be insufficient for downloading large files. | In the Network Information section, configure the VPC to use a Private Gateway. You must also create a NAT Gateway and an EIP for the VPC. | Use a dedicated gateway to increase the public network access speed |
Developing remotely over SSH | You are accustomed to using local tools, such as VSCode and PyCharm, for development and debugging and do not want to be limited to the web IDE. | In the Access Configuration section, select Enable SSH, enter your SSH Public Key, select Access over Internet, and associate an existing NAT Gateway and EIP. | |
Accessing web services within the instance | You want to publish a web application that runs in the instance to the Internet so it can be accessed or shared through a URL. | In the access configuration, add and configure a Custom Services by specifying a service port and enabling public network access. You must also add a corresponding inbound rule to the security group to allow traffic on that port. |
List of all console parameters
Basic information
Parameter | Description |
Instance Name | Configure the instance name based on the on-screen instructions. |
Tag | Add tags to the instance as needed to facilitate multi-dimensional search, positioning, batch operations, and cost allocation for resources. |
Resource information
Parameter | Description |
Resource Type |
|
Environment information
Parameter | Description |
Image Configuration | The following image types are supported:
|
System Disk | Used to store files during the development process. When Resource Type is set to Public Resources, or when Resource Quota is set to subscription general computing resources (CPU cores ≥ 2 and memory ≥ 4 GB, or with a GPU), each instance is provided with a free 100 GiB cloud disk as a system disk. The cloud disk supports scale-out at the price displayed in the console. Warning
If you need permanent 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: Path where the dataset is mounted in the DSW instance, for example, Note
For more information about mounting, see Mount a dataset, OSS bucket, NAS file system, or CPFS file system. |
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 bucket, NAS file system, or CPFS file system. |
Working Directory | The working directory is the startup path for Notebook and WebIDE. The default is |
Network information
Parameter | Description |
VPC Settings | This parameter is available only when Resource Type is set to Public Resources. To use a DSW instance in a Virtual Private Cloud (VPC), create a VPC in the same region as the DSW instance and configure this parameter. You must also 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 is required when a VPC is configured. A security group is a virtual firewall for a DSW instance. It controls all inbound and outbound network traffic. |
Internet Access Gateway | The following configuration methods are supported:
The following parameters are available only when you select a CPFS dataset for Mount Configuration:
Note If a CPFS dataset is mounted, you must configure a VPC, and the selected VPC must be the same as the one used by CPFS. |
Extended CIDR Block | You can configure this parameter after you configure the vSwitch. When the number of available IP addresses in a virtual private cloud (VPC) is insufficient to meet your expanding business needs, or when poor initial network planning results in an address shortage, you can use a secondary CIDR block to expand the VPC address space. For more information, see Use a secondary CIDR block to expand the address space of a CIDR block. |
Access configuration
Parameter | Description |
Enable SSH | Enables remote connections to the instance and is configurable only after you select a virtual private cloud (VPC). When this option is enabled, a Custom Services named SSH is created. If you use a custom image, ensure that sshd is installed. |
SSH Public Key | You can configure this parameter after you enable the SSH Configuration switch. Note To support both VPC and public network logon, you must add public keys from multiple clients. Add each public key on a new line. You can add up to 10 public keys. |
Service Access and Port Configuration | Used to configure SSH remote access or access services in an instance over the Internet.
|
Create Private Zone in VPC | Creates an internal authoritative domain name (PrivateZone). You can use this domain name within the VPC to access the instance's SSH service or other custom services, avoiding the inconvenience of a changing instance IP address. Creating a PrivateZone domain name incurs charges. For more information, see Alibaba Cloud DNS Product Billing. |
Public Network Access | NLB:
DNAT + EIP:
|
Roles and permissions
Parameter | Description |
Visibility | Choose Visible to the Instance Owner or Visible to Current Workspace. |
Instance Owner | Only the workspace administrator can change the instance owner. |
FAQ
DSW instance startup
DSW instance stop or release
DSW instance free trial
For information about how to claim, use, and release DSW free trial resources, see Claim, use, and release free trial resources.
Appendix: Create an instance using a Python SDK
The Alibaba Cloud SDK uses the Credentials tool to obtain credential information. Before you call an API, you must install and configure the tool. The requirements are as follows:
Python 3.7 or later.
You can use the V2.0 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 your credentials from being exposed, we recommend that you configure the AccessKey as environment variables. The required variable names are
ALIBABA_CLOUD_ACCESS_KEY_IDandALIBABA_CLOUD_ACCESS_KEY_SECRET.For information about how to obtain AccessKey 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 SDKs.
# 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 about the APIs, see API overview.










