DSW (Data Science Workshop) provides a cloud-based IDE for AI development. Developers familiar with Notebook or VS Code can start model development immediately. This topic covers how to create a DSW instance and how to resolve common issues that occur when starting or releasing instances.
Quick start
Log in to the PAI console, select the target Region, click Workspaces, and go to the target workspace.
In the left navigation pane, choose Interactive Modeling (DSW)> Create Instance. Configure the following key parameters and leave the others as default. For all parameters, see Console parameter reference.
Parameter
Description
Instance Name
Example:
dsw_test.Resource Type
Select Public Resources, which uses pay-as-you-go billing.
Instance Type
Select a specification such as
ecs.gn7i-c8g1.2xlarge(1 A10 GPU, 8 vCPUs, 30 GiB memory).If this specification is out of stock, try another specification in the list or switch to a different region.
WarningIf you're using a DSW free trial resource voucher, make sure the selected specification is within the supported range (ecs.g6.xlarge, ecs.gn7i-c8g1.2xlarge, or ecs.gn6v-c8g1.2xlarge). Selecting an unsupported specification will prevent the voucher from being applied. For details, see Claim, use, and release free trial resources.
When the free quota is used up or expires, if the DSW instance is still running, the system automatically switches to pay-as-you-go billing and deducts fees from your account balance. Release the instance promptly to avoid unexpected charges.
Image config
Select Alibaba Cloud Image, then search for and select
modelscope:1.31.0-pytorch2.8.0-gpu-py311-cu124-ubuntu22.04(Python 3.11, CUDA 12.4).ModelScope images include a broad set of built-in third-party libraries and are compatible with most AI development workflows.
Click OK to create the instance. When the instance status changes to Running, the instance is created successfully.
If the instance fails to start, see DSW instance startup .
On the DSW instance list page, click Open under the Actions column to open the DSW instance and start developing your model.
For details on the DSW instance interface, and how to stop, release, or modify a DSW instance, see Access and manage DSW instances.
ImportantFor DSW instances created using public resources, billing starts the moment the instance status changes to Running—even if you don't open the web-based IDE or run any code.
Closing the browser or logging out doesn't stop the instance or pause billing.
If you're using a free trial resource voucher, the system automatically switches to pay-as-you-go billing after the quota runs out. The instance won't stop automatically.
Stop the instance. When you've finished your development work and no longer need the DSW instance, go back to the DSW instance list page:
To pause the instance temporarily, click Stop. If the system disk has been expanded, storage charges for the system disk continue even 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 cloud disk contents are cleared and cannot be recovered. Instances with an expanded system disk are not subject to this limit.
To permanently delete the instance, click More> Delete. This stops all billing. Back up any important data before deleting, as deleted data cannot be recovered.
ImportantDSW pay-as-you-go bills are generated hourly with a 2–3 hour delay. After stopping or deleting an instance, you may still receive charge notifications for a few hours for usage incurred before the action. This is normal billing behavior and doesn't indicate duplicate charges.
Typical use case configurations
The default DSW instance configuration may not meet all AI development requirements. The following table summarizes configurations for common scenarios:
Scenario | Challenge | Configuration | Reference |
Persistent code and data storage | The DSW instance system disk is temporary—data is cleared when the instance is deleted or stopped for an extended period. You need long-term storage for important files, or to share data across multiple instances. | Mount cloud storage (such as Object Storage Service (OSS)) to a specific directory in the instance using Dataset Mounting or Mount storage. | |
Faster public internet download speeds | The DSW instance uses a shared gateway by default, which limits bandwidth. This can slow down large file downloads. | In the network settings, configure a Virtual Private Cloud (VPC) and use Private Gateway. You also need to create a NAT gateway and an EIP (elastic IP address) for the VPC. | |
SSH-based remote development | You prefer using local tools such as VS Code or PyCharm for development and debugging, and don't want to be limited to the web-based IDE. | In the access settings, enable Enable SSH, fill in SSH Public Key, and select Access over Internet. Associate an existing NAT gateway and EIP. | |
Accessing web services inside the instance | You want to expose a web app running in the instance to the internet so it can be accessed or shared via URL. | In the access settings, add a Custom Services, configure the service port, and enable public access. You must also add an inbound rule in the security group to allow traffic on that port. |
Console parameter reference
Basic information
Parameter | Description |
Instance Name | Configure the instance name following the prompts on the page. |
Tag | Add labels to instances for multi-dimensional resource discovery, grouping, batch operations, and cost allocation. |
Resource information
Parameter | Description |
Resource Type |
|
Environment information
Parameter | Description |
Image Configuration | The following image types are supported:
|
System Disk | Used for storing files during development. When Resource Type is set to Public Resources, or when Resource Quota uses a subscription general computing resource (at least 2 CPU cores and 4 GiB memory, or with GPU), each instance includes a free 100 GiB cloud disk as the system disk. The disk can be expanded; see the console for pricing. Warning
For persistent storage, configure Dataset Mounting or Mount storage. |
Dataset Mounting | Store datasets for reading, or persist files generated during development. The following dataset types are supported:
Mount Path: The path where the dataset is mounted in DSW, for example Note
For more details on mounting, see Mount a dataset, OSS, NAS, or CPFS. |
Mount storage | Mount storage to read datasets or persist files generated during development.
For more details on mounting, see Mount a dataset, OSS, NAS, or CPFS. |
Enable Multi-Container Isolation (DinD) | When enabled, you can create multiple isolated sub-containers within the current instance. Suitable for multi-user DSW instance sharing. For details, see Sub-container management (DockerBoard). |
Working Directory | Available when public resources are selected. The working directory is the startup path for Notebook and the web-based IDE, and defaults to |
Network information
Parameter | Description |
VPC Settings | Available only when Resource Type is set to Public Resources. To use a DSW instance within a VPC, create a VPC in the same region as the DSW instance and configure this parameter. You must also configure vSwitch and Security Group. For configuration strategies for different scenarios, see Network configuration. |
vSwitch | Available when a VPC is configured. A vSwitch is a subnet within the VPC. Your DSW instance and other cloud resources connect through the vSwitch. |
Security Group | Required when a VPC is configured. The security group acts as a virtual firewall for the DSW instance, controlling all inbound and outbound network traffic. |
Internet Access Gateway | The following configuration methods are supported:
The following parameter is available only when Mount Configuration uses a CPFS dataset:
Note If a CPFS dataset is selected in the mount configuration, VPC configuration is required, and the VPC must match the CPFS VPC. |
Extended CIDR Block | Available after vSwitch is configured. Use an extended CIDR block to expand VPC address space when the available IP addresses are insufficient for growing workloads, or when initial network planning didn't allocate enough addresses. For more details, see Secondary CIDR blocks. |
Access configuration
Parameter | Description |
Enable SSH | Enables remote SSH access to the instance. Available after a VPC is selected. When enabled, a Custom Services named SSH appears. If using a custom image, make sure sshd is installed. |
SSH Public Key | Available after the SSH Configuration toggle is enabled. Note To support both VPC-based and public internet login, add public keys for multiple clients. Add keys one per line (pressing Enter between each). Up to 10 public keys are supported. |
Service Access and Port Configuration | Used for configuring SSH remote access or Access services in an instance over the public network.
|
Create Private Zone in VPC | Create a Private Zone (authoritative internal domain name) to access the instance's SSH service or other custom services within the VPC using a fixed domain name, instead of tracking a changing instance IP. Note: creating a Private Zone incurs charges. For pricing, see Alibaba Cloud DNS pricing. |
Public Network Access | NLB:
DNAT + EIP:
|
Roles and permissions
Parameter | Description |
Visibility | Select Visible to the Instance Owner or Visible to Current Workspace. |
Instance Owner | Only workspace administrators can change the instance owner. |
FAQ
DSW instance startup
DSW instance stop and release
DSW instance free trial
For information about claiming, using, and releasing DSW free trial resources, see Claim, use, and release free trial resources.
Appendix: Create an instance using the Python SDK
The Alibaba Cloud SDK uses the Credentials tool to retrieve credentials. Install and configure the tool before calling any API. Requirements:
Python 3.7 or later.
Alibaba Cloud SDK V2.0 generation.
Run the following command to install:
pip install alibabacloud_credentialsGet your account AccessKey. This example uses AccessKey credentials. To prevent credential leakage, configure your AccessKey as environment variables. Use
ALIBABA_CLOUD_ACCESS_KEY_IDfor the ID andALIBABA_CLOUD_ACCESS_KEY_SECRETfor the secret.For instructions on obtaining your AccessKey, see Create an AccessKey.
For instructions on setting environment variables, see Configure environment variables.
For other Credentials configuration methods, see Install the Credentials tool.
Install the PAI-related Python SDKs.
# Install workspace SDK. pip install alibabacloud-aiworkspace20210204 -U -q # Install DSW SDK. pip install alibabacloud_pai_dsw20220101 -U -q # OpenAPI dependency. pip install alibabacloud_tea_openapi -U -q # Install prepaid resource group query SDK. 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 information about additional APIs, see API overview.