After you develop an application, you can deploy the application in the application hosting platform Serverless App Engine (SAE). This topic describes how to deploy a Python application by using a ZIP package in the SAE console.
Prerequisites
- A virtual private cloud (VPC) is created. For more information, see Create a VPC.
- A namespace is created. For more information, see Create a namespace.
- An application package is created. For more information, see Create a ZIP package for a Python application.
Procedure
Log on to the SAE console.
In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click Create Application.
In the Basic Information step, configure the parameters and click Next: Application Deployment Configurations.
Parameter
Description
Application Name
Enter a custom application name.
VPC
Select a configuration method for the VPC. Valid values:
Custom Configuration: If you select this option, you must manually specify the namespace, VPC, vSwitch, and security group for the application that you want to create.
Automatic Configuration: If you select this option, SAE automatically specifies the namespace, VPC, vSwitch, and security group for the application.
Namespace
This parameter is required if you set the VPC parameter to Custom Configuration.
Select an existing namespace from the drop-down list. Namespaces and VPCs are in one-to-one mapping relationships. For information about how to modify a VPC, see Create and manage a VPC.
vSwitch
This parameter is required if you set the VPC parameter to Custom Configuration.
Click Select vSwitch. In the Select vSwitch dialog box, select the required vSwitches.
You must specify at least one vSwitch. We recommend that you specify no more than three vSwitches. Each vSwitch must match at least one application instance.
Security Group
This parameter is required if you set the VPC parameter to Custom Configuration.
Select a security group from the drop-down list. If you have not created a security group in your VPC, click Create Security Group to create a security group as prompted. For more information, see Create a security group.
Application Instances
Select the number of instances that you want to create.
VCPU
Select a CPU specification for the instances that you want to create.
Memory
Select a memory specification for the instances that you want to create.
Application Description
Enter a description for the application.
- In the Deployment Configurations step, configure the parameters.
- Configure the parameters that are used to deploy an application.
Parameter Description Technology Stack Programming Language Select Python. Application Deployment Method Select Deployment with ZIP Packages. Run components Select an environment from the Python environment drop-down list. File Upload method Select Upload Zip package or Zip package address. - Upload Zip package: Click Select File and select the ZIP package that you want to use
- ZIP Address: Enter the directory in which the ZIP package is stored.
Note- Format of the package name: The package name can contain only letters, digits, hyphens (-), and underscores (_), and the extension must be
.zip
. This format is the same as the name format of the WAR package and JAR package that are used to deploy Java applications. - Structure of the package directory: You must make sure that the requirements on the directory structure of the ZIP package are met. For more information, see Create a ZIP package for a Python application.
Version The version number of the application. Enter a version number or click Use timestamp as version number. Time zone settings Select the time zone of the application. Example: UTC+8. Custom installation module dependencies Select this option to install dependencies in the requirements.txt file in the root directory. If the package does not contain this file and you do not configure custom dependencies in the package, specify the dependencies that you want to install in the text box. - Optional:Configure the following advanced settings based on your business requirements.
Advanced setting
References
Startup Command Settings
Environment Variable Settings
Application Monitoring
Service Registration and Discovery
Hosts Binding Settings
Application Health Check
Application Lifecycle Management
Application Outbound/Inbound Internet Access
Log Collection Service
Persistent Storage
Configuration Management
- Configure the parameters that are used to deploy an application.
Click Next: Confirm Specifications.
In the Specification Confirmation step, view the details of the application and the fee for the selected specifications. Then, click Confirm.
The Creation Completed step appears. You can click Application Details to go to the Basic Information page of the application.
Verify whether the configurations have taken effect.
Method 1:
In the left-side navigation pane of the Basic Information page, click Change Records. On the Change Records page, view the change details. If Executed is displayed in the Change Status column, the application is deployed and the configurations have taken effect.
Method 2:
On the Basic Information page, click the Instance Deployment Information tab to view the Status of the instances. If Running is displayed in the Status column, the application is deployed and the configurations have taken effect.
References
The following table describes the operations that you can perform on an application after you deploy the application on SAE.
Operation | References |
Lifecycle management operations, such as updating, starting, stopping, and deleting an application, and scaling in or scaling out the instances for an application | |
Performance optimization operations, such as configuring auto scaling policies for an application, binding Server Load Balancer (SLB) instances to an application, and starting or stopping applications in batches | |
Application status-based operations, such as managing logs, configuring monitoring settings, viewing application events, and viewing change records |