Cross-architecture DevOps implementation method and device and storage medium

By initializing the container image and building the target container image in the DevOps platform, it supports cross-architecture DevOps pipeline tasks, solves the complexity of cross-CPU architecture development, realizes multi-architecture cross-compilation and running of code, simplifies the development process and speeds up the development process. development cycle.

CN118796201APending Publication Date: 2024-10-18CHINA MOBILE GRP GUANGDONG CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410542832.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing DevOps platforms have problems with complexity and extended development cycles in cross-compiling and cross-running scenarios across different CPU architectures and applications. This is mainly because different hardware architectures require different compilers and build configurations, which complicates development.

Method used

By initializing the container image, building the target container image, and creating DevOps pipeline tasks on the interface, users can customize the task process and execute test tasks in the target container image. It supports multi-architecture testing and log monitoring, and simplifies the cross-architecture development process.

Benefits of technology

It enables cross-compilation and cross-running of the same code on different CPU architectures and operating systems, simplifying the development process and shortening the development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796201A_ABST
    Figure CN118796201A_ABST
Patent Text Reader

Abstract

The invention discloses a cross-architecture DevOps implementation method and device and a storage medium, and the method comprises the steps: initializing a container mirror image, completing the building of an environment based on the container mirror image, obtaining a target container mirror image, creating a DevOps assembly line task on an interface, obtaining a task process customized by a user through a visual interface, and obtaining a target container mirror image; and executing the DevOps assembly line task in the target container mirror image in response to the triggering of the DevOps assembly line task and when the task process comprises the target container mirror image, and outputting an execution result and a log. Therefore, the test task is executed in the target container mirror image to obtain the first test result, and the test task is executed in the second architecture in the virtual machine of the target container mirror image to obtain the second test result, so that the problems of cross-CPU architecture and / or cross-operating system and application cross compiling and cross running of the same code are solved; therefore, the development process is simplified, and the development period is accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and in particular to a cross-architecture DevOps implementation method, device, and storage medium. Background Art

[0002] The existing DevOps platform realizes automated code acquisition, code compilation, image building, and fully automatic deployment and operation of projects by integrating CI / CD tools, so that users can use the pipeline by simply configuring the pipeline template without writing complex execution scripts, which is simple and fast to operate. Among them, by integrating and applying different tools, practicing DevOps theory, thus realizing the unification and standardization of development, testing and operation and maintenance environments, and quickly delivering high-quality products through automated build, test and deployment cycles.

[0003] However, in some cases, such as when it comes to cross-CPU architectures, cross-compilation of applications, and cross-running, existing DevOps platforms have challenges and limitations. Specifically, the problem of cross-CPU architecture is often encountered when developing multi-platform applications. Different hardware architectures (such as x86, ARM, MIPS, etc.) may require different compilers and build configurations. Based on this, the development team needs to deal with different compilation options and library dependencies, which makes the development of cross-platform applications complicated and the development cycle longer. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a cross-architecture DevOps implementation method, device and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a cross-architecture DevOps implementation method is provided, the method comprising:

[0006] Initialize the container image, and complete the construction of the environment based on the container image to obtain the target container image;

[0007] Create DevOps pipeline tasks on the interface and obtain the task flow customized by the user through the visual interface;

[0008] In response to the DevOps pipeline task being triggered and the target container image being included in the task flow, the DevOps pipeline task is executed in the target container image, and the execution result and log are output.

[0009] Optionally, in the embodiment of the present disclosure, the initializing the container image and completing the construction of the environment based on the container image to obtain the target container image includes:

[0010] Obtain a Dockerfile file, and build a basic image based on the Dockerfile file;

[0011] Starting the base image, and installing a virtual machine in the environment of the base image according to the Dockerfile file, wherein the base image is a first architecture;

[0012] In response to the virtual machine being installed correctly, a target container image is built based on the currently constructed environment.

[0013] Optionally, in an embodiment of the present disclosure, obtaining the task process customized by the user through the visual interface includes: obtaining the customized task steps added by the user through the visual interface and the preset parameters of each task.

[0014] Optionally, in an embodiment of the present disclosure, the DevOps pipeline task includes a test task; executing the DevOps pipeline task in the target container image, and outputting the execution result and log, including:

[0015] Starting the target container image;

[0016] Execute the test task in the target container image to obtain a first test result;

[0017] Obtaining a second architecture to be built and an execution command corresponding to the second architecture;

[0018] Executing the execution command in the virtual machine of the target container image to build a second architecture, and executing the test task in the built second architecture to obtain a second test result;

[0019] Output the first test result, the second test result and a log.

[0020] Optionally, in the embodiment of the present disclosure, before executing the test task in the built environment, the method further includes:

[0021] Installing a benchmark tool in the environment where the second architecture is built;

[0022] Run the benchmark test using the benchmark test tool and obtain the test result after the test is completed;

[0023] If the test result satisfies the test task, the test task is executed in the constructed environment.

[0024] Optionally, in the embodiment of the present disclosure, the method further includes:

[0025] Integrating a first tool and a second tool into the target container image;

[0026] The logs in the target container image are monitored and recorded by the first tool and the second tool.

[0027] Optionally, in the embodiment of the present disclosure, monitoring and recording the logs in the target container image by using the first tool and the second tool includes:

[0028] Collecting log data in the target container image by using the second tool and storing it in an Elasticsearch database;

[0029] Obtaining a monitoring configuration file through the first tool, and monitoring the log data based on the monitoring configuration file;

[0030] If the log data meets the alarm triggering condition, an alarm notification is issued for the log data according to the preset alarm event processing rules.

[0031] According to a second aspect of an embodiment of the present disclosure, a cross-architecture DevOps implementation device is provided, the device comprising:

[0032] A building module is used to initialize the container image and complete the building of the environment based on the container image to obtain the target container image;

[0033] The acquisition module is used to create DevOps pipeline tasks on the interface and obtain the task flow customized by the user through the visual interface;

[0034] An execution module is used to execute the DevOps pipeline task in the target container image in response to the triggering of the DevOps pipeline task and when the task flow includes the target container image, and output the execution result and log.

[0035] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0036] processor;

[0037] a memory for storing processor-executable instructions;

[0038] The processor is configured to implement the method described in the first aspect above.

[0039] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, wherein the computer storage medium stores computer-executable instructions; after the computer-executable instructions are executed by a processor, the method described in the first aspect above can be implemented.

[0040] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0041] In a cross-architecture DevOps implementation method proposed in the present disclosure, the method includes: initializing the container image, and completing the construction of the environment based on the container image to obtain the target container image, creating a DevOps pipeline task on the interface, obtaining the task flow customized by the user through the visual interface, and responding to the triggering of the DevOps pipeline task and the task flow including the target container image, executing the DevOps pipeline task in the target container image, and outputting the execution results and logs. As a result, the present disclosure can execute the test task in the target container image to obtain the first test result, and can also execute the test task in the second architecture of the virtual machine of the target container image to obtain the second test result, thereby solving the problem of cross-compilation and cross-running of the same code across CPU architectures and / or operating systems, thereby simplifying the development process and accelerating the development cycle.

[0042] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0044] Figure 1 is a flow chart of a cross-architecture DevOps implementation method according to some embodiments of the present disclosure;

[0045] Figure 2 is a schematic diagram of a cross-architecture DevOps implementation device according to some embodiments of the present disclosure;

[0046] Figure 3 It is a block diagram of an electronic device suitable for executing a cross-architecture DevOps implementation method according to some embodiments of the present disclosure. DETAILED DESCRIPTION

[0047] Some embodiments of the present disclosure will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Various changes, modifications and equivalents of the methods, devices and / or systems described herein will become apparent after understanding the present disclosure. For example, the order of operations described herein is merely an example and is not limited to those orders set forth herein, but can be changed as becomes apparent after understanding the present disclosure, except for operations that must be performed in a specific order. In addition, for clarity and brevity, descriptions of features known in the art may be omitted.

[0048] The embodiments described in some embodiments of the present disclosure below do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0049] Figure 1 is a flow chart of a cross-architecture DevOps implementation method according to some embodiments of the present disclosure, such as Figure 1 As shown, the method may include the following steps:

