All Products
Search
Document Center

Serverless App Engine:Use an image to deploy a Python application in the SAE console

Last Updated:Nov 05, 2024

Serverless App Engine (SAE) allows you to deploy applications by using images, such as images that belong to your Alibaba Cloud accounts, private images that belong to other Alibaba Cloud accounts, demo images, and public images that can be accessed over the Internet. This topic describes how to use an image to deploy a Python application in the SAE console.

Prerequisites

(Optional) Configure image synchronization in the Container Registry console

If the Alibaba Cloud image repository that you want to use does not reside in the same region as your application, you must use the image replication feature of Container Registry to replicate the image repository to the region where the application resides before you deploy the application.

  1. Log on to the Container Registry console.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Instances.

  4. On the Instances page, click the Enterprise Edition instance that you want to manage.

  5. In the left-side navigation pane of the management page of the Enterprise Edition instance, choose Repository > Repositories.

  6. On the Repositories page, click the name of the repository in which the images to be replicated reside.

  7. In the left-side navigation pane of the details page of the image repository, click Tags. On the page that appears, find the image that you want to replicate and click Replicate in the Actions column that corresponds to the image.

  8. In the Image Replication dialog box, set Replication Scenario to Same Account, select the region where the destination instance resides and select the name and namespace of the destination instance. Enter the name of the destination repository and the image tag, specify whether to overwrite the existing image that has the same name as the pushed image, and then click OK.

    • In the left-side navigation pane of the management page of the Container Registry Enterprise Edition instance, choose Distribution > Replication Record. On the Replication Record page, the status of the replication task is displayed as Completed. If the manual replication is successful, the image appears in the destination instance.

    • After the image replication is completed, the image repository that you selected in the Container Registry console is synchronized to the specified destination repository. Then, you can select the image in the Deployment Configurations step when you deploy an application in the SAE console.

Deploy an application

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click Create Application.

  3. 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.

  4. In the Deployment Configurations step, configure the parameters.

    1. Configure the parameters that are used to deploy an application.

      Parameter

      Description

      Technology Stack Programming Language

      Select Python.

      Application Deployment Method

      Select Image.

      Configure Image

      Select the type of image that you want to use.

      • Images of Current Alibaba Cloud Account: Select an image that is uploaded to Container Registry within your Alibaba Cloud account and the version of the image.

        • Container Registry Personal Edition: Configure the Image Repository Namespace and the Image Repository Name parameters to filter images.

        • Container Registry Enterprise Edition: Select a Container Registry Enterprise Edition instance from the drop-down list.

          Note
      • Demo Image: Select a version of a demo image from the drop-down list.

      • Public Image: Enter the full URL of a public image that can be accessed over the Internet. Make sure that the VPC can be accessed over the Internet.

      • Private Images of Other Alibaba Cloud Account: Configure the Container Registry Edition and Image Type parameters. Then, configure the related parameters.

    2. Optional:Configure the following advanced settings based on your business requirements.

  5. Click Next: Confirm Specifications.

  6. 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.

  7. 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

Manage the lifecycle of 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