CN116594647A - Docker technology-based software adaptation method - Google Patents
Docker technology-based software adaptation method Download PDFInfo
- Publication number
- CN116594647A CN116594647A CN202310687013.XA CN202310687013A CN116594647A CN 116594647 A CN116594647 A CN 116594647A CN 202310687013 A CN202310687013 A CN 202310687013A CN 116594647 A CN116594647 A CN 116594647A
- Authority
- CN
- China
- Prior art keywords
- software
- file
- docker
- container
- mirror image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 230000006978 adaptation Effects 0.000 title claims abstract description 22
- 238000005516 engineering process Methods 0.000 title claims abstract description 18
- 238000010276 construction Methods 0.000 claims abstract description 21
- 230000015572 biosynthetic process Effects 0.000 claims description 5
- 238000004364 calculation method Methods 0.000 description 14
- 230000009286 beneficial effect Effects 0.000 description 6
- 238000011161 development Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 238000009434 installation Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 239000013049 sediment Substances 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/76—Adapting program code to run in a different environment; Porting
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a software adaptation method based on a Docker technology, which belongs to the technical field of software adaptation, and comprises the steps of writing an instruction file, and constructing a mirror image adapted to an ARM architecture by using a Docker engine and a cross-platform mirror image construction tool according to the instruction file to obtain a mirror image file; installing a Docker engine on an operating system taking an ARM architecture processor as a core, and running an image file to obtain a container; and entering the container, and selecting a software calculation module and a software calculation file to instruct the running of the software to complete software adaptation. The invention solves the problem that professional scientific computing software cannot migrate to an ARM architecture platform.
Description
Technical Field
The invention belongs to the technical field of software adaptation, and particularly relates to a software adaptation method based on a Docker technology.
Background
The X86 instruction set employs a Complex Instruction Set Computer (CISC) architecture, where the complexity of the instruction set results in inefficient execution of instructions, high power consumption, and inflexibility. Compared with the ARM architecture processor, the ARM architecture processor adopts a Reduced Instruction Set Computer (RISC) processor, has relatively small instruction quantity, can realize complex calculation and operation through combination, not only improves the instruction running speed, but also reduces the power consumption to the greatest extent. Vendors such as domestic Feiteng and spread have also been able to realize autonomous production of ARM architecture processors and adapt to domestic operating systems. In the foreseeable future, a large amount of software will be migrated to the ARM architecture, and the bottom architecture adaptation is the first step for realizing domestic adaptation and is also an effective way for realizing high-performance calculation, but how to migrate professional scientific calculation software to the ARM architecture platform is a key difficulty currently faced.
Disclosure of Invention
Aiming at the defects in the prior art, the software adaptation method based on the dock technology solves the problem that professional scientific computing software cannot be migrated to an ARM architecture platform.
In order to achieve the aim of the invention, the invention adopts the following technical scheme: a method for adapting software based on a Docker technology, comprising the steps of:
s1, writing an instruction file, and constructing a mirror image adapted to an ARM architecture by using a Docker engine and a cross-platform mirror image construction tool according to the instruction file to obtain a mirror image file;
s2, installing a Docker engine on an operating system taking an ARM architecture processor as a core, and running a mirror image file to obtain a container;
s3, entering the container, and selecting a software calculation module and a software calculation file command to run the software to complete software adaptation.
The beneficial effects of the invention are as follows: a set of complete instruction files are written, an image file is generated through a cross-platform image construction tool, a dock engine is installed on an operating system taking an ARM architecture processor as a core, the constructed image file is directly pulled to generate a container and run software, and the software is matched with an ARM architecture platform. Meanwhile, the software is isolated from the host operating system by adopting a container technology, so that the setting of various environment variables in the software installation process can be avoided, and the problems of conflict and incompatibility between the software and the operating system are avoided.
Further, the version of the Docker engine in step S1 supports the cross-underlying CPU architecture image formation technique.
The beneficial effects of the above-mentioned further scheme are: by adopting the cross-bottom-layer CPU architecture mirror image formation technology, the infrastructure can be a personal computer or a remote server, the development platform is easy to build, the operating system can be Windows or Linux which is adaptive to the Docker engine, the operation of a developer is convenient, and the cost is reduced.
Further, the instruction file in the step S1 includes a software source file and environment variable setting information.
The beneficial effects of the above-mentioned further scheme are: the instruction file comprises the source file and the environment variable setting information of the software, unified mirror image environment variable configuration and software version, the source code is controllable, the situation that the software is unavailable due to update is avoided, and the software update and secondary development are facilitated.
Further, in the step S1, the cross-platform image construction tool may compile commands by simulating different bottom CPU architectures according to the instruction file, so as to generate an image file suitable for the ARM architecture.
The beneficial effects of the above-mentioned further scheme are: the Docker construction toolkit expands the construction function, adopts a mechanism similar to virtualization in the mirror image, packages the application program and the dependency in an independent container environment, isolates the running environment of the software from the underlying architecture, and realizes cross-platform adaptation of the software.
Further, the entering into the container in the step S3 is specifically entering into the container with root authority.
The beneficial effects of the above-mentioned further scheme are: the method directly runs the software in the container, solves the problems of version update, a plurality of port conflicts and the like in the application environment and the application configuration process, can run on all ARM architecture operation platforms supporting the Docker container by one key, and achieves quick arrangement of the software.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
FIG. 2 is a schematic diagram illustrating the problem of the software adaptation of the present invention.
FIG. 3 is a schematic diagram of mirror image construction in an embodiment of the invention.
FIG. 4 is a technical flow diagram of hierarchical construction of a telemac: v8p4 version image in an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and all the inventions which make use of the inventive concept are protected by the spirit and scope of the present invention as defined and defined in the appended claims to those skilled in the art.
As shown in fig. 1, in one embodiment of the present invention, a software adaptation method based on the Docker technology includes the following steps:
s1, writing an instruction file, and constructing a mirror image adapted to an ARM architecture by using a Docker engine and a cross-platform mirror image construction tool according to the instruction file to obtain a mirror image file;
s2, installing a Docker engine on an operating system taking an ARM architecture processor as a core, and running a mirror image file to obtain a container;
s3, entering the container, and selecting a software calculation module and a software calculation file command to run the software to complete software adaptation.
In this embodiment, the ARM architecture processor is a domestic ARM architecture processor.
In this embodiment, taking a hydrographic hydrodynamic model TELEMAC and a spread 920 processor as an example, the two are adapted, and the method mainly includes the following steps:
(1) The Docker engine is installed, version 23.0.1.
(2) A cross-platform mirror image construction tool is installed for multi-platform mirror image construction.
(3) And writing an instruction file comprising source code compiling and environment variable setting, and constructing an image which is suitable for the ARM architecture.
(4) After the image construction is completed, the image is stored in a private image warehouse.
(5) The Docker engine is installed on an openEuler operating system with a Kunpeng 920 processor as a core.
(6) And (3) pulling the image file constructed in the step (3) from the private image warehouse.
(7) And running an image file on the openEuler operating system to generate a running container, and performing case test.
(8) When running the container, parameters such as the name of the container, port mapping, shared folder, etc. are specified.
(9) Entering the container interior and designating the name of the container, sharing the folder.
(10) A calculation module and a calculation file command run model are selected.
Compared with the prior art, the method has the beneficial effects that: by constructing a mirror image technology in a cross-platform manner, writing a set of complete Dockerfile generated mirror image, uploading the mirror image to a private warehouse, installing a Docker engine on an openEuler operating system taking a spread-Pengpeng 920 processor as a core, directly pulling the constructed mirror image to directly generate a container and running software, and realizing the adaptation of TELEMAC software and the openEuler operating system. Meanwhile, the TELEMAC software is isolated from a host operating system by adopting a container technology, so that the setting of various environment variables in the software installation process can be avoided, and the problems of conflict and incompatibility between the software and the operating system are avoided.
In this embodiment, (7) software is directly run in the container, so that the problems of version update, multiple port conflicts and the like in the application environment and the application configuration process are solved, and the software can be run on all operation platforms supporting the ARM architecture of the Docker container by one key, so that the quick arrangement of TELEMAC software is realized.
In this embodiment, (8) when the container is operated, the name and the shared folder of the container may be specified, and the calculation result in the container may be mapped to the folder corresponding to the host machine in a sharing manner, so as to avoid unexpected stopping of the container, data loss, and increase data security.
In this embodiment, the calculation module and the calculation file command may be flexibly changed, and adjusted according to different required calculation models, and the file type corresponding to the selected model is input, so that the constructed image has all calculation functions of the TELEMAC software. The calculation module comprises 1D,2D and 3D hydrodynamic models, and can solve the problems of wave propagation, water quality pollution, surface hydrology, sediment migration and the like. The calculation file command for starting the TELEMAC-2D module to calculate the surface hydrologic calculation is as follows:
telema2d.py t2d_pluie_cn_geo_hyetogram.cas—ncsize=12telema2d.py is a select module command;
t2d_page_cn_geo_hyetogram.cas is an example file to be calculated;
-ncsize=12 is the number of selected parallel cores.
The version of the Docker engine in step S1 supports the cross-underlying CPU architecture image formation technique.
In this embodiment, the Docker version must support cross-floor CPU architecture image formation techniques. The multi-platform image construction simulator can simulate different bottom-layer CPU architecture compiling commands through the simulator, so that the simulator can generate image files suitable for ARM architectures.
The instruction file in step S1 includes a software source file and environment variable setting information.
In the step S1, the cross-platform image construction tool may generate an image file suitable for the ARM architecture by simulating different underlying CPU architectures to compile commands according to the instruction file.
In this embodiment, the instruction file includes the source file of the TELEMAC and the environment variable setting information, and the mirror image environment variable configuration and the software version are controlled, so that the software is prevented from being unavailable due to update, and the software update and secondary development are facilitated.
In the step S3, the container is accessed, specifically, the container is accessed with root authority.
In the embodiment, in the running process in the container, the root authority enters the container, so that calculation error reporting caused by insufficient read-write authority in the running process of software in the container is avoided.
In this embodiment, the features of high performance and low power consumption exhibited by the ARM architecture make it the preferred processor for professional computing software, but TELEMAC software cannot currently run on an operating system with the ARM architecture processor as a core.
Therefore, the adaptation process of the invention mainly solves the problem that the underlying architecture and the operating system are inconsistent, and the difference of the underlying architecture also causes great difficulty in the process of software adaptation.
The problem with software adaptation is shown in figure 2.
In the embodiment, based on the invention, a Docker container cross-platform image construction technology is adopted to carry out image construction on the hydrodynamic and hydrologic simulation software TELEMAC, and the TELEMAC source code is compiled and the running environment is set in the Docker file to obtain the TELEMAC image with software and related running environments. So that it can be adapted to the openEuler of the ARM architecture as an operating system. Finally, the test generated image can independently run on the openEuler operating system, and meanwhile, the software running function is ensured to be unchanged.
In this embodiment, the Docker engine is installed as a server based on the ARM architecture as the bottom layer, and different operating systems based on the spread spectrum 920 processor are tested: the mirror image constructed in the step (1) can be used for carrying out case test, the calculated result is consistent with the standard result, and the adaptation of the domestic ARM processor and the operating system of the hydrologic hydrodynamic calculation model TELEMAC-2D is realized.
In this embodiment, the Docker mirror image is formed by a command and parameters required for constructing the mirror image from top to bottom, and each command is executed in a layered construction process. The construction principle of the mirror image is shown in fig. 3.
Firstly, selecting a basic image as a basis to construct a new image, executing a first Dockerfile instruction to modify a container generated by the basic image, and adding an environment variable and a necessary library for running software; then executing the operation similar to 'dock commit', and submitting the modified container to a new mirror layer; and finally, running a new container to continue executing the next command by taking the constructed new image as a basic image. In this way, each instruction in the Dockerfile is executed in turn until all instructions are executed, at which time the image is also built.
The TELEMAC image is constructed through a Dockerfile file, and the Dockerfile file summarizes the whole image, wherein the Dockerfile file comprises environment variable configuration, software dependent installation, operation commands of software downloading and installation and the like of constructed image software. The Docker version adopted by the invention is 23.0.1, and FIG. 4 is a technical flow chart of hierarchical construction of a telemac-v 8p4 version mirror image.
Claims (5)
1. The software adaptation method based on the Docker technology is characterized by comprising the following steps:
s1, writing an instruction file, and constructing a mirror image adapted to an ARM architecture by using a Docker engine and a cross-platform mirror image construction tool according to the instruction file to obtain a mirror image file;
s2, installing a Docker engine on an operating system taking an ARM architecture processor as a core, and running a mirror image file to obtain a container;
s3, entering the container, and selecting a software calculation module and a software calculation file command to run the software to complete software adaptation.
2. The method for adapting software based on the Docker technology according to claim 1, wherein the version of the Docker engine in step S1 supports a cross-underlying CPU architecture image formation technology.
3. The method for adapting software based on the Docker technology according to claim 1, wherein the instruction file in the step S1 includes a software source file and environment variable setting information.
4. The method for adapting software based on the Docker technology according to claim 1, wherein the cross-platform image construction tool in step S1 can generate an image file applicable to the ARM architecture by simulating different underlying CPU architecture compiling commands according to the instruction file.
5. The method for adapting software based on the Docker technology according to claim 1, wherein the entering into the container in step S3 is specifically entering into the container with root authority.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310687013.XA CN116594647A (en) | 2023-06-09 | 2023-06-09 | Docker technology-based software adaptation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310687013.XA CN116594647A (en) | 2023-06-09 | 2023-06-09 | Docker technology-based software adaptation method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116594647A true CN116594647A (en) | 2023-08-15 |
Family
ID=87590014
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310687013.XA Pending CN116594647A (en) | 2023-06-09 | 2023-06-09 | Docker technology-based software adaptation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116594647A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116795453A (en) * | 2023-08-28 | 2023-09-22 | 成都中科合迅科技有限公司 | Multi-CPU architecture call control method and system for application program |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109032602A (en) * | 2018-06-07 | 2018-12-18 | 山东超越数控电子股份有限公司 | A kind of method of software automatic adaptation operating system |
CN110032376A (en) * | 2018-12-13 | 2019-07-19 | 中国电子科技集团公司电子科学研究院 | Automated software dispositions method and device based on Docker |
CN110457066A (en) * | 2019-07-27 | 2019-11-15 | 湖南豪威电子信息技术服务有限公司 | Make the framework of the compatible Windows system software of domestic operating system |
CN111309451A (en) * | 2020-03-24 | 2020-06-19 | 广西梯度科技有限公司 | Method for realizing cross compilation of Docker mirror images |
CN111399865A (en) * | 2020-04-21 | 2020-07-10 | 贵州新致普惠信息技术有限公司 | Method for automatically constructing target file based on container technology |
CN112181588A (en) * | 2020-09-18 | 2021-01-05 | 济南浪潮数据技术有限公司 | Application containerization method and device, electronic equipment and storage medium |
CN113918274A (en) * | 2021-09-08 | 2022-01-11 | 成都安恒信息技术有限公司 | Docker container-based KVM virtual machine migration method |
WO2022052657A1 (en) * | 2020-09-11 | 2022-03-17 | 苏州浪潮智能科技有限公司 | Method and apparatus for processing mirror images of ai platform |
CN114443221A (en) * | 2022-01-11 | 2022-05-06 | 徐工汉云技术股份有限公司 | Method and system for constructing cross-platform container mirror image based on build dah and electronic equipment |
CN115599499A (en) * | 2022-10-20 | 2023-01-13 | 湖南阿姆科技有限公司(Cn) | Cross-platform software adaptation method based on container technology |
-
2023
- 2023-06-09 CN CN202310687013.XA patent/CN116594647A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109032602A (en) * | 2018-06-07 | 2018-12-18 | 山东超越数控电子股份有限公司 | A kind of method of software automatic adaptation operating system |
CN110032376A (en) * | 2018-12-13 | 2019-07-19 | 中国电子科技集团公司电子科学研究院 | Automated software dispositions method and device based on Docker |
CN110457066A (en) * | 2019-07-27 | 2019-11-15 | 湖南豪威电子信息技术服务有限公司 | Make the framework of the compatible Windows system software of domestic operating system |
CN111309451A (en) * | 2020-03-24 | 2020-06-19 | 广西梯度科技有限公司 | Method for realizing cross compilation of Docker mirror images |
CN111399865A (en) * | 2020-04-21 | 2020-07-10 | 贵州新致普惠信息技术有限公司 | Method for automatically constructing target file based on container technology |
WO2022052657A1 (en) * | 2020-09-11 | 2022-03-17 | 苏州浪潮智能科技有限公司 | Method and apparatus for processing mirror images of ai platform |
CN112181588A (en) * | 2020-09-18 | 2021-01-05 | 济南浪潮数据技术有限公司 | Application containerization method and device, electronic equipment and storage medium |
CN113918274A (en) * | 2021-09-08 | 2022-01-11 | 成都安恒信息技术有限公司 | Docker container-based KVM virtual machine migration method |
CN114443221A (en) * | 2022-01-11 | 2022-05-06 | 徐工汉云技术股份有限公司 | Method and system for constructing cross-platform container mirror image based on build dah and electronic equipment |
CN115599499A (en) * | 2022-10-20 | 2023-01-13 | 湖南阿姆科技有限公司(Cn) | Cross-platform software adaptation method based on container technology |
Non-Patent Citations (2)
Title |
---|
李国一,刘家宏等: "基于TELEMAC-2D的山东东营市天鹅湖蓄滞洪区运行调度特征分析", 中国防汛抗旱, vol. 31, no. 10, pages 1 * |
荣国平,张贺,邵栋编: "工业和信息化领域急需紧缺人才大数据和人工智能培养工程系列丛书 DevOps 原理方法与实践 第2版", 31 July 2022, 机械工业出版社, pages: 1 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116795453A (en) * | 2023-08-28 | 2023-09-22 | 成都中科合迅科技有限公司 | Multi-CPU architecture call control method and system for application program |
CN116795453B (en) * | 2023-08-28 | 2023-11-03 | 成都中科合迅科技有限公司 | Multi-CPU architecture call control method and system for application program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109961151B (en) | System of computing services for machine learning and method for machine learning | |
Kaliszyk et al. | HOL (y) Hammer: Online ATP service for HOL Light | |
US10768916B2 (en) | Dynamic generation of CPU instructions and use of the CPU instructions in generated code for a softcore processor | |
US20210350233A1 (en) | System and Method for Automated Precision Configuration for Deep Neural Networks | |
US20040268293A1 (en) | Automating the life cycle of a distributed Computing application | |
CN116594647A (en) | Docker technology-based software adaptation method | |
US20200065156A1 (en) | Computationally efficient reinforcement-learning-based application manager | |
CN106886406A (en) | The generation method and device of exploitation code or document | |
CN114881233B (en) | Distributed model reasoning service method based on container | |
US20200065495A1 (en) | Safe-operation-constrained reinforcement-learning-based application manager | |
JPH10171848A (en) | Method for designing architecture system | |
US11080623B2 (en) | Automated reinforcement-learning-based application manager that uses action tags and metric tags | |
Wang et al. | The GPU version of LASG/IAP Climate System Ocean Model version 3 (LICOM3) under the heterogeneous-compute interface for portability (HIP) framework and its large-scale application | |
EP3923133A1 (en) | Systems and methods for generating service access points for rte services in code or other rte service information for use with the code | |
WO2023033801A1 (en) | System and method for design exploration using dynamic environment and physics simulations | |
US20230011461A1 (en) | Method and system for generating engineering diagrams in an engineering system | |
CN102253884B (en) | The method of simulating operating environment of single-plate software and device | |
CN115758789B (en) | Software architecture design and architecture transfer method of complex real-time embedded system | |
KR102054980B1 (en) | Computing system and method for automatically generating embedded software on virtualized system | |
US20230093197A1 (en) | Generating executables for target operational environments | |
Zhang et al. | A low-code development framework for cloud-native edge systems | |
Pedersen et al. | Distributed co-simulation of embedded control software using INTO-CPS | |
Cave et al. | A new approach to parallel processing | |
Oltean et al. | Method for rapid development of Arduino-based applications enclosing ANN | |
Huang et al. | Improving CUDA performance of an unstructured high-order CFD application under OP2 framework |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |