Mirror construction method, system and computer readable storage medium

CN115904407BActive Publication Date: 2026-10-30NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211369800.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2026-10-30
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

[0004]上述方案由于需要云端提供大量服务器来分别针对不同边缘计算场景进行镜像构建,使得云端需要耗费大量的资源,镜像构建的构建成本较高

Benefits of technology

[0019]本申请提供的镜像构建方法,通过控制节点获取待构建镜像的目标应用程序的镜像配置信息,镜像配置信息包括:目标应用程序的镜像构建信息、待构建镜像的目标运行环境信息,镜像构建信息包括所述目标应用程序的应用信息,控制节点再将镜像构建信息发送给目标运行环境对应的目标镜像构建节点,目标镜像构建节点基于镜像构建信息获取目标应用程序的代码,并根据代码进行镜像构建,得到目标应用程序对应的镜像。本申请实施例中,由于目标运行环境信息为用于运行待构建镜像的目标边缘计算节点的运行环境信息,即待构建镜像是为目标边缘计算节点构建的,而一个边缘计算节点对应有一个与之运行环境相一致的镜像构建节点,这样,当开发人员想要构建目标边缘计算节点能够运行的镜像时,使控制节点获取到该目标边缘计算节点的运行环境信息,即可在与目标边缘计算节点的运行环境一致的目标镜像构建节点上构建目标应用程序对应的镜像,所构建出的镜像也就能够在目标边缘计算节点上运行。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115904407B_ABST
    Figure CN115904407B_ABST
Patent Text Reader

Abstract

The application discloses a mirror image construction method, a system and a computer readable storage medium. The method is applied to a mirror image construction system, the system comprises a control node and a plurality of mirror image construction nodes. Each mirror image construction node in the system corresponds to an edge computing node with different running environments in an edge computing system. The running environment of the mirror image construction node is consistent with the running environment of the corresponding edge computing node. The control node acquires mirror image configuration information of a target application program to be constructed. The mirror image configuration information comprises mirror image construction information of the target application program and target running environment information of the mirror image to be constructed. The control node sends the mirror image construction information to a target mirror image construction node corresponding to the target running environment information. The target mirror image construction node acquires the code of the target application program and performs mirror image construction to obtain the mirror image. The scheme provided by the application can reduce the number of cloud servers and reduce the construction cost of mirror image construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to an image construction method, system, and computer-readable storage medium. Background Technology

[0002] With the continuous development of computer technology, cloud computing has been widely applied. In cloud computing, all data is typically processed centrally on cloud servers, leading to high computational pressure and slow processing speeds. To alleviate this pressure, edge computing technology can be employed. Edge computing refers to setting up edge computing servers closer to the user end than the data source, thus providing the nearest service to the user. Applications in edge computing scenarios are initiated by edge computing servers, resulting in faster network service responses for users. Developing applications for edge computing scenarios requires continuous development, deployment, and testing to create various applications suitable for different device environments. To improve development efficiency, developers can package the application and its dependencies into a portable image file. Running this image file generates a virtual container image, and the application runs within this virtual container image just as if it were running on a real server. This method of packaging the application's runtime environment makes application deployment more convenient and the setup of application testing environments more flexible.

[0003] In related technologies, developers typically build application images centrally in the cloud for edge computing scenarios. Since the edge operating environments in edge computing scenarios are often different (e.g., CPU architecture, dependency libraries, etc.), the successful execution of an image depends on whether the build environment and the edge operating environment are identical. For example, an image built on an x86 Intel CPU architecture device cannot run on an edge operating environment with an ARM64 CPU architecture. Therefore, when building images centrally in the cloud, the cloud typically includes separate cloud servers for each edge operating environment.

[0004] The above solution requires a large number of servers in the cloud to build images for different edge computing scenarios, which consumes a lot of cloud resources and results in high image building costs. Summary of the Invention

[0005] This application provides an image building method, system, and computer-readable storage medium that can reduce the number of cloud servers, thereby reducing the build cost of image building. The specific solution is as follows.

[0006] In a first aspect, embodiments of this application provide an image building method applied to an image building system. The image building system includes: a control node and multiple image building nodes. Each image building node in the image building system corresponds to an edge computing node in an edge computing system with a different operating environment. The operating environment of the image building node is consistent with the operating environment of the corresponding edge computing node. The method includes:

[0007] The control node acquires the image configuration information of the target application to be built; the image configuration information includes: the image building information of the target application and the target runtime environment information of the image to be built. The image building information includes the application information of the target application, and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built.

[0008] The control node sends the image building information to the target image building node corresponding to the target runtime environment information;

[0009] The target image building node obtains the code of the target application based on the image building information, and builds the image according to the code to obtain the image corresponding to the target application.

[0010] Secondly, embodiments of this application provide an image building system, the system comprising:

[0011] An acquisition unit is applied to a control node in the image building system. The acquisition unit is used to acquire the image configuration information of the target application to be built. The image configuration information includes: image building information of the target application and target runtime environment information of the image to be built. The image building information includes application information of the target application, and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built.

[0012] A sending unit is applied to the control node in the image building system. The sending unit is used to send the image building information to the target image building node corresponding to the target running environment. The image building system includes multiple image building nodes. Each image building node in the image building system corresponds to an edge computing node with a different running environment in the edge computing system. The running environment of the image building node is consistent with the running environment of the corresponding edge computing node.

[0013] A build unit is applied to the target image build node in the image build system. The build unit is used to obtain the code of the target application based on the image build information, and to build the image according to the code to obtain the image corresponding to the target application.

[0014] Thirdly, this application also provides an image building system, which includes: a control node and multiple image building nodes. Each image building node in the image building system corresponds to an edge computing node with a different operating environment in the edge computing system. The operating environment of the image building node is consistent with the operating environment of the corresponding edge computing node.

[0015] The control node is used to obtain the image configuration information of the target application to be built and send the image building information to the target image building node corresponding to the target runtime environment. The image configuration information includes: the image building information of the target application and the target runtime environment information of the image to be built. The image building information includes the application information of the target application and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built.

[0016] The target image building node is used to obtain the code of the target application based on the image building information, and to build the image according to the code to obtain the image corresponding to the target application.

[0017] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a data processing program that is executed by a processor to perform the method described in any of the first aspects.

[0018] Compared with the prior art, this application has the following advantages:

[0019] The image building method provided in this application obtains the image configuration information of the target application to be built through a control node. The image configuration information includes: image building information of the target application and target runtime environment information of the image to be built. The image building information includes the application information of the target application. The control node then sends the image building information to the target image building node corresponding to the target runtime environment. The target image building node obtains the code of the target application based on the image building information and builds the image according to the code to obtain the image corresponding to the target application. In the embodiments of this application, since the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built, that is, the image to be built is built for the target edge computing node, and one edge computing node corresponds to one image building node with the same runtime environment, when the developer wants to build an image that can run on the target edge computing node, the control node obtains the runtime environment information of the target edge computing node, and can build the image corresponding to the target application on the target image building node with the same runtime environment as the target edge computing node. The built image can then run on the target edge computing node.

[0020] As can be seen, the image building method provided in this application provides each edge computing node with an image building node that has the same operating environment as it, and provides a unified control node to control image building. In this way, when building an image, the control node can select the corresponding image building node for distributed image building according to the image configuration information, so that the cloud does not need to provide a large number of servers for image building, reducing the pressure on the cloud and thus reducing the building cost of image building.

[0021] Furthermore, in this embodiment of the application, image building is performed by providing image building nodes with the same operating environment as each edge computing node. This eliminates the need to simulate the corresponding operating environment based on the CPU architecture, dependent libraries, kernel version, etc., of the actual running node of the image to be built when building an application image, thereby improving the efficiency of image building. Attached Figure Description

[0022] Figure 1 This is an application scenario architecture diagram of the image building method provided in the embodiments of this application;

[0023] Figure 2 This is a flowchart of the image building method provided in the embodiments of this application;

[0024] Figure 3 This is another architecture diagram of the image building system provided in the embodiments of this application;

[0025] Figure 4 This is an example structural block diagram of the image building system provided in the embodiments of this application;

[0026] Figure 5 This is another example of a structural block diagram of the image building system provided in the embodiments of this application;

[0027] Figure 6 This is a schematic diagram of the data structure of the image building system provided in the embodiments of this application. Detailed Implementation

[0028] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0029] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0030] With the continuous development of computer technology, cloud computing has been widely applied. In cloud computing, all data is typically processed centrally on cloud servers, leading to high computational pressure and slow processing speeds. To alleviate this pressure, edge computing technology can be employed. Edge computing refers to setting up edge computing servers closer to the user end than the data source, thus providing the nearest service to the user. Applications in edge computing scenarios are initiated by edge computing servers, resulting in faster network service responses for users. Developing applications for edge computing scenarios requires continuous development, deployment, and testing to create various applications suitable for different device environments. To improve development efficiency, developers can package the application and its dependencies into a portable image file. Running this image file generates a virtual container image, and the application runs within this virtual container image just as if it were running on a real server. This method of packaging the application's runtime environment makes application deployment more convenient and the setup of application testing environments more flexible.

[0031] In related technologies, developers typically build application images in a centralized manner in the cloud for edge computing scenarios. Since the edge operating environments of edge computing scenarios are often different, such as CPU architecture and dependency libraries, whether the image can run successfully depends on whether the build environment during image building is the same as the edge operating environment. For example, an image built on an X86 Intel CPU architecture device cannot run on an edge operating environment device with an ARM64 CPU architecture.

[0032] Therefore, when building images in a centralized manner in the cloud, the cloud typically includes individual cloud servers for each edge operating environment.

[0033] The above solution requires a large number of servers in the cloud to build images for different edge computing scenarios, which consumes a lot of cloud resources and increases the construction cost of image building.

[0034] Alternatively, developers can build application images for various edge computing scenarios locally. In order for the built images to run on machines with different CPU architectures, developers usually need to use QEMU for instruction translation and simulate various edge operating environments to build the images. This method of image building also leads to higher costs and lower performance.

[0035] For the reasons mentioned above, in order to reduce the number of cloud servers and lower the construction cost of image building, the first embodiment of this application provides an image building method. The method is applied to an image building system, which includes a control node and multiple image building nodes. Each image building node in the image building system corresponds to an edge computing node with a different operating environment in the edge computing system. The operating environment of the image building node is consistent with the operating environment of the corresponding edge computing node.

[0036] To more clearly illustrate this application, the following describes the application scenarios of the image building method provided in the embodiments of this application.

[0037] like Figure 1The diagram shown is an application scenario architecture diagram of the image building method provided in this application embodiment. This application scenario can include an image building system 101, an edge computing system 104, and a cloud server. The image building system 101 includes a control node 102 and multiple image building nodes 103. The edge computing system 104 can include multiple edge computing clusters. Each edge computing cluster can include at least one edge computing node. Each edge computing node in the edge computing system 104 is connected to the cloud server through a communication network. One edge computing cluster in the edge computing system 104 corresponds to one image building node in the image building system 101. All edge computing nodes in an edge computing cluster have the same operating environment. The corresponding edge computing cluster and the image building node have the same operating environment. The control node 102 is connected to the multiple image building nodes 103 through a communication network, and the control node 102 is also connected to the edge computing system 104 through a communication network. Control node 102 can be a cloud server, providing computing, storage, and other services in the cloud. Control node 102 can also be a standalone node providing image building services for each edge computing node in the edge computing system, including but not limited to desktop computers, laptops, mobile phones, tablets, servers, and terminal devices. Image building node 103 can be servers or other devices providing computing and storage functions at the edge. Edge computing nodes include, but are not limited to, desktop computers, laptops, mobile phones, tablets, servers, and terminal devices. The communication network can be a wireless network or a wired network, such as a wireless local area network (WLAN), local area network (LAN), cellular network, 2G network, 3G network, 4G network, or 5G network. Control node 102 and multiple image building nodes 103 or multiple edge computing nodes can be interconnected through different communication networks.

[0038] It is understood that the above application scenario example is merely one application scenario embodiment of the image building method provided in this application. The purpose of providing this application scenario embodiment is to facilitate understanding of the image building method provided in this application, and it is not intended to limit the method provided in this application. For a detailed description of the method involved, please refer to the following embodiments.

[0039] like Figure 2 As shown, the image construction method provided in this application embodiment includes the following steps 201 to 203.

[0040] Step 201: The control node obtains the image configuration information of the target application to be built.

[0041] The image configuration information includes: image building information of the target application and target runtime environment information of the image to be built. The image building information includes the application information of the target application; the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built.

[0042] In practical implementation, when developers build an image of the target application, they can access the control node in the image building system through any node. This node can be a developer's local node or one of multiple image building nodes in the image building system described in this application. The control node can be a cloud server that communicates with each edge computing node in the edge computing system via network, or it can be a separate node that provides image building-related services to each edge computing node in the edge computing system. Specifically, the control node has numerous components that can display an image configuration page and provide services such as platform management, user permission management, and project management. Developers can then select image configuration information on the image configuration page, specifically the image building information of the target application and the target runtime environment information of the image to be built. The image building information of the target application includes the application information of the target application. The application information of the target application can be the code of the target application, which can be code stored locally by the developer. In this case, when the developer accesses the control node to select image configuration information, the locally stored code can be sent from the local node to the control node.

[0043] Understandably, the target runtime environment information for the image to be built refers to the runtime environment information of the edge computing node on which the image will actually run after it is built. The runtime environment may include, but is not limited to, the node identifier of the target runtime node, the CPU architecture of the target runtime node, dependent libraries, GPU, kernel version, operating system type, and database type. Specifically, the node identifier of the target runtime node may include information such as the region, project, or department of the target runtime node; the CPU is the central processing unit, a core component in electronic devices, and the CPU architecture may include, but is not limited to, ARM architecture, x86 series / Atom processors, MIPS processors, and PowerPC processors; the kernel version refers to the version number of the corresponding software kernel after each modification or addition of corresponding functions. The kernel mainly refers to the core functional framework of the operating system or corresponding software, which is the foundation for implementing all the functions of the software; the operating system is a collection of system software that manages computer hardware resources, controls the operation of other programs, and provides an interactive interface for users. Currently popular operating system types include Android, BSD, iOS, Linux, Mac OS X, Windows, Windows Phone, and z / OS; a database is a repository that organizes, stores, and manages data according to data structures.

[0044] In this way, the control node can obtain image configuration information containing application information of the target application and target runtime information of the image to be built. Different image configuration information for different images to be built can be uniformly sent to the control node.

[0045] Step 202: The control node sends the image build information to the target image build node corresponding to the target runtime environment information.

[0046] Understandably, the runtime environment of the target image building node is consistent with the runtime environment of the target edge computing node running the image to be built. This ensures that the image built based on the target image building node can run normally on the target edge computing node. Specifically, an electronic device can be prepared as an image building node for an edge computing node serving as an edge runtime environment. That is, multiple edge computing nodes with the same edge runtime environment correspond to one image building node. When building an image of a target application for an edge computing node, the control node can select the corresponding image building node with the same runtime environment for that edge computing node to perform image building.

[0047] Typically, all edge computing nodes in an edge computing cluster operate in the same environment, meaning that an edge computing cluster corresponds to the same operating environment. However, different edge computing clusters may have the same or different operating environments. When two edge computing clusters have the same operating environment, the same image building node can be configured for these two edge computing clusters to build images of each edge computing node in the two edge computing clusters. However, in most cases, different edge computing clusters have different operating environments. This application embodiment uses the example of different edge computing clusters having different operating environments.

[0048] As one implementation method, when developers prepare image build nodes for an edge computing cluster, they can add environment identifiers to the image build nodes. This allows the control node to quickly locate the corresponding image build node by using its environment identifier when selecting the image build node based on the image configuration information, thereby improving image build efficiency. Specifically, developers can add the runtime environment attributes of the edge computing cluster to the image build nodes. Image build nodes with added environment identifiers can be considered nodes specifically designed for image building of the edge computing cluster corresponding to those runtime environment attributes. Runtime environment attributes name and label the actual edge computing scenario and can include, but are not limited to, information such as region, department, and project.

[0049] In a specific implementation, the environment identifier of the image building node can be consistent with the target runtime environment information in the image configuration information. For example, when the environment identifier of the image building node of edge cluster 1 is City A - Project B, the target runtime environment information in the image configuration information corresponding to the image built by a certain image building node in edge cluster 1 is also City A - Project B; when the environment identifier of the image building node of edge cluster 1 is ARM architecture CPU, the target runtime environment information in the image configuration information corresponding to the image built by a certain image building node in edge cluster 1 is also ARM architecture CPU. On the control node, the target runtime information of each edge computing node corresponding to the control node can be deployed. In this way, when the developer selects the image configuration information and submits the image configuration information, the control node can quickly build the image on the image building node with the corresponding environment identifier according to the target runtime environment information of the image to be built in the image configuration information. There is no need to provide a server in the cloud to build the image to be built, which reduces the resource consumption in the cloud and improves the efficiency of image building.

