Method, system, equipment and medium for transplanting iSulad container engine to open source gap system
By executing the configuration templates, patches and scripts of the iSulad container engine on the open source Hongmeng system, the operation problem of iSulad container on the system is solved, efficient and stable operation and smooth migration of containers are achieved, and the development of the open source Hongmeng container ecosystem has been promoted. .
Patent Information
- Application Number
- CN202411283763.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-10
AI Technical Summary
The original iSula container application cannot run in the open source Hongmeng system, resulting in the inability to meet the needs of business containerization in scenarios such as resource-constrained edge computing and the Internet of Things.
By providing configuration templates, patches and executable scripts related to the iSulad container engine, the script is executed step by step based on the open source Hongmeng system source code, the necessary system components and third-party tool source code are downloaded, the configuration files are modified, the running directory is added, and the system is recompiled. Generate and recordable image files to realize compatibility porting of iSulad container engine.
This enables the iSula container to operate efficiently and stably on the open source Hongmeng system, helping the original iSula container application to migrate smoothly, and promoting the development of the open source Hongmeng container ecosystem.
Smart Images

Figure CN119292661A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of operating system technology, and in particular to a method, system, device and medium for porting an iSulad container engine to an open source Hongmeng system. Background Art
[0002] In the past decade or so, with the rapid development of cloud computing and container technology, container engines have become an important part of cloud computing architecture. iSulad, as a lightweight and efficient container engine written in C / C++ programming language, has been widely used in multiple scenarios.
[0003] With the continuous rise of embedded device scenarios such as edge computing and the Internet of Things, the demand for business containerization is becoming increasingly urgent in resource-constrained environments. As a new operating system, the open source Hongmeng operating system has significant differences in its underlying architecture and API interface from traditional operating systems. The original iSula container application cannot run in the open source Hongmeng system. Summary of the invention
[0004] In view of the problem that the existing iSula container application cannot run in the open source Hongmeng system, the present invention proposes a method, system, device and medium for transplanting the iSulad container engine to the open source Hongmeng system; firstly, the iSulad container engine related configuration templates, patches and executable scripts are provided; secondly, based on the open source Hongmeng system source code, the executable script is executed in steps; finally, the entire system is recompiled to obtain a burnable image file; the compatibility transplantation of the iSulad container engine on the open source Hongmeng system is realized, so that the iSula container can run efficiently and stably on the open source Hongmeng system, and the original iSula container application is helped to be smoothly migrated and used on the open source Hongmeng system, which effectively promotes the development of the entire container ecosystem of the open source Hongmeng.
[0005] The specific implementation contents of the present invention are as follows: A method for porting an iSulad container engine to an open source Hongmeng system specifically includes the following steps: Step S1: Build configuration templates, patches and executable scripts related to the iSulad container engine; Step S2: According to the source code of the open source Hongmeng system, execute the executable script step by step, download the system components and third-party tool source code that are missing for the iSulad container engine transplantation, copy the configuration template to the specified path, complete the modification of the configuration files related to the iSulad container engine, add the iSula container running directory, and copy the patch to the specified path; Step S3: Recompile the open source Hongmeng system to obtain a burnable image file.
[0006] In order to better implement the present invention, further, the step S2 of executing the executable script step by step specifically includes the following steps: Step S21: Execute the first command of the script, copy the configuration template to the specified path, and add the iSula container running directory; Step S22: Execute the second command of the script to copy the patch to the specified path and install the patch into the open source Hongmeng system; Step S23: Execute the third command of the script to modify the kernel configuration file of the current open source Hongmeng system and enable the functional dependency of the iSulad container operation; Step S24: Execute the fourth command of the script to modify the compilation script of the current open source Hongmeng system and add the compilation of the iSulad container engine component.
[0007] In order to better implement the present invention, further, the step S21 specifically includes the following steps: Step S211: Execute the first script command to copy the configuration template to a specified path; Step S212: Enter the open source Hongmeng source code directory and add the iSula container running directory; Step S213: Set access permissions to the added iSula container running directory.
[0008] In order to better implement the present invention, further, the patch includes a first patch and a second patch; The first patch is used to fix the multi-process error that occurs when the iSulad container engine runs on the open source Hongmeng system; The second patch is used to cancel the iSulad container engine's support for the CRI standard protocol, not provide an external K8S access interface, and add the NAPI interface iSulad_interfaces implementation source code on the iSulad container engine.
[0009] In order to better implement the present invention, further, the step S23 specifically includes the following steps: Step S231: Execute the third command of the script to modify the kernel properties of the open source Hongmeng system source code directory; Step S232: Synchronously add the configuration items in the configuration file isulad_standard_defconfig to the current open source Hongmeng system kernel configuration file; Step S233: Modify the kernel configuration file of the current open source Hongmeng system to enable the functional dependency of the iSulad container operation.
[0010] In order to better implement the present invention, further, the step S24 specifically includes the following steps: Step S241: Execute the fourth command of the script to modify the compilation script of the open source Euler system; Step S242: modify the open source Hongmeng system compilation script according to the cross-compilation tool in the compilation tool directory of the open source Hongmeng system; Step S243: Add the NAPI subsystem compilation option of the iSulad container, and copy the NPAI interface source code directory iSulad_interfaces to the open source Hongmeng system source code directory; Step S244: Add the BUILD.gn file and the bundle.json file, and add the iSulad_interfaces subsystem to the open source Hongmeng system compilation options in the subsystem_config.json file.
[0011] In order to better implement the present invention, further, the step S3 specifically includes the following steps: Step S31: Check the relevant configuration files, directory structure and corresponding scripts, and enter the open source Euler system source code directory after the check passes; Step S32: Compile the iSulad engine and components. After successful compilation, enter the open source Hongmeng system source code directory; Step S33: copy the compiled iSulad engine and components to the corresponding / data / isulad directory; Step S34: Recompile the open source Hongmeng system. After successful compilation, the latest images burnable mirror file will be generated in the out directory of the open source Hongmeng system source code.
[0012] Based on the above-mentioned method of porting the iSulad container engine to the open source Hongmeng system, in order to better realize the present invention, further, a system for porting the iSulad container engine to the open source Hongmeng system is proposed, which is used to execute the above-mentioned method of porting the iSulad container engine to the open source Hongmeng system; including a construction module, a response module, and a compilation module; The construction module is used to build configuration templates, patches and executable scripts related to the iSulad container engine; The response module is used to execute the executable script step by step according to the source code of the open source Hongmeng system, download the system components and third-party tool source code that are missing for the iSulad container engine transplantation, copy the configuration template to the specified path, complete the modification of the configuration files related to the iSulad container engine, add the iSula container running directory, and copy the patch to the specified path; The compilation image module is used to recompile the open source Hongmeng system to obtain a burnable image file.
[0013] Based on the above-mentioned method of porting the iSulad container engine to the open source Hongmeng system, in order to better realize the present invention, further, an electronic device is proposed, including a memory and a processor; a computer program is stored on the memory; when the computer program is executed on the processor, the above-mentioned method of porting the iSulad container engine to the open source Hongmeng system is implemented.
[0014] Based on the above-mentioned method of porting the iSulad container engine to the open source Hongmeng system, in order to better realize the present invention, further, a computer-readable storage medium is proposed, on which computer instructions are stored; when the computer instructions are executed on the above-mentioned electronic device, the above-mentioned method of porting the iSulad container engine to the open source Hongmeng system is implemented.
[0015] The present invention has the following beneficial effects: The present invention realizes the compatibility transplantation of the iSulad container engine on the open source Hongmeng system, so that the iSula container can run efficiently and stably on the open source Hongmeng system, and helps the original iSula container application to be smoothly migrated and used on the open source Hongmeng system, effectively promoting the development of the entire container ecosystem of the open source Hongmeng. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic block diagram of the overall process of the method for porting the iSulad container engine provided by the present invention to the open source Hongmeng system.
[0017] Figure 2 This is a software architecture diagram of the iSulad container engine provided in an embodiment of the present invention.
[0018] Figure 3 This is a schematic diagram of the complete code directory of the iSulad container engine transplantation method provided by the present invention.
[0019] Figure 4 A schematic diagram of the system structure of the iSulad container engine provided by the present invention being transplanted to the open source Hongmeng system. DETAILED DESCRIPTION
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. It should be understood that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and therefore should not be regarded as limiting the scope of protection. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical personnel in this field without making creative work are within the scope of protection of the present invention.
[0021] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "disposed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0022] Embodiment 1: This embodiment proposes a method for porting the iSulad container engine to the open source Hongmeng system, which specifically includes the following steps: Step S1: Build configuration templates, patches, and executable scripts related to the iSulad container engine.
[0023] Step S2: According to the source code of the open source Hongmeng system, execute the executable script step by step, download the missing system components and third-party tool source code for the iSulad container engine transplantation, copy the configuration template to the specified path, complete the modification of the relevant configuration files of the iSulad container engine, add the iSula container running directory, and copy the patch to the specified path.
[0024] The stepwise execution of the executable script in step S2 specifically includes the following steps: Step S21: Execute the first command of the script, copy the configuration template to the specified path, and add the iSula container running directory; Furthermore, the step S21 specifically includes the following steps: Step S211: Execute the first script command to copy the configuration template to a specified path; Step S212: Enter the open source Hongmeng source code directory and add the iSula container running directory; Step S213: Set access permissions to the added iSula container running directory.
[0025] Step S22: Execute the second command of the script to copy the patch to the specified path and install the patch into the open source Hongmeng system; The patches include a first patch and a second patch; The first patch is used to fix the multi-process error that occurs when the iSulad container engine runs on the open source Hongmeng system; The second patch is used to cancel the iSulad container engine's support for the CRI standard protocol, not provide an external K8S access interface, and add the NAPI interface iSulad_interfaces implementation source code on the iSulad container engine.
[0026] Step S23: Execute the third command of the script to modify the kernel configuration file of the current open source Hongmeng system and enable the functional dependency of the iSulad container operation; Furthermore, the step S23 specifically includes the following steps: Step S231: Execute the third command of the script to modify the kernel properties of the open source Hongmeng system source code directory; Step S232: Synchronously add the configuration items in the configuration file isulad_standard_defconfig to the current open source Hongmeng system kernel configuration file; Step S233: Modify the kernel configuration file of the current open source Hongmeng system to enable the functional dependency of the iSulad container operation.
[0027] Step S24: Execute the fourth command of the script to modify the compilation script of the current open source Hongmeng system and add the compilation of the iSulad container engine component.
[0028] Furthermore, the step S24 specifically includes the following steps: Step S241: Execute the fourth command of the script to modify the compilation script of the open source Euler system; Step S242: modify the open source Hongmeng system compilation script according to the cross-compilation tool in the compilation tool directory of the open source Hongmeng system; Step S243: Add the NAPI subsystem compilation option of the iSulad container, and copy the NPAI interface source code directory iSulad_interfaces to the open source Hongmeng system source code directory; Step S244: Add the BUILD.gn file and the bundle.json file, and add the iSulad_interfaces subsystem to the open source Hongmeng system compilation options in the subsystem_config.json file.
[0029] Step S3: Recompile the open source Hongmeng system to obtain a burnable image file.
[0030] Furthermore, the step S3 specifically includes the following steps: Step S31: Check the relevant configuration files, directory structure and corresponding scripts, and enter the open source Euler system source code directory after the check passes; Step S32: Compile the iSulad engine and components. After successful compilation, enter the open source Hongmeng system source code directory; Step S33: copy the compiled iSulad engine and components to the corresponding / data / isulad directory; Step S34: Recompile the open source Hongmeng system. After successful compilation, the latest images burnable mirror file will be generated in the out directory of the open source Hongmeng system source code.
[0031] Working principle: This embodiment first provides iSulad container engine related configuration templates, patches and executable scripts; secondly, based on the source code of the open source Hongmeng system version 4.0, the executable script is executed in steps to download the system components and third-party tool source codes that are missing in the iSulad container engine transplantation to ensure that the main functions of the iSulad container engine work normally on the open source Hongmeng system, copy the configuration template to the specified path, complete the modification of the iSulad container engine related configuration files, add the necessary directory for the iSula container to run, and copy the patch to the specified path, and complete the patch upgrade of the open source Hongmeng system at the same time to support the container management, image management, network management, storage management, log management and application management of the iSula container on the open source Hongmeng system; finally, the entire system is recompiled to obtain a burnable image file. This embodiment completes the compatibility transplantation of the iSulad container engine on the open source Hongmeng system, so that the iSula container can run efficiently and stably on the open source Hongmeng system, help the original iSula container application to smoothly migrate and use on the open source Hongmeng system, and effectively promote the development of the entire container ecosystem of the open source Hongmeng.
[0032] Embodiment 2: This embodiment is based on the above embodiment 1. Figure 1 , Figure 2 A specific embodiment is used for detailed description.
[0033] Step S1: Provide iSulad container engine related configuration templates, patches, and executable scripts.
[0034] Configuration template: A basic configuration file prepared for the iSulad container engine, including various required settings.
[0035] Patch: Code changes developed to fix and enhance the open source Hongmeng system to support the iSulad container engine.
[0036] Step S2: Distribute and execute script commands.
[0037] Step S21: Execute the first command of the script, copy the configuration template to the specified path, and add the necessary directory for the iSula container to run; Step S22: Execute the second command of the script to copy the patch to the specified path and complete the operation of installing the patch in the current system; Step S23: Execute the third command of the script, modify the kernel configuration file, and enable the functional dependency of the iSula container operation; Step S24: Execute the fourth command of the script to modify the system compilation script and add support for compiling other components of the iSulad container engine.
[0038] This embodiment cross-compiles the iSulad container engine based on the open source Euler system version 22.09 source code; completes patch upgrades based on the open source Hongmeng system 4.0 source code, fixes the multi-process error problem that occurs when the iSulad container engine runs in the open source Hongmeng system, and adds the NAPI interface for the iSulad container engine; modifies the kernel configuration file based on the open source Hongmeng system 4.0 source code, and enables the functional dependency of the iSula container operation; it is necessary to add necessary directories to store the configuration files, dependent libraries, and executable files of the iSulad container engine; it is necessary to modify the compilation script of the open source Hongmeng system, and add the iSulad container engine compiled based on the open source Euler system and the dependent components to the compilation environment of the open source Hongmeng system.
[0039] Step S3: Recompile the entire system to obtain a burnable image file.
[0040] After applying all changes, recompile the entire system; this step will generate a burnable image file for installing and running the open source Hongmeng system with the iSula container on the device.
[0041] The iSulad container engine provides two external interfaces, CLI command line and NAPI, on the open source Hongmeng system for users to use, including container management, image management, network management, storage management, log management and application management.
[0042] Working principle: This application successfully ported the iSulad container engine to the open source Hongmeng system and provided two interfaces: CLI command line and NAPI. It completed the compatibility porting of the iSulad container engine on the open source Hongmeng system; helped the iSula container application to migrate and use smoothly on the open source Hongmeng system, effectively promoted the development of the entire container ecosystem of the open source Hongmeng; expanded the application scenarios of the iSulad container engine, enabling it to be developed under the open source Hongmeng system.
[0043] The other parts of this embodiment are the same as those of the above-mentioned embodiment 1, and thus will not be described in detail.
[0044] Embodiment 3: This embodiment is based on any one of the above embodiments 1 to 2. Figure 3 As shown, Figure 3 The directory shown is described.
[0045] Step S1: Provide iSulad container engine related configuration templates, patches and executable scripts; Configuration templates: including the iSula container image repository configuration template isula_hub_config.json, the iSula container operation configuration template isula_config.json, the iSula container management configuration template isula_config.v2.json, the iSula container APP information persistence configuration template isula_app_config.json, the iSulad container engine startup service configuration template openeuler_isulad.cfg on the open source Hongmeng system, and the iSulad container engine kernel configuration template isulad_standard_defconfig on the open source Hongmeng system.
[0046] Patch: Code changes developed to repair and enhance the open source Hongmeng system to support the iSulad container engine, including fixing the multi-process error problem that occurs when the iSulad container engine runs in the open source Hongmeng system in version 4.0 of the open source Hongmeng system. In addition, based on C++, the NAPI interface of the iSulad container engine is added in version 4.0 of the open source Hongmeng system to cover common container application scenarios. Its core functional interfaces include image management, container management, and application APP management.
[0047] Executable script: The script is executed according to Figure 3 The code directory structure shown in the figure is written to automate a series of steps and commands required in the migration process by executing scripts.
[0048] Step S21: Execute the first command of the script to convert the configuration template into Figure 3 Copy the code directory structure shown to the specified path, then enter the open source Hongmeng 4.0 version source directory, add the necessary directories for the iSula container to run, including: / data / isulad / [etc, bin, lib, run, var, opt, usr], and configure corresponding access permissions for these directories.
[0049] Step S22: Execute the second command of the script to apply the patch Figure 3Copy the code directory structure shown to the specified path, then enter the open source Hongmeng 4.0 version source directory to complete the patch operation in the current system. The patch is mainly divided into two parts. One part is to fix the multi-process error problem that occurs when the iSulad container engine runs in the open source Hongmeng system; the other part is to cancel the iSulad container engine's support for the CRI standard protocol, not provide an external K8S access interface, and add the iSulad container engine to the NAPI interface iSulad_interfaces implementation source code.
[0050] Step S23: Execute the third command of the script, modify the kernel configuration file, and enable the functional dependency of the iSula container. Modify the kernel features in the open source Hongmeng 4.0 version source code directory, and add the configuration items in the configuration file isulad_standard_defconfig to the current open source Hongmeng system kernel configuration file. Specifically, it mainly enables functions such as namespace, cgroup, network, and overlay filesystem in the open source Hongmeng system kernel.
[0051] Step S24: Execute the fourth command of the script to modify the system compilation script and add support for compiling other components of the iSulad container engine. Specifically, modify the open source Euler system compilation script and use Figure 3 The cross-compilation tool in the openharmony_prebuilts code directory shown in the figure; modify the open source Hongmeng system compilation script, specify the use of the same cross-compilation tool, and add the NAPI subsystem compilation option of iSulad, and Figure 3 Copy iSulad_interfaces in the code directory shown to the open source Hongmeng system source code directory, then add the BUILD.gn file and bundle.json file, and finally add the iSulad_interfaces subsystem to the system compilation options in the subsystem_config.json file.
[0052] Step S3: Recompile the entire system to obtain a burnable image file. Figure 3In the code directory shown, execute the iSulad_build.sh script, which will first check the relevant configuration files, directory structure and corresponding scripts. After the check is passed, it will enter the open source Euler system source code directory, compile the iSulad engine and components, and then enter the open source Hongmeng system source code directory after success. Copy the compiled iSulad engine and components to the system's corresponding / data / isulad directory, and then recompile the open source Hongmeng system. After successful compilation, the latest images that can be burned will be generated in the out directory of the open source Hongmeng system source code.
[0053] like Figure 2 This is an iSulad container engine software architecture diagram disclosed in this application. iSulad is a typical CS architecture model. It cancels the support of the CRI standard protocol and does not provide an external K8S access interface; it supports the CNI network standard protocol. Through the CNI protocol, iSulad communicates with specific network plug-ins through files in JSON format, thereby realizing the network function of the container; it supports the OCI standard image format and is compatible with the docker image format. It can support downloading container images from image repositories such as docker hub, or importing image files exported by docker; it supports the OCI standard runtime and can perform container lifecycle management. In addition to the above standards, it also provides standard basic image files, and implants the application management communication daemon by default, which communicates with the application management in JSON format through the MQTT protocol.
[0054] In the method of this application, iSulad, as a daemon server, provides two external interfaces, CLI command line and NAPI, for users to use, including container management, image management, network management, storage management, log management and application management. The CLI command line is the client command isula that comes with the iSulad engine; the NAPI access interface is implemented by calling the two services of iSulad's image and runtime through the interface, framework and service layer code according to the subsystem specifications in the open source Hongmeng system.
[0055] Specifically, image management includes: image downloading, importing, deleting, and upgrading operations.
[0056] Specifically, container management includes: container installation, uninstallation, start, stop, resource setting, and information query operations.
[0057] Specifically, network management includes: setting the IP address of the container.
[0058] Specifically, storage management includes: setting the storage path of the container's virtual disk file.
[0059] Specifically, log management includes: storage and query of log files inside the container.
[0060] Specifically, application management includes: application installation, uninstallation, start, stop, enable, disable, upgrade, resource setting, and information query operations.
[0061] Figure 3 The complete code directory of the iSulad container engine transplantation method provided in this embodiment. The entire transplantation process needs to be carried out according to this directory, wherein iSulad_build.sh is the transplantation command response script; iSulad_conf is the configuration file storage directory; iSulad_interfaces is the NPAI interface source code directory provided to the outside world; iSulad_patch is the patch file directory for the open source Euler system and the open source Hongmeng system; LICENSE is the description of the open source license agreement to be followed; README.md is the instructions for use of this application. The above directories or files are all provided by this application.
[0062] In addition, openEuler-22.09 is the source code directory of the open source Euler operating system; openHarmony-4.0 is the source code directory of the open source Hongmeng system; openharmony_prebuilts is the compilation tool directory provided by the open source Hongmeng system. The above directories or files need to be downloaded by users in the corresponding directories according to the version requirements.
[0063] Working principle: It can be seen that according to the iSulad container engine transplantation method of this embodiment, firstly, the iSulad container engine related configuration template, patch and executable script are provided; secondly, based on the source code of the open source Hongmeng system version 4.0, the executable script is executed in steps to download the system components and third-party tool source code missing from the iSulad container engine transplantation to ensure that the main functions of the iSulad container engine work normally on the open source Hongmeng system, copy the configuration template to the specified path, complete the modification of the iSulad container engine related configuration files, add the necessary directory for the iSula container to run, and copy the patch to the specified path, and complete the patch upgrade of the open source Hongmeng system at the same time to support the container management, image management, network management, storage management, log management and application management of the iSula container on the open source Hongmeng system; finally, the entire system is recompiled to obtain a burnable image file. This application completes the compatibility transplantation of the iSulad container engine on the open source Hongmeng system, so that the iSula container can run efficiently and stably on the open source Hongmeng system, help the original iSula container application to smoothly migrate and use on the open source Hongmeng system, and effectively promote the development of the entire container ecosystem of the open source Hongmeng.
[0064] The other parts of this embodiment are the same as any one of the above-mentioned embodiments 1-2, so they will not be repeated here.
[0065] Embodiment 4: This embodiment is based on any one of the above embodiments 1 to 3. Figure 4 As shown, a system for porting the iSulad container engine to the open source Hongmeng system is proposed, which is used to execute the above-mentioned method of porting the iSulad container engine to the open source Hongmeng system; it includes a building module, a response module, and a compilation module; The construction module is used to build configuration templates, patches and executable scripts related to the iSulad container engine; The response module is used to execute the executable script step by step according to the source code of the open source Hongmeng system, download the system components and third-party tool source code that are missing for the iSulad container engine transplantation, copy the configuration template to the specified path, complete the modification of the configuration files related to the iSulad container engine, add the iSula container running directory, and copy the patch to the specified path; The compilation image module is used to recompile the open source Hongmeng system to obtain a burnable image file.
[0066] This embodiment also proposes an electronic device, including a memory and a processor; a computer program is stored on the memory; when the computer program is executed on the processor, the method of porting the above-mentioned iSulad container engine to the open source Hongmeng system is implemented.
[0067] This embodiment also proposes a computer-readable storage medium, on which computer instructions are stored; when the computer instructions are executed on the above-mentioned electronic device, the method of porting the above-mentioned iSulad container engine to the open source Hongmeng system is implemented.
[0068] Working principle: The response module described in this embodiment includes a first response module, a second response module, a third response module, and a fourth response module; A first response module is configured to respond to the first command of the script, copy the iSulad container engine configuration template to a specified path, and add a necessary directory for the iSula container to run; A second response module is configured to respond to the second command of the script, copy the iSulad container engine patch to a specified path, and complete the operation of inserting the patch into the current open source Hongmeng system; A third response module is configured to respond to the third command of the script, modify the current open source Hongmeng system kernel configuration file, and enable the functional dependency of the iSula container operation; A fourth response module is configured to respond to the fourth command of the script, modify the current open source Hongmeng system compilation script, and add support for compiling other components of the iSulad container engine; The compilation module is configured to respond to the script packaging command, and will recompile the entire system to finally obtain a burnable image file.
[0069] The other parts of this embodiment are the same as any one of the above-mentioned embodiments 1 to 3, so they will not be repeated here.
[0070] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for porting the iSulad container engine to the open source Hongmeng system, characterized in that: The specific steps include: Step S1: Build configuration templates, patches and executable scripts related to the iSulad container engine; Step S2: According to the source code of the open source Hongmeng system, execute the executable script step by step, download the system components and third-party tool source code that are missing for the iSulad container engine transplantation, copy the configuration template to the specified path, complete the modification of the configuration files related to the iSulad container engine, add the iSula container running directory, and copy the patch to the specified path; Step S3: Recompile the open source Hongmeng system to obtain a burnable image file.
2. According to claim 1, a method for porting the iSulad container engine to the open source Hongmeng system is characterized in that: The stepwise execution of the executable script in step S2 specifically includes the following steps: Step S21: Execute the first command of the script, copy the configuration template to the specified path, and add the iSula container running directory; Step S22: Execute the second command of the script to copy the patch to the specified path and install the patch into the open source Hongmeng system; Step S23: Execute the third command of the script to modify the kernel configuration file of the current open source Hongmeng system and enable the functional dependency of the iSulad container operation; Step S24: Execute the fourth command of the script to modify the compilation script of the current open source Hongmeng system and add the compilation of the iSulad container engine component.
3. According to claim 2, a method for porting the iSulad container engine to the open source Hongmeng system is characterized in that: The step S21 specifically includes the following steps: Step S211: Execute the first script command to copy the configuration template to a specified path; Step S212: Enter the open source Hongmeng source code directory and add the iSula container running directory; Step S213: Set access permissions to the added iSula container running directory.
4. According to claim 1, a method for porting the iSulad container engine to the open source Hongmeng system is characterized in that: The patches include a first patch and a second patch; The first patch is used to fix the multi-process error that occurs when the iSulad container engine runs on the open source Hongmeng system; The second patch is used to cancel the iSulad container engine's support for the CRI standard protocol, not provide an external K8S access interface, and add the NAPI interface iSulad_interfaces implementation source code on the iSulad container engine.
5. According to claim 2, a method for porting the iSulad container engine to the open source Hongmeng system is characterized in that: The step S23 specifically includes the following steps: Step S231: Execute the third command of the script to modify the kernel properties of the open source Hongmeng system source code directory; Step S232: Synchronously add the configuration items in the configuration file isulad_standard_defconfig to the current open source Hongmeng system kernel configuration file; Step S233: Modify the kernel configuration file of the current open source Hongmeng system to enable the functional dependency of the iSulad container operation.
6. According to claim 2, a method for porting the iSulad container engine to the open source Hongmeng system is characterized in that: The step S24 specifically includes the following steps: Step S241: Execute the fourth command of the script to modify the compilation script of the open source Euler system; Step S242: modify the open source Hongmeng system compilation script according to the cross-compilation tool in the compilation tool directory of the open source Hongmeng system; Step S243: Add the NAPI subsystem compilation option of the iSulad container, and copy the NPAI interface source code directory iSulad_interfaces to the open source Hongmeng system source code directory; Step S244: Add the BUILD.gn file and the bundle.json file, and add the iSulad_interfaces subsystem to the open source Hongmeng system compilation options in the subsystem_config.json file.
7. According to claim 1, a method for porting the iSulad container engine to the open source Hongmeng system is characterized in that: The step S3 specifically comprises the following steps: Step S31: Check the relevant configuration files, directory structure and corresponding scripts, and enter the open source Euler system source code directory after the check passes; Step S32: Compile the iSulad engine and components. After successful compilation, enter the open source Hongmeng system source code directory; Step S33: copy the compiled iSulad engine and components to the corresponding / data / isulad directory; Step S34: Recompile the open source Hongmeng system. After successful compilation, the latest images burnable mirror file will be generated in the out directory of the open source Hongmeng system source code.
8. A system for porting an iSulad container engine to an open source Hongmeng system, used to execute the method for porting an iSulad container engine to an open source Hongmeng system as claimed in claim 1; characterized in that: Includes building module, response module, and compilation module; The construction module is used to build configuration templates, patches and executable scripts related to the iSulad container engine; The response module is used to execute the executable script step by step according to the source code of the open source Hongmeng system, download the system components and third-party tool source code that are missing for the iSulad container engine transplantation, copy the configuration template to the specified path, complete the modification of the configuration files related to the iSulad container engine, add the iSula container running directory, and copy the patch to the specified path; The compilation image module is used to recompile the open source Hongmeng system to obtain a burnable image file.
9. An electronic device, characterized in that: It includes a memory and a processor; a computer program is stored on the memory; when the computer program is executed on the processor, the method of porting the iSulad container engine to the open source Hongmeng system as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions; when the computer instructions are executed on the electronic device as described in claim 9, the method of porting the iSulad container engine as described in any one of claims 1-7 to the open source Hongmeng system is implemented.