Compute Nest uses file deployment packages to address software download challenges during script-based deployments, such as when cloud resources lack public internet access or download sources are unstable. This topic describes the use cases and principles of file deployment packages, and explains how to create and use them.
Background
-
Why use file deployment packages?
Compute Nest uses file deployment packages to address software download challenges caused by a lack of public internet access for cloud resources, large file sizes, or unstable sources. A service provider uploads a file to a specified OSS bucket. The system then automatically replicates the file to multiple regions. During deployment, it replaces a placeholder in the template with the private OSS URL of the deployment region, ensuring stable and secure data transfer.
-
What are the advantages of file deployment packages?
Service providers only need to add a placeholder to a template and configure the file association in the Compute Nest console.
-
File replication: Compute Nest copies the file uploaded by the service provider to a shared Compute Nest account. Within this account, the file is replicated to OSS buckets across multiple regions.
-
File association: Compute Nest recognizes the placeholder (
{{ computeneset::file::xxx}}) in a template and associates it with a file deployment package during service creation. When a user deploys the service, Compute Nest identifies the deployment region and automatically replaces the placeholder with the corresponding regional OSS URL, enabling dynamic URL substitution. -
Permission management: A deployment package inherits its permissions from the associated service. If a deployment package is not associated with any service, it is private. If it is associated with at least one public service, the deployment package becomes public. If it is associated with only private services, the deployment package remains private.
-
Private network downloads: Compute Nest downloads file deployment packages over a private network. When replacing the placeholder, Compute Nest generates a private OSS HTTP URL by default, which ensures a stable and secure download.
-
Usage
Define a placeholder in the service's ROS template and associate it with a file deployment package. When a service instance is created, Compute Nest automatically identifies the placeholder in the template and replaces it with the file URL corresponding to the service instance's deployment region.
The fixed expressions for the file association placeholder are as follows:
-
(Recommended) If the file URL of the deployment package is a private URL, use the following expression:
{{ computenest::file:: ${key}}}. -
If the file URL of the deployment package is a public URL, use the following expression:
{{ computenest::publicfile::${key}}}.NoteIn these expressions,
${key}can be any word but must not contain spaces.
The following YAML examples show how to use file deployment packages for deployment:
-
When defining a file association placeholder in a template, we recommend that you enclose the placeholder in single ('') or double ("") quotation marks.
-
If you use the
wgetcommand to download a file, we recommend adding the -O parameter to specify the output filename.
-
Define a placeholder in a standard template.
The following example shows how to define placeholders in the
userDatasection to download files and rename them toTestFirst.txtandTestSecond.tar.TiDBServer: Type: ALIYUN::ECS::InstanceGroup Properties: …… UserData: Fn::Sub: - | #!/bin/sh sleep 10 wget '{{ computenest::file::DemoFirst }}' -O TestFirst.txt wget '{{ computenest::file::DemoSecond }}' -O TestSecond.tar …… -
The database type
MigrateTaskdefines a flag.SQLDump: Type: ALIYUN::RDS::MigrateTask Properties: …… DBName: mytest DBInstanceId: Fn::GetAtt: - Database - DBInstanceId OssObjectPositions: {{ computenest::file::DemoFirst }}
Create and use file deployment packages
Prerequisites
Prepare the file that you want to upload.
Create a file deployment package
-
Configure basic information for the deployment package.
-
Log on to the Compute Nest console. In the left-side navigation pane, choose Service Deployment Package. On the Packages tab, click Create Deployment Package.
-
In the Basic Information section, configure the following parameters.
Parameter
Description
Deployment Package Name
The name can contain Chinese characters, English letters, digits, and underscores (_). The name must be 3 to 128 characters long, where a Chinese character counts as two characters. The deployment package name cannot be changed after creation.
Version Name
The name can contain Chinese characters, English letters, digits, and underscores (_). The name must be 3 to 50 characters long, where a Chinese character counts as two characters.
Description
The description must be 10 to 500 characters long. A Chinese character counts as two characters.
Resource Group
Select the resource group to which the deployment package belongs.
Resource groups allow you to group your cloud resources by usage, permissions, or ownership, enabling hierarchical resource management for multiple users and projects within an organization. For more information, see resource groups.
Tag Settings
Select or enter a complete tag key and tag value to add a tag to the deployment package. You can bind up to 20 tags to a resource. If no tag keys or values are available, you can create a custom tag. For more information, see Create and bind a custom tag.
-
-
Configure the file deployment package.
-
In the Deployment Package Content section, set Deployment Package Type to File.
-
Select the region to which you want to upload the file. Then, depending on the file size, select Upload Local File or Upload Flie Larger Than 5 GB.
-
(Optional) Use the Configure Script Command feature. Script commands are primarily used for service instance upgrades and are not required for file association.
-
In the Distribution Settings section, the file deployment package is distributed to all regions by default.
-
Click Publish Deployment Package.
After a deployment package is published, its current version cannot be modified. To make changes, you must create a new version or a new deployment package.
-
-
View the deployment package.
-
Return to the Service Deployment Packages page. Click the name of the deployment package to go to the Deployment Package Details page and view the deployment progress.
-
When the status changes to Available, click View to get the Distribution Results for the file deployment package.
The distribution results include the Distribution region and the corresponding distribution link, showing records for each region where the deployment package has been distributed, such as China (Beijing) and China (Ulanqab).
-
Use a file deployment package
This section uses creating a private service as an example to explain file deployment package configuration.
-
Log on to the Compute Nest console.
-
In the left-side navigation pane, click My Services. On the Created Services tab of the My Services page, click Create Service.
-
On the Create New Service page, select Custom launch as the creation method, select Private Service as the service type, and click Next: Configure Settings.
-
Enter the basic service information and select a ROS template.
If the ROS template contains
{{ computenest::file::test }}or{{ computenest::publicfile::test }}, you can Set File Association in the Deployment Package Association section. -
Click Deployment Package Association under Set File Association. In the dialog box that appears, select the deployment package and version, then click OK.
In the dialog box, the Association identifier field shows a value such as
{{ computenest::file::springboot }}, and only file-type deployment packages can be selected.After the configuration is complete, the Association identifier field displays the corresponding template variable (for example,
{{ computenest::file::springboo…), and the Associated deployment package field displays the name of the selected deployment package. -
After you create and test the service, test the service against the Compute Nest review criteria, and then submit it for review. For more information, see Review criteria.
-
After the service passes the review, publish the service. For more information, see Publish a service.
When a user creates a service instance, Compute Nest automatically replaces the placeholders in the template with the file URLs for the service instance's deployment region.
-
The following code shows the replacement result for placeholders in a standard template.
-
If the deployment package uses a private URL, the result is as follows:
Resources: ECSInstances: Type: 'ALIYUN::ECS::InstanceGroup' Properties: UserData: | #!/bin/sh mkdir /root/lzq cd /root/lzq wget 'https://computenest-artifacts-cn-wulanchabu.oss-cn-wulanchabu-internal.aliyuncs.com/xxx/cn-zhangjiakou/xxx/sample-text.txt' wget 'https://computenest-artifacts-cn-wulanchabu.oss-cn-wulanchabu-internal.aliyuncs.com/xxx/cn-guangzhou/xxx/changes.txt' wget {{DemoThird}} SystemDiskCategory: -
If the deployment package uses a public URL, the result is as follows:
Properties: UserData: | #!/bin/sh mkdir /root/lzq cd /root/lzq wget 'https://computenest-artifacts-cn-wulanchabu.oss-cn-wulanchabu.aliyuncs.com/xxx/cn-beijing/xxx/virtual-background-1976.jpg' wget {{DemoThird}} SystemDiskCategory: Ref: SystemDiskCategory VpcId:
-
-
In a
MigrateTaskof the database type, Compute Nest changes the URL of the file deployment package to the format of theOssObjectPositionsparameter.Because the OssObjectPositions parameter is composed of three parts separated by a colon (
:) (the OSS endpoint, the OSS bucket name, and the key of the backup file on OSS), Compute Nest converts the URL of a file deployment package into this format. For example:oss-ap-southeast-1.aliyuncs.com:rdsmssqlsingapore:autotest_2008R2_TestMigration_FULL.bak. For more information, see ALIYUN::RDS::MigrateTask.}, "OssObjectPositions": "oss-cn-hangzhou-internal.aliyuncs.com:computenest-artifacts-cn-hangzhou:xxx/cn-zhangjiakou/xxx/sample-text.txt", "DBInstanceId": { ... }
-
Related topics
-
For more information about how to create a Compute Nest service, see Create a service.
-
If you no longer need a deployment package or a specific version, you can delete it. For more information, see Delete a deployment package.
-
To change the distribution regions or content of a deployment package, you can create a new version. For more information, see Create a version.
-
To configure upgrade settings for a deployment package, see Configure service update settings.