[0050] In step 101, the container image is initialized, and the environment is built based on the container image to obtain the target container image.

[0051] It should be noted that the executor of the above-mentioned cross-architecture DevOps implementation method is a cross-architecture DevOps implementation device, which can be implemented by software and / or hardware. The cross-architecture DevOps implementation device in this embodiment can be configured in an electronic device.

[0052] In this example embodiment, the electronic device may include devices such as a server, and this embodiment does not limit the electronic device.

[0053] In the disclosed embodiment, before initializing the container image, Docker can be installed in the host environment where the DevOps pipeline is located, and it can be verified whether Docker is successfully installed. In response to the successful installation of Docker, the container image can be initialized in the environment where Docker is installed, and the environment is built based on the container image to obtain the target container image.

[0054] Specifically, in an embodiment of the present disclosure, a method for initializing a container image and completing the construction of an environment based on the container image to obtain a target container image may include the following steps:

[0055] In step 1, obtain the Dockerfile file and build a basic image based on the Dockerfile file.

[0056] In the disclosed embodiment, the Dockerfile file is used to define how to build a container image, wherein the building steps of the Docker image can be written according to the required configuration. Among them, the Dockerfile file contains the basic image, installation dependencies and copy files required for building, and the basic image can be built according to the execution commands in the Dockerfile file.

[0057] In the embodiment of the present disclosure, the Docker command can be used to build the basic image, and the command is as follows:

[0058] docker build -t your_image_name / path / to / Dockerfile / directory.

[0059] In step 2, the base image is started, and the virtual machine is installed in the environment of the base image according to the Dockerfile file, wherein the base image is the first architecture.

[0060] In the disclosed embodiment, after the base image is constructed through the above steps, the base image can be used to start the container, and the virtual machine can be installed in the environment of the base image according to the Dockerfile file. In the disclosed embodiment, the virtual machine can be installed through the installation command in the Dockerfile file, and the specific installation command may vary depending on the base image and the operating system. And, in the disclosed embodiment, the above first architecture can be x86, and the virtual machine can be QEMU.

[0061] For example, in the embodiment of the present disclosure, QEMU can be installed by the following installation command, the installation command is as follows:

[0062] RUN apt-get update&&\apt-get install-y qemu-user-static.

[0063] And, in the disclosed embodiment, after QEMU is installed by the installation command, a command can be used to verify whether QEMU is correctly installed. Specifically, in the disclosed embodiment, the qemu-arm-static --version command can be used to verify whether QEMU is correctly installed. If QEMU is installed correctly, the version information will be displayed; otherwise, an error message will be prompted.

[0064] In step 3, in response to the virtual machine being installed correctly, a target container image is built based on the currently constructed environment.

[0065] In the disclosed embodiment, in response to the virtual machine being installed correctly, a target container image can be built based on the currently built environment, that is, by installing the virtual machine in the base image. In the disclosed embodiment, the target container image can be built by the dockerbuild -t your_image_name / path / to / Dockerfile / directory command. And, in the disclosed embodiment, after the target container image is built, the built target container image can be uploaded to the container registry Docker Hub for subsequent calls.

[0066] And, in the disclosed embodiment, in response to the virtual machine being installed correctly, the first operation and / or the second operation may be performed to improve security. The first operation may include switching to a non-root user through the USER myuser command to run the service with the non-root user; the second operation may include limiting the network access rights of the container using the --network option. For example, connect the container to a custom Docker network or use --network none to completely disable network access, docker build -t your_image_name --network=your_custom_network / path / to / Dockerfile / directory.

[0067] Among them, in the embodiment of the present disclosure, Kubernetes can be installed to manage the above containers.

[0068] In step 102, a DevOps pipeline task is created on the interface, and the task flow customized by the user through the visual interface is obtained.

[0069] In the embodiment of the present disclosure, a DevOps pipeline task can be created on the interface, and the task flow customized by the user through the visual interface can be obtained. In the embodiment of the present disclosure, the method for obtaining the task flow customized by the user through the visual interface can include: obtaining the customized task steps added by the user through the visual interface and the preset parameters of each task.