[0050] Step 203: The target image building node obtains the code of the target application based on the image building information, and builds the image according to the code to obtain the image corresponding to the target application.

[0051] When the target application code in the image configuration information is locally stored, the target image build node can access the node storing the code to pull the code. Alternatively, the control node can obtain the target application code when receiving the selection in the image configuration information and send the code to the target image build node. When the code is stored on a cloud server, the image build node can access the cloud server to pull the code. This application does not specifically limit the implementation of this method.

[0052] After obtaining the target application's code, the image build node builds an image based on that code. In a specific implementation, the image build node can have a container runtime environment. During image building, a Docker-in-Docker approach can be used. Docker-in-Docker deploys only the Docker command-line tool (as a client) within the container, while actual execution is handled by the Docker-engine (server) on the host machine. Essentially, Docker-in-Docker mounts the host's docker.sock into the container, enabling Docker within the container to operate on the host machine's Docker container.

[0053] Containers are a lighter and more flexible form of virtualization. Container technology encapsulates and isolates processes, belonging to the operating system level of virtualization. Due to their lightweight and flexible advantages, containers are increasingly being applied in edge computing. Currently, Docker is the most mainstream open-source application container engine, allowing developers to package their applications and corresponding dependencies into a portable image file. By running this image file, a virtual container image is generated. The application runs within this virtual container image just as if it were running on a real server. This method of packaging the application's runtime environment makes application deployment more convenient and the setup of application testing environments more flexible. After being packaged into a container image, an application can run in any environment, including physical servers, virtual machines, public clouds, and private clouds.

[0054] In this way, the image building node can pull code, compile code, and build the image all within the Docker container, without relying on other continuous integration tools, avoiding complex tool configuration processes, and thus improving the efficiency of image building.

[0055] Optionally, image configuration information may include Dockerfile information. A Dockerfile is a text file used to build an image, containing the instructions and descriptions required for the image build process. In this way, the image build node first compiles the target application's code, generating a compiled code output file, and then uses this output file and the Dockerfile to create the target application image.

[0056] Specifically, Dockerfile information can be presented in two ways: Method 1: Developers can pre-create a Dockerfile on the image build node to customize the image. Then, in the directory where the Dockerfile is stored, the `docker build` command is executed to build the image. In this case, the Dockerfile information in the image configuration can specifically be the Dockerfile path. Method 2: Developers can define the content of the Dockerfile in the image configuration information. This means the Dockerfile information can specifically be the detailed content of the Dockerfile. The image build node can then generate the necessary Dockerfile for building the image based on the Dockerfile information in the image configuration, and then perform the image build.

[0057] Table 1 shows several commonly used Dockerfile instructions and brief descriptions provided by examples in this application.

[0058] Table 1. Several commonly used Dockerfile instructions and their brief introductions

[0059]

[0060]

[0061] The image building method provided in this application obtains the image configuration information of the target application to be built through a control node. The image configuration information includes: image building information of the target application and target runtime environment information of the image to be built. The image building information includes the application information of the target application. The control node then sends the image building information to the target image building node corresponding to the target runtime environment. The target image building node obtains the code of the target application based on the image building information and builds the image according to the code to obtain the image corresponding to the target application. In the embodiments of this application, since the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built, that is, the image to be built is built for the target edge computing node, and one edge computing node corresponds to one image building node with the same runtime environment, when the developer wants to build an image that can run on the target edge computing node, the control node obtains the runtime environment information of the target edge computing node, and can build the image corresponding to the target application on the target image building node with the same runtime environment as the target edge computing node. The built image can then run on the target edge computing node.

[0062] As can be seen, the image building method provided in this application provides each edge computing node with an image building node that has the same operating environment as it, and provides a unified control node to control image building. In this way, when building an image, the control node can select the corresponding image building node for distributed image building according to the image configuration information, so that the cloud does not need to provide a large number of servers for image building, reducing the pressure on the cloud and thus reducing the building cost of image building.

[0063] Furthermore, in this embodiment of the application, image building is performed by providing image building nodes with the same operating environment as each edge computing node. This eliminates the need to simulate the corresponding operating environment based on the CPU architecture, dependent libraries, kernel version, etc., of the actual running node of the image to be built when building an application image, thereby improving the efficiency of image building.

[0064] Optional, such as Figure 3 The diagram shown is another architecture diagram of the image building system provided in this application embodiment. The application information of the target application in the image configuration information in step 201 may also include the code storage address of the target application. Therefore, the image building system 101 may also include a code storage node 301 for storing the code of each application.

[0065] It is understood that the code storage node can be the control node in the image building system, or it can be a node that has a communication network connection with each image building node 103 in the image building system. This embodiment does not specifically limit it.

[0066] The code storage node stores the code of each application; that is, code repositories are deployed on the code storage node to store the code of each application. Among them, GitHub / GitLab are currently the mainstream code repositories. GitHub is a hosting platform for open-source and private software projects. As more and more applications move to the cloud, GitHub has become the preferred method for managing software development and discovering existing code. GitLab is an open-source project for repository management systems, using Git as the code management tool and building a web service on top of it. The code repositories on the code storage node can also be other types of code repositories; this application does not specifically limit this.

[0067] In this way, the image build node can quickly pull the target application's code from the corresponding code storage node based on the code storage address in the image configuration information. Specifically, the code storage address in the image configuration information can also be the code repository information on the code storage node, including but not limited to the name and address path of the code repository on the code storage node.

[0068] Optionally, the application information of the target application in the image configuration information in step 201 may also include the target branch of the target application's image to be built.

