CN116382713A - Method, system, device and storage medium for constructing application mirror image - Google Patents

Method, system, device and storage medium for constructing application mirror image Download PDF

Info

Publication number
CN116382713A
CN116382713A CN202310007815.1A CN202310007815A CN116382713A CN 116382713 A CN116382713 A CN 116382713A CN 202310007815 A CN202310007815 A CN 202310007815A CN 116382713 A CN116382713 A CN 116382713A
Authority
CN
China
Prior art keywords
construction
image
code
target application
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310007815.1A
Other languages
Chinese (zh)
Inventor
张越
郑直
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Picc Information Technology Co ltd
Original Assignee
Picc Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Picc Information Technology Co ltd filed Critical Picc Information Technology Co ltd
Priority to CN202310007815.1A priority Critical patent/CN116382713A/en
Publication of CN116382713A publication Critical patent/CN116382713A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a method, a system, equipment and a storage medium for constructing an application mirror image, and belongs to the technical field of mirror image construction. The method includes identifying a change in code in a preset code repository; if the change of the codes in the code warehouse is identified to represent the new function of the target application, the target application image construction task corresponding to the changed codes is sent to a construction machine, so that the construction machine executes the following steps: acquiring a basic mirror image of which the target application supports at least one kernel architecture through a preset product warehouse to form at least one construction file; and running at least one construction file through the multi-platform image construction plug-in to obtain a target application image which at least supports one kernel architecture and corresponds to the newly added code. The construction machine runs a plurality of construction files supporting different kernel architectures through the multi-platform image construction plug-in, so that one construction machine can generate an application image applicable to a plurality of kernel architectures, and the investment on processing resources is reduced.

Description

Method, system, device and storage medium for constructing application mirror image
Technical Field
The present invention relates to the field of image construction, and in particular, to a method, a system, a device, and a storage medium for constructing an application image.
Background
With the development of modern information system infrastructure, the same application will typically be deployed on different target products, such as servers, terminal devices, etc. Different target products may be configured with underlying resources of different CPU (central processing unit ) core architectures, and the same application, if to run on target products with different core architectures, would need to have application images that adapt to the different core architectures.
Currently, to achieve deployment of application images on a target product, a solution has been developed for pipeline construction and deployment of application images, which is accomplished by a server and a constructor, wherein the constructor is a computer device installed with an image construction tool, such as an application container engine command line tool (docker build). Specifically, the implementation process of the existing construction scheme is as follows: after the code representing the function of the target application changes, the server identifies the kernel architecture of the constructor (i.e. the kernel architecture of the operating system of the constructor), as the basic images of the same application corresponding to different kernel architectures are stored in the product warehouse, after the kernel architecture deployed by the constructor is identified, the basic image supporting the target application of the current kernel architecture and the code corresponding to the change are sent to the constructor, the constructor compiles and generates a construction file based on the basic image and the code corresponding to the change, and the construction file is operated through an image construction tool to construct (i.e. generate) a target application image supporting the kernel architecture of the constructor, and then the target application image is deployed to a target product.
According to the prior art, the building machine for building the application image can only passively receive the basic image supporting the kernel architecture of the building machine, compile and generate a corresponding building file, and further generate an application image supporting the kernel architecture of the building machine. Therefore, to meet the requirements of the target products with different kernel architectures for the same application, a constructor with different kernel architectures is required, and multiple times of basic images supporting different kernel architectures are required to be provided for the constructor, so that application images respectively corresponding to the different kernel architectures can be generated, and a great deal of cost investment and technical support are required.
Disclosure of Invention
The embodiment of the application provides a method, a system, equipment and a storage medium for constructing an application image, which are used for solving the problem that more processing resources are consumed when the application image supporting different kernel architectures is constructed according to the prior art.
The embodiment of the application adopts the following technical scheme:
a method of building an application image, comprising:
identifying a change in a code in a preset code repository, the change in the code characterizing a change in an application function of a target application;
if the change of the codes in the code warehouse is identified to represent the new function of the target application, sending a target application image construction task corresponding to the changed codes to a construction machine, so that the construction machine executes:
Acquiring a changed code and a storage address of a basic mirror image of a target application, wherein the basic mirror image at least supports one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture; execution of the build plug-in by invoking a multi-platform image deployed on the application container engine command line tool: and running the at least one construction file, acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code, wherein the multi-platform image construction plug-in supports construction of different kernel architectures.
A system for building an application image, comprising:
the monitoring unit is used for identifying the change of codes in a preset code warehouse, and the change of the codes represents the change of the application function of the target application;
the triggering unit is used for sending a target application mirror image construction task corresponding to the changed code to a construction machine if the fact that the change of the code in the code warehouse represents the new function of the target application is recognized;
The building machine is used for acquiring the changed codes and the storage address of the basic mirror image of the target application, which at least supports one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture; execution of the build plug-in by invoking a multi-platform image deployed on the application container engine command line tool: and running the at least one construction file, acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code, wherein the multi-platform image construction plug-in supports construction of different kernel architectures.
A computing device, comprising: a memory and a processor, wherein,
the memory is used for storing a computer program;
the processor is coupled to the memory for executing the computer program stored in the memory for performing the method described above.
A computer readable storage medium storing a computer program which, when executed by a computer, is capable of carrying out the method described above.
The above-mentioned at least one technical scheme that this application embodiment adopted can reach following beneficial effect:
the construction machine acquires codes representing the target application functions, compiles construction files, writes storage addresses of application images supporting different kernel architectures into the construction files to form a plurality of construction files, realizes dissimilarization of the construction files, and operates different construction files through a multi-platform image construction plug-in, so that the target application images supporting different kernel architectures are obtained. Therefore, one constructor can generate target application images supporting multiple kernel architectures, the limit on the kernel architecture of the constructor is eliminated, and the cost and the technical investment of the constructor are reduced. And based on the change of codes representing the target application function in the code warehouse, the construction task of the target application image is triggered, so that the construction machine can autonomously acquire the changed codes to compile the construction file, and the labor input is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a flowchart of a specific implementation of a method for constructing an application image according to an embodiment of the present application;
FIG. 2 is a flowchart of one implementation of a method for creating an application image according to an embodiment of the present application;
FIG. 3 is a flowchart of another implementation of a method for constructing an application image according to an embodiment of the present application
FIG. 4 is a schematic diagram of a specific architecture of a system for building an application image according to an embodiment of the present application;
fig. 5 is a schematic specific structural diagram of a computing device according to an embodiment of the present application.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
As one of ordinary skill in the art can appreciate, with the development of technology and the appearance of new scenes, the technical solutions provided in the embodiments of the present application are applicable to similar technical problems.
The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and are merely illustrative of the manner in which the embodiments of the application described herein have been described for objects of the same nature. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The embodiment 1 of the application provides a method for constructing an application image, which is used for solving the problem that more processing resources are consumed in the prior art for constructing the application image supporting different kernel architectures.
The execution subject of the method can be any computing device that can implement the method, such as a server, a mobile phone, a personal computer, an intelligent wearable device, an intelligent robot, and the like.
Different steps of the method may be implemented by the same execution body, or may be implemented by different execution bodies, and the embodiment of the application does not limit what execution body is adopted to implement the method.
In addition, the execution sequence of the different steps is not limited in the embodiment of the present application. When the method provided by the embodiment of the application is used, the execution sequence of different steps can be adjusted according to actual requirements.
For convenience of description, the method provided in the embodiment of the present application will be described in detail below by taking an apparatus for constructing an application image as an execution body of the method.
As shown in fig. 1, a method for constructing an application image according to an embodiment of the present application includes:
step 101, identifying a change in a code in a preset code repository, the change in the code characterizing a change in an application function of a target application.
The code repository stores codes characterizing application functions, and codes characterizing application functions for different applications may be stored simultaneously. The code for different applications may be stored in different partitions of the code repository.
The code changes include the addition, the reduction and the change of the code, the change of the code causes the change of the corresponding application function, and in order to use the function after the application change on a target product, a target application mirror image corresponding to the change of the code and causing the function change needs to be constructed for the target application. The target application is an application of which the code changes so that the function of the application changes, and thus a new application mirror image needs to be constructed; the target product is an electronic device capable of installing target application, and can be a server, a mobile phone, a personal computer, intelligent wearable equipment, an intelligent robot and the like.
And step 102, if the change of the code in the code warehouse is identified to represent the new function of the target application, sending a target application image construction task corresponding to the changed code to a construction machine, so that the construction machine executes the following step 103.
The build machine may be one build machine or may be at least one build machine deployed within a cluster of build machines. The build machine is a computer device that has an application container engine command line tool (docker build) installed.
In one implementation, the clusters of build machines are deployed as multi-place, multi-center clusters, i.e., build machines within a cluster may be deployed in different regions (e.g., in Beijing, shanghai, respectively), and multiple center build machines may be deployed (e.g., center build machines are deployed in different regions, respectively). On one hand, disaster recovery backup is realized by the multi-place multi-center building machine cluster, and on the other hand, when the target application mirror image is built, the nearby selection of building machines is facilitated.
Step 103, obtaining the changed codes and the storage address of the basic mirror image of the target application, which at least supports one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture; execution of the build plug-in by invoking a multi-platform image deployed on the application container engine command line tool: and running the at least one construction file, acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code, wherein the multi-platform image construction plug-in supports construction of different kernel architectures.
The kernel architecture comprises x86, arm, RHEL and the like, and after the kernel architecture is deployed on the electronic equipment, the application image on the electronic equipment needs to be matched with the kernel architecture so as to realize smooth installation and use on the electronic equipment.
For a clearer understanding of the code in step 101, further description is provided below in connection with the docker image composition and build file dockerfile:
the image is actually composed of a layer-by-layer file system, the file system of the hierarchy is a united file system UnionFS, which is a layered, lightweight and high-performance file system, which supports modification of the file system as a layer-by-layer overlay by one commit, and different directories can be mounted under the same virtual file system, and the united file system is the basis of a docker image.
The file system of Docker is divided into bootfs and rootfs.
bootfs mainly comprises bootloader and kernel, bootloader mainly loads kernel, and the operating system will load bootfs file system when it is just started. The bottommost layer of the Docker image is bootfs, which contains boot loader and kernel. When boot loading is completed, the whole kernel is in the memory, at the moment, the use right of the memory is transferred to the kernel by the bootfs, and at the moment, the system can also unload the bootfs.
The rootfs, above the bootfs, contains standard directories and files such as/dev,/proc,/bin,/etc in a typical Linux system. rootfs is a release of various operating systems
It can be understood that: operating a command download debrian, wherein a layer of basic mirror image is added on the kernel; installing an emacs, and superposing a layer of image on the basic mirror image; then, an apache is installed, and an image is further superimposed on the images. Finally they look like a file system, the rootfs of a container. These rootfs are called mirror images of dockers in the Docker hierarchy. However, each layer of rootfs at this time is read-only, and it cannot yet be operated at this time. When an application image needs to be created, i.e., a docker image is instantiated, the file system allocates a layer of empty read-write's rootfs over one or more layers of read-only's rootfs. Thus, in building an application file, it is essential to operate on this layer of empty read-write.
The Docker mirror image is a special file system, and processes and provides programs, libraries, resources, configuration files and other files required by the running of the container, and also contains configuration parameters (such as anonymous volumes, environment variables, users and the like) prepared for the running, so that the construction of the application mirror image is realized by customizing the added configuration files of each layer.
The commands of modifying, installing, constructing and operating each layer are written into a script, and the script is used for constructing and customizing the mirror image, and the script is used for constructing the file dockerfile.
The build file dockerfile is a text file that contains an instruction (instruction) that builds a layer, so the content of each instruction describes how the layer should be built. When new requirements need to be customized for the application, only instructions need to be added or modified on the dockerfile to regenerate the target application image.
In this embodiment, an instruction (i.e., code) that forms the build file is stored in a code repository, where the instruction is added or modified when needed to customize new requirements for the application, i.e., the code changes in step 101. Triggering an application image construction task of the embodiment of the application, compiling and generating a corresponding construction file for constructing a target application image. The base image is built from "zero" independent of other images, and other images of the same application are all extended from the base image. A base image may be understood as a base version of an application.
In one implementation, different build files are maintained through a flash script, the storage address of the base image of the target application is used as an operating parameter of the build file, and different storage addresses are maintained by different flash scripts.
The construction file is also configured with information such as application mirror names, container environment variables, service starting modes and the like.
The multi-platform mirror image construction plug-in is a docker build x, is a command line interface CLI plug-in, is deployed on a docker build of an application container engine command line tool, expands docker commands, can complete cross-platform construction tasks, and realizes parallel construction of target application mirrors supporting different kernel architectures.
And (3) operating the construction file by the multi-platform mirror image construction plug-in dock, and acquiring a basic image based on a storage address in the construction file to obtain a target application mirror image supporting the code function of the construction file corresponding to the kernel architecture and corresponding to the change.
The application multi-platform image construction plug-in can run a plurality of construction files simultaneously to form a target application image supporting a plurality of kernel architectures.
Example 2
The method for constructing the application mirror image is used for solving the problem that more processing resources are consumed in the prior art for constructing the application mirror image supporting different kernel architectures.
The execution subject of the method can be any computing device that can implement the method, such as a server, a mobile phone, a personal computer, an intelligent wearable device, an intelligent robot, and the like. Different steps of the method may be implemented by the same execution body, or may be implemented by different execution bodies, and the embodiment of the application does not limit what execution body is adopted to implement the method.
Step 201, identifying a change of a code in a preset code warehouse, wherein the change of the code represents a change of an application function of a target application; and triggering a target application construction task corresponding to the changed code through webhook triggering a pipeline if the change of the code in the code warehouse is identified to represent the new function of the target application.
Webhook is an API (Application Program Interface ) concept, which is one of the usage paradigms of micro-service APIs, and is also called a reverse API, i.e. the front end does not actively send requests, and is pushed by the back end entirely. The application in this embodiment is that the application image construction pipeline does not actively request a construction task, but triggers the pipeline construction task based on a change in code.
Step 202, the application image construction task is sent to the construction task scheduling center.
In step 203, the central control computer of the task scheduling center monitors the resource usage status of each building machine and synchronizes the information to the task queue rubbitmq, and a task scheduling policy based on the load, memory and CPU performance of each building machine in the building machine cluster is set in the task queue, and the building machine executing the current building task is determined by the policy.
Step 204, the current construction task is issued to the construction machine for executing the current construction task determined in step 203 through the construction task scheduling center, and the construction task executed by the construction machine is triggered, so that the problem that queuing is needed when more pipelines are concurrent at the same time, and the resources of the construction machine cannot be fully utilized is solved.
Each building machine in the issuing building machine cluster forms at least one building file supporting at least one kernel architecture, and a target application image supporting at least one kernel architecture is built.
The building machines in the building machine cluster uniformly mount the dependent environment in an nfs mode, and the building environment does not need to be mounted for each node.
The build machine that received the build task performs the following operations: step 205, obtaining a changed code (pulling a newly added code) through a code warehouse, and compiling a construction file based on the changed code; step 206, obtaining a storage address of a basic mirror image supporting at least one kernel architecture from a preset product warehouse, and writing the storage address as an operation parameter into a compiled construction file to form at least one construction file supporting at least one kernel architecture; and operating the at least one construction file by calling a multi-platform image construction plug-in arranged on an application container engine command line tool, and acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code.
And step 207, backing up the generated target application mirror image supporting various kernel architectures into a product warehouse.
And step 208, deploying the application image adapted to the kernel architecture of each node of the target server. Only the deployment of the application image to each node of the target server is shown in fig. 2, and in fact, the target application image may also be deployed on an electronic device such as a personal computer, a wearable device, a robot, and the like.
Example 3
The method for constructing the application mirror image is used for solving the problem that more processing resources are consumed in the prior art for constructing the application mirror image supporting different kernel architectures.
The execution subject of the method can be any computing device that can implement the method, such as a server, a mobile phone, a personal computer, an intelligent wearable device, an intelligent robot, and the like. Different steps of the method may be implemented by the same execution body, or may be implemented by different execution bodies, and the embodiment of the application does not limit what execution body is adopted to implement the method.
Step 301, identifying a change of a code in a preset code warehouse, wherein the change of the code represents a change of an application function of a target application; and triggering a target application construction task corresponding to the changed code through webhook triggering a pipeline if the change of the code in the code warehouse is identified to represent the new function of the target application.
In step 302, the application image build task is sent to the build task dispatch center.
Step 303, sending an instruction for identifying the kernel architecture of the target product to the resource allocation module of the constructor.
Step 304, responding to the instruction of step 303, the resource allocation module of the constructor acquires the kernel architecture of the target product and returns the kernel architecture to the construction task scheduling center.
In step 305, the central control computer of the task scheduling center monitors the use state of each building machine resource in the sub-building machine cluster for building the kernel architecture supporting the target product, synchronizes the information to the task queue rubbitmq, sets a task scheduling policy based on the load, the memory and the performance of the CPU of each building machine in the sub-building machine cluster, and determines the building machine for executing the current building task according to the policy.
Step 306, the current construction task is issued to the construction machine for executing the current construction task determined in step 305 through the construction task scheduling center, and the construction task on the construction machine is triggered, so that the problem that queuing is required when more pipelines are concurrent at the same time, and the resources of the construction machine cannot be fully utilized is solved.
The issuing builder cluster comprises a plurality of sub builder clusters, and satisfies: the building machines in the sub-building machine cluster all form a building file supporting a kernel architecture, and a target application mirror supporting the kernel architecture is built: the building machines in each sub-building machine cluster form different building files supporting different kernel architectures, and target application images supporting multiple kernel architectures are built.
The building machines in the building machine cluster uniformly mount the dependent environment in an nfs mode, and the building environment does not need to be mounted for each node.
The build machine that received the build task performs the following operations: step 307, obtaining a changed code (pulling a newly added code) through a code warehouse, and compiling a construction file based on the changed code; step 308, obtaining a storage address of a basic mirror image supporting the kernel architecture of the target product from a preset product warehouse, and writing the storage address as an operation parameter into a compiled construction file to form a construction file supporting the kernel architecture of the target product; and operating the construction file supporting the target product kernel architecture by calling a multi-platform image construction plug-in or an application container engine command line tool deployed on an application container engine command line tool, and acquiring a basic image based on a storage address in the construction file to obtain a target application image supporting the target product kernel architecture and corresponding to the changed code.
And 309, backing up the generated target application image supporting the target product kernel architecture into a product warehouse.
And step 310, deploying the application mirror image adapted to the kernel architecture of each node of the target server. Only the deployment of the application image to each node of the target server is shown in fig. 3, and in fact, the target application image may also be deployed on an electronic device such as a personal computer, a wearable device, a robot, and the like.
Example 4
In order to solve the problem that in the prior art, the construction of an application image supporting different kernel architectures consumes more processing resources, embodiment 4 of the present application provides a system for constructing an application image, which has the same inventive concept as the embodiments described in the present application.
The specific structure of the system 400 is shown in fig. 4, and includes the following functional units:
the monitoring unit 401 is configured to identify a change of a code in a preset code repository, where the change of the code characterizes a change of an application function of the target application.
And the triggering unit 402 is used for sending the target application image construction task corresponding to the changed code to the construction machine when the new function of the target application is represented by the change of the code in the code warehouse.
A constructor 403, configured to obtain the changed code and a storage address of a base image of the target application that supports at least one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture; execution of the build plug-in by invoking a multi-platform image deployed on the application container engine command line tool: and running the at least one construction file, acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code, wherein the multi-platform image construction plug-in supports construction of different kernel architectures.
The execution of the build task may be at least one build machine within a cluster of pre-deployed build machines.
The build cluster includes at least two forms:
form one: each building machine in the building machine cluster forms at least one building file supporting at least one kernel architecture, and builds a target application image supporting at least one kernel architecture.
The build machine that received the build task performs the following operations: acquiring a changed code (pulling a newly added code) through a code warehouse, and compiling a construction file based on the changed code; acquiring a storage address of a basic mirror image supporting at least one kernel architecture from a preset product warehouse, and writing the storage address serving as an operation parameter into a compiled construction file to form at least one construction file supporting at least one kernel architecture; and operating the at least one construction file by calling a multi-platform image construction plug-in arranged on an application container engine command line tool, and acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code.
Form two: the builder cluster comprises a plurality of sub builder clusters, and satisfies: the building machines in the sub-building machine cluster all form a building file supporting a kernel architecture, and a target application mirror supporting the kernel architecture is built: the building machines in each sub-building machine cluster form different building files supporting different kernel architectures, and target application images supporting multiple kernel architectures are built.
The build machine that received the build task performs the following operations: acquiring a changed code (pulling a newly added code) through a code warehouse, and compiling a construction file based on the changed code; acquiring a storage address of a basic mirror image supporting a target product kernel architecture from a preset product warehouse, and writing the storage address serving as an operation parameter into a compiled construction file to form the construction file supporting the target product kernel architecture; and operating the construction file supporting the target product kernel architecture by calling a multi-platform image construction plug-in or an application container engine command line tool deployed on an application container engine command line tool, and acquiring a basic image based on a storage address in the construction file to obtain a target application image supporting the target product kernel architecture and corresponding to the changed code.
Example 5
In view of the same inventive concepts as the foregoing embodiments of the present application, embodiment 5 of the present application provides a computing device, so as to solve the problem that in the prior art, it would consume more processing resources to construct an application image supporting different kernel architectures.
As shown in fig. 5, at the hardware level, the electronic device 500 comprises a processor 502, optionally together with an internal bus, a network interface, a memory 501. The memory 501 may include a memory, such as a random-access memory (RAM), and may further include a non-volatile memory (non-volatile memory), such as at least 1 disk memory. Of course, the electronic device may also include hardware required for other services.
The processor 502, network interface, and memory 501 may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, PCIe (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 5, but not only one bus or type of bus.
The memory 501 is used for storing a computer program. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor 502, coupled to the memory 501, reads the corresponding computer program from the nonvolatile memory into the memory and then runs, forms a data synchronization device on a logic level, and is configured to execute the computer program stored in the memory 501, so as to perform the following operations:
Identifying a change in a code in a preset code repository, the change in the code characterizing a change in an application function of a target application; if the change of the codes in the code warehouse is identified to represent the new function of the target application, sending a target application image construction task corresponding to the changed codes to a construction machine, so that the construction machine executes: acquiring a changed code and a storage address of a basic mirror image of a target application, wherein the basic mirror image at least supports one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture; execution of the build plug-in by invoking a multi-platform image deployed on the application container engine command line tool: and running the at least one construction file, acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code, wherein the multi-platform image construction plug-in supports construction of different kernel architectures.
The method performed by the electronic device provided in the embodiment shown in fig. 5 of the present application may be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
Of course, other implementations, such as a logic device or a combination of hardware and software, are not excluded from the electronic device of the present application, that is, the execution subject of the following processing flow is not limited to each logic unit, but may be hardware or a logic device.
The present embodiments also provide a computer-readable storage medium storing a computer program, the computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, enable the portable electronic device to:
identifying a change in a code in a preset code repository, the change in the code characterizing a change in an application function of a target application; if the change of the codes in the code warehouse is identified to represent the new function of the target application, sending a target application image construction task corresponding to the changed codes to a construction machine, so that the construction machine executes: acquiring a changed code and a storage address of a basic mirror image of a target application, wherein the basic mirror image at least supports one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture; execution of the build plug-in by invoking a multi-platform image deployed on the application container engine command line tool: and running the at least one construction file, acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code, wherein the multi-platform image construction plug-in supports construction of different kernel architectures.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may 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.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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 technology, compact disc read only memory (CD ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may 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.) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (11)

1. A method of constructing an application image, comprising:
identifying a change in a code in a preset code repository, the change in the code characterizing a change in an application function of a target application;
if the change of the codes in the code warehouse is identified to represent the new function of the target application, sending a target application image construction task corresponding to the changed codes to a construction machine, so that the construction machine executes:
Acquiring a changed code and a storage address of a basic mirror image of a target application, wherein the basic mirror image at least supports one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture; execution of the build plug-in by invoking a multi-platform image deployed on the application container engine command line tool: and running the at least one construction file, acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code, wherein the multi-platform image construction plug-in supports construction of different kernel architectures.
2. The method according to claim 1, wherein the method further comprises:
and sending the target application image construction task corresponding to the changed code to a constructor cluster, so that at least one constructor in the constructor cluster executes the target application image construction task.
3. The method of claim 2, wherein each build machine within the cluster of build machines forms at least one build file supporting at least one kernel architecture, building a target application image supporting at least one kernel architecture.
4. The method of claim 2, wherein the build machine cluster includes a number of sub-build machine clusters therein, and wherein:
the building machines in the sub-building machine cluster all form a building file supporting a kernel architecture, and a target application mirror supporting the kernel architecture is built:
the building machines in each sub-building machine cluster form different building files supporting different kernel architectures, and target application images supporting multiple kernel architectures are built.
5. The method according to claim 3 or 4, wherein after identifying that the code change in the code repository characterizes the new functionality of the target application, the target application image corresponding to the changed code builds a task, and the method further comprises, before sending the task to a pre-deployed build machine cluster:
setting the target application mirror image construction task corresponding to the changed code into a task queue of a construction task scheduling center;
and sending pipeline construction tasks in the task queue to the selected construction machine according to the monitored resource occupation state of each construction machine in the construction machine cluster.
6. The method according to claim 1, wherein the method further comprises:
Storing the target application image in the artifact repository and/or deploying on a target server;
the kernel architecture of each node of the target server is the same as the kernel architecture supported by the target application image deployed on the node.
7. The method of claim 1, wherein the identifying the change in the code repository characterizes the target application image build task corresponding to the changed code after the new functionality occurs to the target application, the method further comprising, prior to sending to a build machine:
and obtaining the kernel architecture of each node of the target server.
8. The method of claim 7, wherein the retrieving the changed code and the memory address of the base image of the target application supporting at least one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture, wherein the construction file specifically comprises:
acquiring a changed code and a storage address of a target application supporting a basic mirror image of the kernel architecture of each node;
Compiling a construction file based on the changed codes, and writing the basic mirror image storage address of each node kernel architecture into the construction file as an operation parameter to form the construction file supporting each node kernel architecture.
9. A system for building an application image, comprising:
the monitoring unit is used for identifying the change of codes in a preset code warehouse, and the change of the codes represents the change of the application function of the target application;
the triggering unit is used for sending a target application mirror image construction task corresponding to the changed code to a construction machine when the new function of the target application is represented by the change of the code in the code warehouse;
the building machine is used for acquiring the changed codes and the storage address of the basic mirror image of the target application, which at least supports one kernel architecture; compiling a construction file based on the changed code, and writing the storage address into the construction file as an operation parameter to form at least one construction file supporting at least one kernel architecture; execution of the build plug-in by invoking a multi-platform image deployed on the application container engine command line tool: and running the at least one construction file, acquiring a basic image based on a storage address in the construction file to obtain a target application image which at least supports one kernel architecture and corresponds to the changed code, wherein the multi-platform image construction plug-in supports construction of different kernel architectures.
10. A computing device, comprising: a memory and a processor, wherein,
the memory is used for storing a computer program;
the processor, coupled to the memory, for executing the computer program stored in the memory for performing the method of any of claims 1-8.
11. A computer readable storage medium storing a computer program which, when executed by a computer, is capable of carrying out the method of any one of claims 1 to 8.
CN202310007815.1A 2023-01-04 2023-01-04 Method, system, device and storage medium for constructing application mirror image Pending CN116382713A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310007815.1A CN116382713A (en) 2023-01-04 2023-01-04 Method, system, device and storage medium for constructing application mirror image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310007815.1A CN116382713A (en) 2023-01-04 2023-01-04 Method, system, device and storage medium for constructing application mirror image

Publications (1)

Publication Number Publication Date
CN116382713A true CN116382713A (en) 2023-07-04

Family

ID=86963893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310007815.1A Pending CN116382713A (en) 2023-01-04 2023-01-04 Method, system, device and storage medium for constructing application mirror image

Country Status (1)

Country Link
CN (1) CN116382713A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737173A (en) * 2023-08-11 2023-09-12 华控清交信息科技(北京)有限公司 Service integration method and device on k8s container cluster and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116737173A (en) * 2023-08-11 2023-09-12 华控清交信息科技(北京)有限公司 Service integration method and device on k8s container cluster and electronic equipment

Similar Documents

Publication Publication Date Title
CN110413288B (en) Application deployment method, device, server and storage medium
CN112416524A (en) Implementation method and device of cross-platform CI/CD (compact disc/compact disc) based on docker and kubernets offline
WO2022016848A1 (en) Method and apparatus for performing application deployment according to service role
US20240111549A1 (en) Method and apparatus for constructing android running environment
CN113971095A (en) KUBERNETES application program interface in extended process
CN115357369B (en) CRD application integration calling method and device in k8s container cloud platform
CN104750528A (en) Management method and device for components in Android program
CN112000353A (en) Application running method and device and storage medium
CN112214388A (en) Memory monitoring method, device, equipment and computer readable storage medium
CN113986402A (en) Function calling method and device, electronic equipment and storage medium
CN116049207A (en) Application SQL script processing method and device, processor and electronic equipment
CN116382713A (en) Method, system, device and storage medium for constructing application mirror image
CN107977572B (en) Application program running method and device and intelligent terminal
CN113760543A (en) Resource management method and device, electronic equipment and computer readable storage medium
JP6859463B2 (en) Methods, devices, devices and media for launching virtual machines
US10552135B1 (en) Reducing a size of an application package
CN110347448B (en) Method for constructing runtime model of terminal application behavior
CN114880073A (en) Cloud application engine deployment method, device, equipment and storage medium for shielding Web framework for user
CN113867776A (en) Method and device for publishing middle station application, electronic equipment and storage medium
US20180341475A1 (en) Just In Time Deployment with Package Managers
CN115769191A (en) Managing asynchronous operations in a cloud computing environment
CN112596741B (en) Video monitoring service deployment method and device
CN117519733B (en) Project deployment method and device, storage medium and electronic equipment
CN117170738B (en) Method, system, equipment and storage medium for interaction of Python and Fortran
CN113296802B (en) Virtual machine hot upgrading method, host device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination