All Products
Search
Document Center

:Use local files to create edge applications

Last Updated:May 13, 2024

This topic describes how to use local files to create edge applications.

Prerequisites

A function is locally created. For more information, see Function Compute Guide.

Procedure

  1. Log on to the Link IoT Edge console.

  2. On the Applications page, click Create Application.

  3. On the page that appears, specify the parameters as prompted and click Confirm.
    • Application InformationEdge applications that are created based on local files (application information)
      Table 1. Parameters
      ParameterDescription
      Application NameThe name of the edge application. The application name must be 1 to 128 characters in length, and can contain letters, digits, and underscores (_).
      Application TypeThe method that is used to create the edge application. The valid values are described as follows:
      • Function Compute: This value indicates that the edge application is created by using Function Compute.
      • Container Image: This value indicates that the edge application is created by using Container Registry.
      • Local Upload: This value indicates that the edge application is created by using locally developed functions.

      In this example, select Local Upload.

      Programming LanguageThe programming language that you use to develop the function. The supported programming languages are Node.js, Python, and C.
      Important The functions that are created by using the Python programming language can be used only in edge instances of Link IoT Edge Pro Edition.
      Application VersionThe version number of the edge application. You cannot specify two identical version numbers for an edge application.
      Code PackageThe code file that you want to upload. To upload the code file that is locally created, click Upload File.
      Important You can upload only a file that is in the .zip file format.
      Version DescriptionThe description of the edge application version. For example, you can specify the version features. This parameter is optional.
    • Container Configurations

      Parameter

      Description

      Host Mode

      Specifies whether to isolate the container network from the host network. Valid values:

      • Yes: The container network is the same as the host network.

      • No: The container network is isolated from the host network. If you select this option, you must set the Network Port Mapping parameter.

      Network Port Mapping

      The mappings between host network ports and container network ports. This parameter is available only when you set the Host Mode parameter to No. The network where the function runs is isolated from the host network. You can map the listening port of the function in the container to a host network port. This allows client programs on various hosts to access the services that are provided by the function. You can specify a maximum of 10 entries.

      For example, the fc-http-server function runs in a host container, and provides services by using Port 80. The client programs on other hosts cannot access the fc-http-server function by accessing Port 80 on the current host. To enable the client programs on other hosts to access the fc-http-server function, you must map Port 80 in the container where the function runs to a host network port, such as Port 8080. Then, the client programs on other hosts can access IP address:port 8080 on the host network, and use the services provided by the fc-http-server function.

      Privilege Mode

      Specifies whether to enable the privilege mode. Root users of containers can access host services only as regular users. If you need to change the system time or run the mount command in containers, you must be granted the required root permissions. In this scenario, you must enable the privilege mode for the containers.

      Note

      If you enable the privilege mode, applications and programs in the containers are granted the host root permissions, and all the host devices are mapped to the containers. Therefore, you do not need to set the Device Mapping parameter.

      Device Mapping

      The device mappings. This parameter is available only when you set the Privilege Mode parameter to No. The network where the device management system resides is isolated from the host network. To enable a function to access a host device such as a serial port, you must map the device to the container where the function runs. You can specify a maximum of 10 entries.

      Volume Mapping

      The volume mappings. The network where the file system resides is isolated from the host network. To enable a function to access a host file, you must map the file to the container where the function runs. You can specify a maximum of 10 entries.

  4. View the edge application that you created on the Applications page. You can also click buttons in the Actions column to manage the edge application.

    Manage the edge application

    • Manage versions

      To manage versions, click Version Management. In the Version Management panel, you can create, modify, or delete versions based on your business requirements.

      Application version management

    • Delete the edge application

      To delete the edge application, click Delete.

      Note

      Before you delete the edge application, you must delete all versions of the edge application. Otherwise, the edge application cannot be deleted.

What to do next

You can assign the edge application that has been created to the edge instance. For more information, see Assign edge applications to edge instances.