[0069] Understandably, the target branch indicates the code branch corresponding to the application. The image build node pulls the corresponding code branch from the code repository deployed on the code storage node based on the target branch in the image configuration information, and builds the image corresponding to that branch based on the pulled code branch. In this way, developers can build the corresponding image according to their needs.

[0070] Optionally, prior to step 201, the image building method provided in this application may also include step 201-1.

[0071] Step 201-1: The first image building node in the image building system obtains the image configuration information of the target application to be built and sends the image configuration information to the control node in the image building system.

[0072] As one implementation method, developers can access the control node through one of multiple image build nodes (the first image build node) to select image configuration information (i.e., publish an image build task). In this case, the first image build node is not necessarily the target image build node for building the image of the target application. In other words, developers can send image configuration information for edge computing nodes corresponding to other image build nodes to the control node through any of the image build nodes. This allows developers to perform image builds with various image configurations, while still having access to the control node, making image building more flexible.

[0073] Optionally, prior to step 203, the image building method provided in this application further includes the following steps:

[0074] Step 203-1: The first image building node obtains the target key pair used to pull the code of the target application and sends the target public key in the target key pair to the code storage node. The image building information also includes the target private key in the target key pair. The target image building node sends the target private key and the code storage address in the image building information to the code storage node. When the code storage node detects that the target private key and the target public key in the image building information match, it retrieves the code of the target application from the storage location corresponding to the code storage address and sends the code of the target application to the target image building node. The target image building node receives the code of the target application.

[0075] Understandably, in this embodiment of the application, in order to protect data privacy during the image building process and prevent the code of the target application from being intercepted, leaked or tampered with, a key pair can be used to pair the code repository on the code storage node with the image building node during image building. When the pairing is successful, the image building node can pull the code of the target application from the code repository on the cloud server and then perform image building.

[0076] This application uses SSH key pairs as an example. SSH (Secure Shell) is a security protocol built on the application and transport layers. SSH is currently a reliable protocol specifically designed to provide security for remote login sessions and other network services. Using SSH can effectively prevent information leakage during remote management. SSH was originally a program on UNIX systems and has since been rapidly expanded to other operating platforms. When used correctly, SSH can mitigate network vulnerabilities. Almost all UNIX platforms, including HP-UX, Linux, AIX, Solaris, Digital UNIX, and Irix, can run SSH. SSH encrypts data primarily in two ways: symmetric encryption and asymmetric encryption. Symmetric encryption uses the same key for encryption and decryption, while asymmetric encryption uses different keys—a public key and a private key—from which the private key cannot be derived. Therefore, asymmetric encryption makes data transmission more secure and protects data privacy. Furthermore, SSH key pairs can accelerate data transmission, making code retrieval more secure and efficient.

[0077] In one implementation, when preparing the image build node for the edge computing cluster, developers can generate an SSH key pair, send it, and store it on the control node. When another user selects image configuration information through the first build node, they can pull the key pair for the target application, add the private key from the key pair to the image configuration information, and send the public key to the code repository on the code storage node. Thus, when the image build node pulls the code for the target application from the code repository on the code storage node based on the image configuration information, the code storage node can first check whether the private key in the image configuration information matches the public key on the code storage node. If the private and public keys match, the code storage node can send the code / code branch of the target application to the target image build node for image building of the target application.

[0078] In another implementation, when developers prepare the image build nodes for the edge computing cluster, an SSH key pair can be generated. The public key is uploaded to the code repository on the code storage node, and the private key is added to the image build node. In this way, when the control node selects the corresponding image build node for image build based on the image configuration information, if it detects that the private key on the image build node has a matching public key in the code repository on the code storage node, the image build node will have the permission to pull code from the code repository on the cloud server and can pull code from the code repository.

[0079] In a specific implementation, the GitHub / GitLab code repository provides a Deploy Key, which can be added to the Deploy Key of the code repository to pull the code.

[0080] By pairing public and private keys, the risk of data interception / theft / tampering in traditional plaintext network communication can be effectively reduced when pulling code on the image build node, thus ensuring data privacy.

[0081] Optional, such as Figure 3 As shown, the image building system 101 may also include an image storage node 302, and the image building method provided in this application may further include the following steps:

[0082] The target image build node stores the image corresponding to the target application on the image storage node and adds an identifier of the runtime environment to the stored image corresponding to the target application.

[0083] Step 201-1 can be achieved by following these steps:

[0084] When the first image building node cannot find the target image from the image storage node, it obtains the image configuration information of the target application of the image to be built. The runtime environment corresponding to the target image is consistent with the runtime environment of the image to be built.

[0085] It is understood that the image storage node can be the control node in the image building system, or it can be a node that has a communication network connection with each image building node 103 in the image building system. This embodiment does not specifically limit it.

[0086] The image storage node stores the images built by the image building system provided in this application embodiment, and adds corresponding runtime environment identifiers to each image. This allows the built images to be uploaded to the image storage node after construction, and users can download the images for the required runtime environment from the image storage node. Therefore, the image configuration information can include the image storage node address, so that the built images can be quickly uploaded to the corresponding image storage node, and images can also be found from the image storage node.

[0087] Understandably, when developers are preparing an image build node, they can add the address of the image storage node to the image build node. This way, when the image build node has built the image of the target application, it can quickly upload the image to the image storage node.

[0088] In one implementation, when a developer accesses the control node through the first image build node to select image configuration information for the image to be built, the developer can first search the image storage node to see if there is a target image already built by another user. The target image is an image corresponding to the same application with the same runtime environment as the image to be built. If a target image is found on the image storage node, the corresponding target image is downloaded. If no target image is found, the developer submits the image configuration information to the control node through the first image build node to build the image.

[0089] In another implementation, after the developer submits the image configuration information, the control node can autonomously search whether a corresponding target image exists on the image storage node. If the target image is found on the image storage node, the control node can provide initial search information to indicate its existence and display a target image download control, allowing the user to download the target image. If the target image is not found on the image storage node, the control node selects the corresponding image build node based on the image configuration information and performs image build.

[0090] This technology ensures the uniqueness of images stored on image storage nodes, saves storage space on these nodes, and allows for centralized storage management of completed images. This means that when a target image is already built, developers can directly download it without having to rebuild it, thus improving image building efficiency.

[0091] In addition, users can see which edge runtime environment images have been built, and can then set different image configuration information for the runtime environments of images that have not been built, in order to generate images for different runtime environments.

[0092] Optionally, the image configuration information may also include an image build failure policy. The image build failure policy is the measure taken when an image build fails, as defined by the user.

[0093] Step 203 can be achieved as follows:

[0094] The code of the target application is obtained based on the image build information, and an image is built based on the code. When the image build is successful, the image corresponding to the target application is obtained. When the image build fails, the steps of obtaining the code of the target application based on the image build information and building an image based on the code are executed until the number of image build failures is greater than or equal to the preset number, at which point the image build stops.

[0095] Understandably, image builds may fail for several reasons: a communication network interruption between the code repository node and the image build node, causing the image build node to fail to pull the application code for building the image from the code repository on the code repository node; or the developer selecting incorrect information when choosing image configuration details, leading to build failure. When an image build fails, the developer can follow the image build failure strategy in the image configuration details. Specifically, the image build failure strategy can involve the developer setting a preset number of times in the image configuration details. When a build failure is detected, the necessary steps for image building can be re-executed: obtaining the target application code based on the image build information and building the image based on the code; and obtaining the image corresponding to the target application when the build is successful. Image building stops when the number of build failures exceeds or equals the preset number set by the developer. Furthermore, the image build node can also provide feedback messages indicating the reason for the build failure. This allows developers to make corresponding adjustments, facilitating more efficient problem-solving and further ensuring the efficiency of image building.

[0096] This technique incorporates a retry mechanism into the image building task, which greatly improves the success rate of image building and thus enhances the user experience.

[0097] Optionally, the image building method provided in this application may also include the following steps:

[0098] The target image build node uploads the build log to the control node. The build log is used to record the process of building the image to be built.

[0099] As one implementation method, build logs generated during the image building process can be persistently saved to the image build node. Data persistence refers to transforming data from a transient state to a persistent state, saving it permanently. For example, data in memory will disappear when power is lost and cannot be permanently saved. Saving data in memory to a file storage system or database can make the data permanently saved, achieving data persistence. The image build node can send the build logs to the control node for display, allowing users to view the image build logs corresponding to the completed image.

[0100] This technology allows users to know the specific details of each step in the image building process, including the number of failures and the reasons for each failure.

[0101] Optionally, the image building method provided in this application may also include the following steps:

[0102] The control node obtains the status of whether each of the image building nodes is running normally.

[0103] Step 202 can be achieved by following these steps:

[0104] Once the control node determines that the target image building node corresponding to the target runtime environment information is running normally, it sends the image building information to the target image building node corresponding to the target runtime environment information.

[0105] Understandably, after the developers prepare the image build node, the image build node can autonomously detect whether it is in a normal operating state and send the detection result to the control node. Specifically, the image build node can detect whether it is in a normal operating state according to a preset period and send detection information on whether the image build node can operate normally to the control node according to a preset period; in this application, the control node can also detect whether multiple image build nodes communicating with it are operating normally. This application does not specifically limit the embodiments in this regard.

[0106] As one implementation method, when an image build node is detected to be malfunctioning (i.e., unable to perform image builds), the image build node can send a notification message indicating that it is in a non-running state, does not receive image configuration information, and cannot perform image builds. Alternatively, the control node can send a notification message indicating that the image build node is in a non-running state and cannot perform image builds. This way, developers are aware that the runtime environment corresponding to the image build node cannot perform image builds, and therefore will not publish image configuration information (image build tasks) for that runtime environment. Furthermore, based on this notification message, developers can prepare a working image build node for that runtime environment to perform the corresponding image build.

[0107] Optionally, the image configuration information may also include the image name, which is the name of the image to be built.

[0108] Corresponding to the image building method provided in the first embodiment of this application, the second embodiment of this application also provides an image building system, such as... Figure 4 As shown, the system includes:

[0109] The acquisition unit 401 is applied to the control node in the image building system. The acquisition unit 401 is used to acquire the image configuration information of the target application to be built. The image configuration information includes: the image building information of the target application and the target runtime environment information of the image to be built. The image building information includes the application information of the target application, and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built.

[0110] The sending unit 402 is applied to the control node in the image building system. The sending unit 402 is used to send the image building information to the target image building node corresponding to the target running environment. The image building system includes multiple image building nodes. Each image building node in the image building system corresponds to an edge computing node with a different running environment in the edge computing system. The running environment of the image building node is consistent with the running environment of the corresponding edge computing node.

[0111] The building unit 403 is applied to the target image building node in the image building system. The building unit 403 is used to obtain the code of the target application based on the image building information, and to build the image according to the code to obtain the image corresponding to the target application.

[0112] Optionally, the application information includes: the code storage address of the target application, and the image building system further includes: code storage nodes for storing the code of each application;

[0113] like Figure 5 As shown, the image building system 101 also includes a code retrieval unit 501, which is applied to the target image building node in the image building system. The code retrieval unit 501 is used to retrieve the code of the target application from the code storage node based on the code storage address.

[0114] Optionally, the image building system further includes a key retrieval unit 502, applied to the first image building node in the image building system. The key retrieval unit 502 is used to retrieve the target key pair of the target application's code and send the target public key in the target key pair to the code storage node.

[0115] The image building system further includes a processing unit 503, which is applied to the target image building node in the image building system. The processing unit 503 is used to send the target private key and the code storage address in the image building information to the code storage node.

[0116] The image building system further includes a detection unit 504, which is applied to the code storage node in the image building system. The detection unit 504 is used to obtain the code of the target application from the storage location corresponding to the code storage address when it detects that the target private key in the image building information matches the target public key, and send the code of the target application to the target image building node.

[0117] Optionally, the image building system further includes: an image storage node;

[0118] The image building system also includes a storage unit 505, which is applied to the target image building node in the image building system. The storage unit 505 is used to store the image corresponding to the target application in the image storage node and add a runtime environment identifier to the stored image corresponding to the target application.

[0119] The image building system further includes a search unit 506, which is applied to the first image building node in the image building system. The search unit 506 is used to obtain the image configuration information of the target application of the image to be built when the target image is not found in the image storage node. The running environment corresponding to the target image is consistent with the running environment of the image to be built.

[0120] Optionally, the image building system further includes an upload unit 507, which is applied to the target image building node in the image building system. The upload unit 507 is used to upload the build log to the control node, and the build log is used to record the process of building the image to be built.

[0121] Optionally, the acquisition unit 401 is further configured to acquire the status of whether each of the image building nodes is operating normally;

[0122] The sending unit 402 is further configured to send the image building information to the target image building node corresponding to the target operating environment information when it is determined that the target image building node corresponding to the target operating environment information is running normally.

[0123] Corresponding to the image building method provided in the first embodiment of this application, the third embodiment of this application also provides an image building system 101. For example... Figure 1 As shown, the system includes: a control node 102 and multiple image building nodes 103. Each image building node 103 in the image building system 101 corresponds to an edge computing node in the edge computing system 104 with a different operating environment. The operating environment of the image building node is consistent with the operating environment of the corresponding edge computing node.

[0124] like Figure 1 and Figure 5As shown, the control node 102 is used to obtain the image configuration information of the target application to be built, and send the image building information to the target image building node 508 corresponding to the target runtime environment; the image configuration information includes: the image building information of the target application and the target runtime environment information of the image to be built, the image building information includes the application information of the target application, and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built;

[0125] The target image building node 508 is used to obtain the code of the target application based on the image building information, and to build the image according to the code to obtain the image corresponding to the target application.

[0126] Optionally, the application information includes: the code storage address of the target application, such as... Figure 3 As shown, the image building system also includes: a code storage node 301 for storing the code of each application;

[0127] The target image building node 508 in the image building system is used to pull the code of the target application from the code storage node based on the code storage address.

[0128] Optionally, the application information may further include: the target branch of the image to be built for the target application;

[0129] The target image building node 508 in the image building system is used to pull the code corresponding to the target branch of the target application from the code storage node 301.

[0130] Optionally, the first image building node 509 in the image building system is used to obtain the image configuration information of the target application to be built and send the image configuration information to the control node 102 in the image building system.

[0131] Optionally, the first image building node 509 in the image building system is further configured to obtain a target key pair for pulling the code of the target application, and send the target public key in the target key pair to the code storage node 301;

[0132] The image construction information also includes: the target private key in the target key pair;

[0133] The target image building node 508 in the image building system is further configured to send the target private key and the code storage address in the image building information to the code storage node 301;

[0134] The code storage node 301 in the image building system is used to retrieve the code of the target application from the storage location corresponding to the code storage address when it detects that the target private key in the image building information matches the target public key, and send the code of the target application to the target image building node 508.

[0135] Optionally, the target image building node 508 is further configured to store the image corresponding to the target application in the image storage node 302, and add an identifier of the runtime environment to the stored image corresponding to the target application;

[0136] The first image building node 509 is further configured to, when the target image is not found in the image storage node 302, obtain the image configuration information of the target application of the image to be built, wherein the running environment corresponding to the target image is consistent with the running environment of the image to be built.

[0137] Optionally, the target image building node 508 is further configured to upload the build log to the control node 102, wherein the build log is used to record the process of building the image to be built.

[0138] Optionally, the control node 102 is further configured to obtain the status of whether each of the image building nodes 103 is operating normally, and if it is determined that the target image building node 508 corresponding to the target operating environment information is operating normally, send the image building information to the target image building node 508 corresponding to the target operating environment information.

[0139] Corresponding to the image building method provided in the first embodiment of this application, the fourth embodiment of this application provides a computer-readable storage medium storing a program for an image building method, which is executed by a processor to perform the following steps:

[0140] The control node acquires the image configuration information of the target application to be built; the image configuration information includes: the image building information of the target application and the target runtime environment information of the image to be built. The image building information includes the application information of the target application, and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built.

[0141] The control node sends the image building information to the target image building node corresponding to the target runtime environment information;

[0142] The target image building node obtains the code of the target application based on the image building information, and builds the image according to the code to obtain the image corresponding to the target application.

[0143] It should be noted that for a detailed description of the system and computer-readable storage medium provided in the second, third and fourth embodiments of this application, please refer to the relevant description of the first embodiment of this application, which will not be repeated here.

[0144] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

[0145] In a typical configuration, a node device in a blockchain includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0146] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0147] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage media, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.

[0148] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0149] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

Claims

