Apsara File Storage NAS integrates with Platform for AI (PAI), letting you use a NAS file system to store data persistently during model training and deployment. This topic describes how to mount a NAS file system on a DSW instance in the console.
Prerequisites
-
You have activated Platform for AI (PAI) and created a default workspace. For details, see Activate PAI and create a default workspace.
-
You have activated the NAS service.
Activate the service from the NAS product page.
-
You have created a Virtual Private Cloud (VPC). To create one, go to the VPC console.
Step 1: Create a file system
If you already have a file system, skip this step.
-
Log on to the NAS console.
-
In the File System Selection Guide section of the Overview page, click Create below General-purpose NAS.
-
On the Create panel, configure the following parameters.
Parameter
Description
Region
The file system and the service to which it is mounted must be in the same region. This tutorial uses the China (Hangzhou) region as an example.
Zone
Select the zone of your vSwitch to avoid cross-zone latency. This tutorial uses Hangzhou Zone F as an example.
Storage Class
Advanced
Protocol Type
NFS
Recycle Bin
We recommend that you enable this feature. The recycle bin temporarily stores deleted files and directories, preventing accidental data loss.
Lifecycle Management
Configure this feature based on your business needs. We recommend that you keep this feature disabled.
Encryption Type
Not Encrypted.
Data Backup
Disabled.
Network Type
VPC.
VPC
Select your existing VPC from the drop-down list.
vSwitch
Select a vSwitch that is created in the VPC.
-
Click Buy Now and follow the on-screen instructions to complete the purchase.
Step 2: Create a DSW instance
Create a DSW instance with public resources and configure a NAS file system as a dataset.
-
Log on to the PAI console.
-
On the Overview page, select the target region.
-
In the left-side navigation pane, click Workspaces. On the Workspaces page, click the name of the workspace to manage.
-
On the Workspace Details page, choose in the left-side navigation pane.
-
On the Data Science Workshop (DSW) page, on the Instance tab, click Create Instance.
-
On the Create Instance page, configure the following key parameters, and leave the others at their default values. For more information, see Create a DSW instance.
Parameter
Description
Instance Name
Enter a custom instance name. This tutorial uses test_01 as an example.
Resource Type
Select Public Resources in pay-as-you-go mode.
Instance Type
Select GPU. The instance type is ecs.gn7i-c8g1.2xlarge.
Image config
Select an Alibaba Cloud Image such as
stable-diffusion-webui-develop:1.0-pytorch2.0-gpu-py310-cu117-ubuntu22.04.Storage Path Mounting
Click General-purpose NAS and configure the following parameters. Leave other parameters at their default values. For more information about datasets, see Create and manage datasets.
-
File System: Select the NAS file system that you created in the previous step.
-
Mount Target: Select a mount target for the file system.
-
File System Path:
/ -
Mount Path: /mnt/data/
Network Information
Security Group: Select an existing security group from the drop-down list.
Visibility
Select Visible to the Instance Owner
-
-
Click Yes.
The DSW instance takes about 10 minutes to create. After the instance is created, its status changes to Running.
Step 3: Verify the mount
-
Return to the DSW page. Find the instance you created and click Open in the Actions column.
-
In the top menu bar of the DSW instance page, click the Terminal tab. Then follow the on-screen instructions to open a terminal.
-
In the Terminal, run the following command to check whether the NAS dataset is mounted:
mount | grep nasIf the dataset is mounted, the command returns output similar to the following:
# mount | grep nas 0fdxxx3-1xxx1.cn-shanghai.nas.aliyuncs.com:/ on /mnt/data type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,noresvport,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.16.0.97,mountvers=3,mountport=2049,mountproto=tcp,local_lock=all,addr=172.16.0.97) #In the output, /mnt/data is the mount path that you specified when you created the DSW instance. Your data and code are stored persistently as long as the NAS file system and service are running.
Related documentation
-
For more information about DSW billing, see Billing of DSW.
-
When you use NAS for data storage, consider purchasing resource plans to offset storage fees. For more information, see Resource plans.
-
To release a NAS file system, see Release file system resources.
-
Apsara File Storage NAS also supports data storage in PAI-DLC (Deep Learning Containers) and PAI-EAS (Elastic Algorithm Service). For more information, see Create and manage datasets (DSW and DLC) and Advanced configurations for EAS: Mount service storage.
-
For more best practices for DSW, see Data Science Workshop (DSW).