[0070] Specifically, in the disclosed embodiment, the CI / CD tool Jenkins can be used to obtain the task flow customized by the user through the visual interface. In the disclosed embodiment, the customized task flow can include multiple tasks, and the execution flow of multiple tasks can be customized.

[0071] Also, in the disclosed embodiment, the multiple tasks may include pulling code, building an image, testing tasks, and deployment steps. Also, in the disclosed embodiment, pulling code may include pulling code from source code management and putting it into a working directory; building an image may include building an image using Docker, which requires specifying the image name and the path of the Dockerfile; the testing task may include testing in the image, which requires specifying the image name and the path of the test command; the deployment step may include pushing the built image to the image repository, and executing the command to deploy to the target environment as needed.

[0072] In step 103, in response to the triggering of the DevOps pipeline task and when the task flow includes the target container image, the DevOps pipeline task is executed in the target container image, and the execution result and log are output.

[0073] In an embodiment of the present disclosure, in response to a DevOps pipeline task trigger and the target container image is included in the task flow, the DevOps pipeline task can be executed in the target container image, and the execution results and logs can be output. Among them, in an embodiment of the present disclosure, three triggering methods can be provided: manual triggering, code repository callback triggering, and webhook callback triggering; one or more triggering methods can be checked on the interface, and when one of the checked methods is satisfied, the DevOps pipeline task is immediately triggered to execute. And, in an embodiment of the present disclosure, if the target container image is included in the task flow, that is, when the user specifies the image as the target container image, the DevOps pipeline task can be executed in the target container image, and the execution results and logs can be output.

[0074] Specifically, in an embodiment of the present disclosure, a method for executing a DevOps pipeline task in a target container image and outputting execution results and logs may include the following steps:

[0075] In step 1031, the target container image is started.

[0076] In step 1032, the test task is executed in the target container image to obtain a first test result.

[0077] In step 1033, the second architecture to be built and the execution command corresponding to the second architecture are obtained.

[0078] In step 1034, the execution command is executed in the virtual machine of the target container image to build a second architecture, and the test task is executed in the built second architecture to obtain a second test result.

[0079] In the embodiment of the present disclosure, the second architecture is different from the first architecture. Based on this, the execution command corresponding to the second architecture can be executed in the virtual machine of the target container image to build the second architecture, and the test task can be executed in the built second architecture to obtain the second test result, thereby solving the problem of cross-compilation and cross-running of the same code across CPU architectures and / or operating systems, thereby simplifying the development process and accelerating the development cycle. For example, the second architecture can be an ARM architecture.

[0080] Among them, in the embodiments of the present disclosure, for different ARM architectures (such as ARMv7 and ARMv8) or different ARM platforms (such as Raspberry Pi and BeagleBone), the QEMU execution commands to be used may be different.

[0081] Example 1: In the embodiment of the present disclosure, the execution command of the ARMv7-A architecture (Raspberry Pi 2) is:

[0082] qemu-system-arm-M raspi2-kernel / path / to / kernel_image-cpu cortex-a7-m256M.

[0083] Example 2: In the disclosed embodiment, the execution command of the ARMv8-A architecture (64-bit ARM server) is:

[0084] qemu-system-aarch64-M virt-cpu cortex-a57-m 2G-kernel / path / to / kernel_image

[0085] Example 3, in the embodiment of the present disclosure, the execution command of BeagleBone (ARMv7-A architecture) is:

[0086] qemu-system-arm-M beaglexm-kernel / path / to / kernel_image-dtb / path / to / beaglebone_device_tree.dtb-append"console=ttyAMA0 root= / dev / sda1"-serialstdio

[0087] And, in the embodiment of the present disclosure, the description of the above configuration parameters is:

[0088] -M: specifies the ARM platform or model to be simulated. Different platforms require different parameters;

[0089] -cpu: specifies the type of virtual CPU, including its architecture and model;

[0090] -m: The memory size allocated to the virtual machine;

[0091] -kernel: specifies the path of the kernel image;

[0092] -dtb: For some platforms, you need to specify the path to the device tree binary file;

[0093] -append: a string used to pass kernel startup parameters;

[0094] -serial stdio: Redirect the virtual machine's serial port output to the terminal.

[0095] Furthermore, in the disclosed embodiment, the user can adjust the execution command according to the specific ARM environment and requirements to be simulated.

[0096] Furthermore, in the embodiment of the present disclosure, before executing the test task in the built environment, the method may further include the following steps:

[0097] In step a, a benchmark tool is installed in an environment where the second architecture is built.

[0098] In step b, a benchmark test is run using a benchmark test tool, and a test result is obtained after the test is completed.

[0099] In step c, if the test result meets the test task, the test task is executed in the built environment.

[0100] Among them, in the embodiment of the present disclosure, after the second architecture is built in the virtual machine of the target container image through the above steps, a benchmark tool can be installed in the environment where the second architecture is built to verify whether the system performance of the second architecture meets the test task.

[0101] And, in the embodiment of the present disclosure, the above-mentioned benchmark test tool can be Phoronix Test Suite. Among them, Phoronix Test Suite can be installed in the environment where ARM is built through the installation command, and the installation command is as follows:

[0102] sudo apt-get update

[0103] sudo apt-get install phoronix-test-suite.

[0104] For example, in the embodiment of the present disclosure, assuming that the benchmark tool is Phoronix Test Suite, multiple different benchmark tests can be run using Phoronix Test Suite, for example, CPU performance testing can be performed through phoronix-test-suitebenchmark pts / cpu-test.

[0105] Among them, in the embodiment of the present disclosure, Phoronix Test Suite can automatically download and run the selected benchmark test, and provide test results after the test is completed. The user can evaluate whether the ARM environment (such as CPU performance) meets the test task based on the test results. If the test result meets the test task, the test task is executed in the built environment; otherwise, the above steps are re-executed until the test result meets the test task, and the test task is executed in the built environment.

[0106] In step 1035 , the first test result, the second test result and the log are output.

[0107] Furthermore, in the embodiment of the present disclosure, the above method may also include the following steps:

[0108] In step one, the first tool and the second tool are integrated into the target container image.

[0109] In step two, the logs in the target container image are monitored and recorded by the first tool and the second tool.

[0110] In the embodiment of the present disclosure, the first tool may be Prometheus, which is used to monitor the logs of containers and applications. Also, in the embodiment of the present disclosure, the second tool may be EFK Stack, which is used to collect and store container log data.

[0111] In an embodiment of the present disclosure, the above-mentioned method of integrating the second tool in the target container image may include: deploying an Elasticsearch cluster; deploying a Fluentd DaemonSet to run a Fluentd agent on each node in the Kubernetes cluster, responsible for collecting container logs and sending them to Elasticsearch; deploying Kibana for visualizing and querying log data, and connecting it to the Elasticsearch cluster.

[0112] Among them, in the embodiments of the present disclosure, dashboards and visualizations can be created in Kibana to view and analyze data from Prometheus and container logs, and Kibana can be connected to Elasticsearch to retrieve and visualize log data.

[0113] Furthermore, in an embodiment of the present disclosure, a method for monitoring and recording logs in a target container image by using a first tool and a second tool may include the following steps:

[0114] In step S1, log data in the target container image is collected by a second tool and stored in an Elasticsearch database.

[0115] In step S2, a monitoring configuration file is obtained by a first tool, and log data is monitored based on the monitoring configuration file.

[0116] In step S3, if the log data meets the alarm triggering condition, an alarm notification is issued for the log data according to the preset alarm event processing rules.

[0117] Among them, in the embodiment of the present disclosure, the configuration file of Fluentd in the second tool can be configured to define the log collection rules and targets of the container, and the collected container log data is sent to Elasticsearch for storage.

[0118] Furthermore, in the disclosed embodiment, the monitoring configuration file prometheus.yml of Prometheus can be obtained to define the target, indicator and alarm rules of monitoring log data, and the cycle of Prometheus can be configured to regularly capture the indicator data of the container.

[0119] Further, in the disclosed embodiment, the Alertmanager of Prometheus is used to set an alarm notification so that when the target and index of the monitored log data meet the alarm triggering condition (such as exceeding the threshold), the alarm is triggered, and the log data is notified of an alarm according to the preset alarm event processing rules. For example, the alarm notification can be sent to different targets, including email or Slack.

[0120] In one or more embodiments of the present disclosure, the container image is initialized, and the environment is built based on the container image to obtain the target container image, a DevOps pipeline task is created on the interface, and the task flow customized by the user through the visual interface is obtained. In response to the DevOps pipeline task being triggered and the target container image being included in the task flow, the DevOps pipeline task is executed in the target container image, and the execution results and logs are output. Thus, the present disclosure can execute the test task in the target container image to obtain the first test result, and can also execute the test task in the second architecture in the virtual machine of the target container image to obtain the second test result, thereby solving the problem of cross-compilation and cross-running of the same code across CPU architectures and / or operating systems, thereby simplifying the development process and accelerating the development cycle.

[0121] Figure 2 is a schematic diagram of a cross-architecture DevOps implementation device according to some embodiments of the present disclosure, such as Figure 2 As shown, the device includes a building module 201, an acquisition module 202, and an execution module 203.

[0122] The building module 201 is used to initialize the container image and complete the building of the environment based on the container image to obtain the target container image;

[0123] The acquisition module 202 is used to create a DevOps pipeline task on the interface and obtain the task flow customized by the user through the visual interface;

[0124] The execution module 203 is used to execute the DevOps pipeline task in the target container image in response to the triggering of the DevOps pipeline task and when the task flow includes the target container image, and output the execution result and log.

[0125] In one or more embodiments of the present disclosure, the container image is initialized, and the environment is built based on the container image to obtain the target container image, a DevOps pipeline task is created on the interface, and the task flow customized by the user through the visual interface is obtained. In response to the DevOps pipeline task being triggered and the target container image being included in the task flow, the DevOps pipeline task is executed in the target container image, and the execution results and logs are output. Thus, the present disclosure can execute the test task in the target container image to obtain the first test result, and can also execute the test task in the second architecture in the virtual machine of the target container image to obtain the second test result, thereby solving the problem of cross-compilation and cross-running of the same code across CPU architectures and / or operating systems, thereby simplifying the development process and accelerating the development cycle.

[0126] Optionally, in the embodiment of the present disclosure, the building module 201 is specifically used for:

[0127] Get the Dockerfile file and build a basic image based on the Dockerfile file;

[0128] Start the base image, and install the virtual machine in the environment of the base image according to the Dockerfile file, wherein the base image is the first architecture;

[0129] In response to the virtual machine being installed correctly, a target container image is built based on the currently constructed environment.

[0130] Optionally, in the embodiment of the present disclosure, the acquisition module 202 is specifically used to:

[0131] Get the custom task steps and preset parameters of each task added by the user through the visual interface.

[0132] Optionally, in an embodiment of the present disclosure, the DevOps pipeline task includes a test task; the execution module 203 is specifically used to:

[0133] Start the target container image;

[0134] Execute the test task in the target container image to obtain a first test result;

[0135] Get the second architecture to be built and the execution command corresponding to the second architecture;

[0136] Execute an execution command in the virtual machine of the target container image to build a second architecture, and execute a test task in the built second architecture to obtain a second test result;

[0137] Output the first test result, the second test result and the log.

[0138] Optionally, in the embodiment of the present disclosure, the execution module 203 is further used to:

[0139] Install the benchmark tool in the environment where the second architecture is built;

[0140] Use the benchmark tool to run the benchmark test and get the test results after the test is completed;

[0141] If the test results meet the test requirements, the test will be executed in the completed environment.

[0142] Optionally, in the embodiment of the present disclosure, the execution module 203 is further used to:

[0143] Integrate the first tool and the second tool in the target container image;

[0144] The logs in the target container image are monitored and recorded by the first tool and the second tool.

[0145] Optionally, in the embodiment of the present disclosure, the execution module 203 is further used to:

[0146] The log data in the target container image is collected by the second tool and stored in the Elasticsearch database;

[0147] Obtaining a monitoring configuration file through a first tool, and monitoring log data based on the monitoring configuration file;

[0148] If the log data meets the alarm triggering conditions, an alarm notification will be issued for the log data according to the preset alarm event processing rules.

