DSW instances in China may fail to access overseas resources such as Hugging Face models or Docker images. Create a Global Accelerator (GA) instance to enable DSW to access models and images across domains.
Important
Use network resources responsibly. You cannot access websites that contain illegal information.
Billing
GA is billed separately. Fees include instance fees, capacity unit (CU) fees, and data transfer fees. For more information, see Global Accelerator Billing.
Procedure
The following steps accelerate access to Hugging Face and Docker. Adjust the settings as needed. The table below lists the domain names that require acceleration.
|
Resource to accelerate |
Domain names to accelerate |
|
Hugging Face |
|
|
Docker |
|
Step 1: Create a standard Global Accelerator instance
Only key configurations are described here. For all parameters, see Create and manage standard Global Accelerator instances.
-
To create a standard instance, activate Global Accelerator and log on to the console. Click Create Standard Pay-as-you-go Instance. Configure basic information, such as the instance name, and click Next.

-
In the Acceleration Area section, select the region of your DSW instance, specify the bandwidth, and click Next.

-
Enter a listener name. Set Protocol to TCP and Port to
80,443. Adjust as needed.
-
Configure the endpoint.
-
Region: Select a region outside China. US (Silicon Valley) is recommended.
-
Endpoint Configuration: Configure a domain name for acceleration. To add more domain names, create virtual endpoint groups.
-
Set Backend Service Type to Custom Domain Name.
-
For Backend Service, enter the domain name that you want to accelerate, such as
huggingface.co. -
Use the default value for Weight.
-

-
-
Review the settings and click Submit.

Step 2: Add virtual endpoint groups and configure forwarding rules
-
In the left-side navigation pane, click Standard Instances > Instances. Click your instance name, then click the Listeners tab.

-
Click the listener name to open its configuration page, then click the Endpoint Group tab. The default endpoint group for
huggingface.cofrom Step 1 is already listed.
Add a virtual endpoint group for each additional domain name:
cdn-lfs.hf.co,docker.io,registry-1.docker.io, andauth.docker.io. Click Add Virtual Endpoint Group.-
Set Backend Service Type to Custom Domain Name.
-
For Backend Service, enter the domain name that you want to accelerate.
-
Use the default value for Weight.

Repeat for the remaining domain names. After completion, five virtual endpoint groups are displayed.

-
-
On the listener configuration page, click the Forwarding Rule tab. For each domain name, click Add Forwarding Rule.
-
Domain Matching Rule: Exact Match.
-
Forwarding Domain: Enter the domain name to accelerate.
-
Forward to: Select the endpoint group type and endpoint group that correspond to the domain name.

After completion, five forwarding rules are displayed:

-
Step 3: Use Global Accelerator in DSW
|
Acceleration method |
Method 1: Accelerate access by modifying the hosts file of the DSW instance |
|
|
Scenarios |
Retrieve overseas models or resources in an existing DSW instance. |
Create a DSW instance with an overseas image. Retrieve overseas models or resources in a DSW instance. |
|
VPC, security group, and vSwitch required? |
Optional |
Required |
|
Dedicated gateway and SNAT required? |
Optional. For large file downloads with insufficient speed, use a dedicated gateway to improve public network access speed. |
|
Method 1: Accelerate access by modifying the hosts file of the DSW instance
-
In the Global Accelerator console, click your instance name. On the Acceleration Areas tab, copy an Accelerated IP Address.

-
Open the DSW web UI. In the Terminal, run
vim /etc/hosts. Add the accelerated IP address and the domain names to accelerate, then save and exit. Example format:
Method 2: Accelerate access using PrivateZone
-
In the Global Accelerator console, click your instance name. On the Instance Information tab, copy the CNAME.

-
Find the VPC of your DSW instance. For an existing instance, click the instance name and check the Instance Settings page.

-
Log on to the Alibaba Cloud DNS console. In PrivateZone, go to User Defined Zones and click Add Zone.
To use
huggingface.coandcdn-lfs.hf.co, first configure the built-in authoritative domainco. In Effective in VPCs, select the VPC of your DSW instance from step 2. Click OK.If you have not yet created the DSW instance, select this VPC when creating it.

Click the built-in authoritative domain co to open its configuration page, then click Add Record. Because
huggingface.coandcdn-lfs.hf.coshare the authoritative domainco, add a DNS record for each.-
Set the Record Type to CNAME.
-
For Hostname, enter the host portion of the domain name, such as
huggingfaceorcdn-lfs.hf. -
For Record Values, enter the GA CNAME copied in step 1.

Repeat for
docker.io,registry-1.docker.io, andauth.docker.io. After completion, two Built-in Authoritative Domain Names are displayed.

-
References
-
If network speed is insufficient, use a dedicated gateway to improve public network access speed.
-
For DSW network access and configuration scenarios, see Network configuration.