1. A method for constructing an image, characterized in that, The method is applied to an image building system, which includes: a control node, multiple image building nodes, a code storage node for storing the code of each application, and an image storage node. Each image building node in the image building system corresponds to an edge computing node in an edge computing system with a different operating environment, and the operating environment of the image building node is consistent with the operating environment of the corresponding edge computing node. The first image building node in the image building system searches for the target image from the image storage node. Only when the target image is not found does it obtain the image configuration information of the target application to be built and send the image configuration information to the control node. The target image is the image corresponding to the target application, and its runtime environment is the same as the target runtime environment of the image to be built. The image configuration information includes: image building information of the target application and target runtime environment information of the image to be built. The image building information includes the application information of the target application, the application information includes the code storage address of the target application, and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built. The control node receives the image configuration information and sends the image build information to the target image build node corresponding to the target runtime environment information; The target image building node pulls the code of the target application from the code storage node based on the code storage address, and builds the image according to the code to obtain the image corresponding to the target application; The target image building node stores the image corresponding to the target application in the image storage node, and adds a runtime environment identifier to the stored image corresponding to the target application.

2. The method according to claim 1, characterized in that, The edge computing system includes multiple edge computing clusters. Each edge computing node in the same edge computing cluster has the same operating environment, while different edge computing clusters have different operating environments. Each of the image building nodes in the image building system corresponds to each of the edge computing clusters in the edge computing system, and the operating environment of the image building node is consistent with the operating environment of the corresponding edge computing cluster.

3. The method according to claim 1, characterized in that, The application information also includes: the target branch of the image to be built for the target application; The step of retrieving the code of the target application from the code storage node includes: Pull the code corresponding to the target branch of the target application from the code storage node.

4. The method according to claim 1, characterized in that, Before the target image build node pulls the code of the target application from the code storage node based on the code storage address, the method further includes: The first image building node obtains a target key pair for pulling the code of the target application and sends the target public key in the target key pair to the code storage node; The image construction information also includes: the target private key in the target key pair; The target image build node, based on the code storage address, pulls the code of the target application from the code storage node, including: The target image building node sends the target private key and the code storage address from the image building information to the code storage node; When the code storage node detects that the target private key in the image build information matches the target public key, it retrieves the code of the target application from the storage location corresponding to the code storage address and sends the code of the target application to the target image build node. The target image building node receives the code of the target application.

5. The method according to claim 1, characterized in that, The target image building node, based on the code storage address, pulls the code of the target application from the code storage node, and builds the image according to the code to obtain the image corresponding to the target application, including: The target image building node pulls the code of the target application from the code storage node based on the code storage address, and builds the image based on the code; When the image build is successful, the image corresponding to the target application is obtained; When an image build failure is detected, the steps of pulling the code of the target application and building the image based on the code are repeated until the number of image build failures is greater than or equal to a preset number, at which point the image build stops.

6. The method according to claim 1, characterized in that, The method further includes: The target image building node uploads the build log to the control node. The build log is used to record the process of building the image to be built.

7. The method according to claim 1, characterized in that, The method further includes: The control node obtains the status of whether each of the image building nodes is operating normally; The control node sends the image build information to the target image build node corresponding to the target runtime environment information, including: If the control node determines that the target image building node corresponding to the target operating environment information is operating normally, it will send the image building information to the target image building node corresponding to the target operating environment information.

8. The method according to claim 1, characterized in that, The target operating environment information includes at least one of the following: the node identifier, CPU type, GPU type, operating system type, and database type of the target edge computing node.

9. An image building system, characterized in that, The system includes The system includes a control node, multiple image building nodes, a code storage node for storing the code of each application, and an image storage node. Each image building node in the image building system corresponds to an edge computing node with a different operating environment in the edge computing system. The operating environment of the image building node is consistent with the operating environment of the corresponding edge computing node. The system also includes: A lookup unit, applied to the first image building node in the image building system, is used to search for a target image from the image storage node. Only if the target image is not found does it acquire the image configuration information of the target application to be built and send the image configuration information to the control node. The target image is the image corresponding to the target application whose runtime environment is the same as the target runtime environment of the image to be built. The image configuration information includes the image building information of the target application and the target runtime environment information of the image to be built. The image building information includes the application information of the target application, the application information includes the code storage address of the target application, and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built. An acquisition unit, applied to the control node, is used to receive the image configuration information; A sending unit, applied to the control node, is used to send the image building information to the target image building node corresponding to the target runtime environment information; A code retrieval unit, applied to the target image build node, is used to retrieve the code of the target application from the code storage node based on the code storage address; A build unit, applied to the target image build node, is used to build an image based on the code to obtain the image corresponding to the target application. A storage unit, applied to the target image building node, is used to store the image corresponding to the target application in the image storage node and add an identifier of the runtime environment to the stored image corresponding to the target application.

10. An image building system, characterized in that, The image building system includes: a control node, multiple image building nodes, a code storage node for storing the code of each application, and an image storage node. Each image building node in the image building system corresponds to an edge computing node with a different operating environment in the edge computing system. The operating environment of the image building node is consistent with the operating environment of the corresponding edge computing node. The first image building node in the image building system is used to search for the target image from the image storage node, and only when the target image is not found will it obtain the image configuration information of the target application of the image to be built and send the image configuration information to the control node. The target image is the image corresponding to the target application and whose running environment is the same as the target running environment of the image to be built. The control node is used to receive the image configuration information and send the image building information to the target image building node corresponding to the target runtime environment; the image configuration information includes: the image building information of the target application and the target runtime environment information of the image to be built, the image building information includes the application information of the target application, the application information includes the code storage address of the target application, and the target runtime environment information is the runtime environment information of the target edge computing node used to run the image to be built; The target image building node is used to pull the code of the target application from the code storage node based on the code storage address, build the image according to the code, obtain the image corresponding to the target application, store the image corresponding to the target application in the image storage node, and add the runtime environment identifier to the stored image corresponding to the target application.

11. A computer-readable storage medium, characterized in that, The system contains a data processing program that is executed by a processor to perform the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Container mirror image building method, container mirror image building system, container mirror image building device and storage medium

    CN107766126A