[0149] like Figure 3 As shown, the electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 can also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0150] A number of components in the electronic device 300 are connected to the I / O interface 305, including: an input unit 306, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a disk, an optical disk, etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 309 allows the electronic device 300 to exchange information / data with other electronic devices through a computer network such as the Internet and / or various telecommunication networks.

[0151] The computing unit 301 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 301 performs the various methods and processes described above, such as a cross-architecture DevOps implementation method. For example, in some embodiments, the cross-architecture DevOps implementation method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via the ROM 302 and / or the communication unit 309. When the computer program is loaded into the RAM 303 and executed by the computing unit 301, one or more steps of the cross-architecture DevOps implementation method described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to execute the cross-architecture DevOps implementation method in any other appropriate manner (eg, by means of firmware).

[0152] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0153] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0154] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or electronic device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or electronic device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage electronic device, a magnetic storage electronic device, or any suitable combination of the foregoing.

[0155] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0156] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0157] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0158] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0159] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A cross-architecture DevOps implementation method, characterized in that: The method comprises: Initialize the container image, and complete the construction of the environment based on the container image to obtain the target container image; Create DevOps pipeline tasks on the interface and obtain the task flow customized by the user through the visual interface; In response to the DevOps pipeline task being triggered and the target container image being included in the task flow, the DevOps pipeline task is executed in the target container image, and the execution result and log are output.

2. The method according to claim 1, characterized in that The initializing container image and completing the construction of the environment based on the container image to obtain the target container image includes: Obtain a Dockerfile file, and build a basic image based on the Dockerfile file; Starting the base image, and installing a virtual machine in the environment of the base image according to the Dockerfile file, wherein the base image is a first architecture; In response to the virtual machine being installed correctly, a target container image is built based on the currently constructed environment.

3. The method according to claim 1, characterized in that The obtaining of the task flow customized by the user through the visual interface includes: obtaining the customized task steps added by the user through the visual interface and the preset parameters of each task.

4. The method according to claim 1, characterized in that The DevOps pipeline task includes a test task; the DevOps pipeline task is executed in the target container image, and the execution result and log are output, including: Starting the target container image; Execute the test task in the target container image to obtain a first test result; Obtaining a second architecture to be built and an execution command corresponding to the second architecture; Executing the execution command in the virtual machine of the target container image to build a second architecture, and executing the test task in the built second architecture to obtain a second test result; Output the first test result, the second test result and a log.

5. The method according to claim 4, characterized in that Before executing the test task in the constructed environment, the method further includes: Installing a benchmark tool in the environment where the second architecture is built; Run the benchmark test using the benchmark test tool and obtain the test result after the test is completed; If the test result satisfies the test task, the test task is executed in the constructed environment.

6. The method according to claim 4, characterized in that The method further comprises: Integrating a first tool and a second tool into the target container image; The logs in the target container image are monitored and recorded by the first tool and the second tool.

7. The method according to claim 6, characterized in that The monitoring and recording of the logs in the target container image by using the first tool and the second tool includes: Collecting log data in the target container image by using the second tool and storing it in an Elasticsearch database; Obtaining a monitoring configuration file through the first tool, and monitoring the log data based on the monitoring configuration file; If the log data meets the alarm triggering condition, an alarm notification is issued for the log data according to the preset alarm event processing rules.

8. A cross-architecture DevOps implementation device, characterized in that: The device comprises: A building module is used to initialize the container image and complete the building of the environment based on the container image to obtain the target container image; The acquisition module is used to create DevOps pipeline tasks on the interface and obtain the task flow customized by the user through the visual interface; An execution module is used to execute the DevOps pipeline task in the target container image in response to the triggering of the DevOps pipeline task and when the task flow includes the target container image, and output the execution result and log.

9. An electronic device, characterized in that: include: at least one processor; as well as A memory in communication connection with the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor can perform the method of any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, wherein the computer storage medium stores computer-executable instructions; after the computer-executable instructions are executed by a processor, the method according to any one of claims 1 to 7 can be implemented.

Citation Information

Cited By

  • Resource allocation method and device, computer equipment, readable storage medium and program product

    CN119576571A