CN112256278A - Compiling method, device, equipment and storage medium - Google Patents
Compiling method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112256278A CN112256278A CN202011239292.6A CN202011239292A CN112256278A CN 112256278 A CN112256278 A CN 112256278A CN 202011239292 A CN202011239292 A CN 202011239292A CN 112256278 A CN112256278 A CN 112256278A
- Authority
- CN
- China
- Prior art keywords
- container
- compiling
- environment
- node
- specified directory
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000004044 response Effects 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 13
- 230000006378 damage Effects 0.000 claims description 10
- 238000007726 management method Methods 0.000 description 28
- 238000010586 diagram Methods 0.000 description 18
- 238000005516 engineering process Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000002955 isolation Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the application provides a compiling method, a compiling device, compiling equipment and a storage medium. The method is applied to container nodes, the container nodes are provided with preset file systems, and the method comprises the following steps: when the compiling environment is stored under the specified directory, accessing the specified directory to obtain the compiling environment, wherein the specified directory is determined according to a preset file system; deploying a compilation environment within a target container of a container node; and compiling the source code file under the compiling environment deployed by the target container to obtain an executable file. According to the technical scheme, the compiling environment is isolated through the containers, and one container node can be provided for multiple technicians to complete compiling work due to the fact that multiple containers can be deployed in the container node, and hardware resources required by compiling are saved. In addition, a preset file system is installed in the container node, so that the container can quickly acquire a compiling environment, and the compiling efficiency is improved.
Description
Technical Field
The present disclosure relates to the field of program development technologies, and in particular, to a compiling method, apparatus, device, and storage medium.
Background
Compiling refers to performing a series of processing on a source file of a high-level language to finally obtain an executable file of a binary code.
In the related art, a server is deployed with a corresponding compiling environment, and the server pulls a source code file from a code repository, and then compiles the source code file into an executable file in the compiling environment.
Disclosure of Invention
The embodiment of the application provides a compiling method, a compiling device, compiling equipment and a storage medium. The technical scheme comprises the following steps:
in one aspect, an embodiment of the present application provides a compiling method, which is applied to a container node, where the container node is installed with a preset file system, and the method includes:
when the compiling environment is stored under the appointed directory, accessing the appointed directory to obtain the compiling environment, wherein the appointed directory is determined according to the preset file system;
deploying the compilation environment within a target container of the container node;
compiling the source code file under the compiling environment deployed by the target container to obtain an executable file.
In another aspect, an embodiment of the present application provides a compiling apparatus, where the apparatus includes:
the environment acquisition module is used for accessing the specified directory to acquire the compiling environment when the compiling environment is stored under the specified directory, and the specified directory is determined according to a preset file system installed in the container node;
an environment deployment module for deploying the compilation environment within a target container of the container node;
and the compiling module is used for compiling the source code file under the compiling environment deployed by the target container to obtain an executable file.
In yet another aspect, an embodiment of the present application provides a computer device, which includes a processor and a memory, where the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the compiling method according to an aspect.
In yet another aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program is loaded and executed by a processor to implement the compiling method according to the aspect.
In yet another aspect, embodiments of the present application provide a computer program product, the computer program product or computer program including computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the compiling method.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
by deploying the compiling environment in the container node and compiling the source code file into the executable file in the compiling environment deployed in the container, one container node can be provided with a plurality of containers and the containers are completely isolated, so that one container node can be used for a plurality of technicians to complete the compiling of the source code, and hardware resources required by the compiling of the source code are saved. In addition, a preset file system is installed in the container node, and then the container with the compiling requirement obtains the compiling environment from the specified directory determined based on the preset file system without completely writing the compiling environment into the container, so that the obtaining efficiency of the compiling environment is improved, and the compiling efficiency is further improved.
Drawings
FIG. 1 is an architectural diagram of a container technology;
FIG. 2 is a schematic diagram of a snapshot technique;
FIG. 3 is a compiled architecture diagram provided by the related art;
FIG. 4 is another compiled architecture diagram provided by the related art;
FIG. 5 is a schematic illustration of an implementation environment provided by an embodiment of the present application;
FIG. 6 is a flow diagram of a compilation method provided by one embodiment of the present application;
FIG. 7 is a compiled architecture diagram to which the embodiment of FIG. 6 relates;
FIG. 8 is an architecture diagram of a compilation provided by one embodiment of the present application;
fig. 9 is a block diagram of a compiling apparatus according to an embodiment of the present application;
fig. 10 is a block diagram of a computer device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The container technology comprises the following steps: a lightweight virtualization technique that allows for lightweight, operating system-level virtualization of applications and their dependencies (e.g., application plug-ins) during resource isolation, all necessary components needed to run the application being packaged as a single image that is reusable. When the image is running, it is running in an independent environment and does not share the memory, CPU or disk of the host operating system with other applications. This ensures that processes inside the container do not affect any processes outside the container.
Referring collectively to fig. 1, a diagram of a container isolation architecture provided by one embodiment of the present application is shown. The container isolation architecture diagram includes infrastructure 11, host operating system 12, container 13, and applications.
Infrastructure 11 refers to a server or virtual machine running host operating system 12.
The host operating system 12 is a computer program that manages the hardware and software resources of the infrastructure 11. Optionally, the host operating system 12 is a Linux operating system.
The container 13 is installed on the host operating system 12, which is dependent on the host operating system 12. The number of containers 13 installed in the host operating system 12 is not limited in the embodiment of the present application, and may be, for example, one or more.
An application refers to a computer program that performs some specific task or tasks, and that runs within the container 13.
BtrFS (button File System) File System: the file system, promulgated by Oracle corporation, has a Copy-on-Write (CoW) feature, i.e., a snapshot.
Snapshot: is a record of the state at a certain moment of data storage. The working principle of the snapshot technique is explained below with reference to fig. 2.
Part (a) in fig. 2 shows the structure of the directory a. Directory a includes subdirectory B, which includes subdirectory C and subdirectory D, and subdirectory E, which includes subdirectory F.
Part (b) of fig. 2 shows the operation of directory a by the snapshot technique. As can be appreciated by reference to section (b) of fig. 2, directory a is not replicated, but only a new index a' is created.
Part (C) in fig. 2 shows a directory C under the modified directory a. As can be understood by referring to part (C) of fig. 2, when the directory C is modified to C ', a separate branch is created, and C' and the subdirectory B on which the subdirectory C depends are written to the disk.
In the related art, one server can only be used by one technician to complete the compilation of the source code file, and more hardware resources are required for the compilation.
The related art also provides a compiling method, which includes acquiring a compiling environment through a target container in a container node, deploying the acquired compiling environment in the target container, and compiling a source code file under the compiling environment deployed in the target container to obtain an executable file. Referring collectively to fig. 3, a schematic diagram of compiling within a container provided by the related art is shown. A container engine and 3 containers are operated in one container node, each container is deployed with a different compiling environment, and relevant technicians implement compiling in the container through the terminal 31.
The above related art has the following drawbacks: due to the large data volume of the compiling environment, each technician needs to pull the compiling environment through the container, the time consumption of the process is large, and the compiling efficiency is low.
The related art further provides a compiling method, in which a storage driver of a computer device is set to be a preset file system having a snapshot characteristic, a compiling environment can be quickly obtained subsequently based on the snapshot characteristic of the preset file system, a file required for compiling is completed, and then a source file code is compiled in the compiling environment to obtain an executable file. Referring to fig. 4 in combination, a schematic diagram of compiling based on a preset file system provided in the related art is shown. The computer device is installed with a preset file system with snapshot characteristics, the compiling environment is obtained through snapshot technology, and relevant technicians realize compiling based on the preset file system through the terminal 41.
The above related art has a drawback in that since the respective compiling environments are not isolated, an environment conflict may occur, thereby causing a compiling failure.
Based on the above two drawbacks of the related technologies, an embodiment of the present application provides a compiling method, where a compiling environment is deployed in a container node, and then a source code file is compiled into an executable file in the compiling environment deployed in the container, and since one container node can install a plurality of containers and the containers are completely isolated from each other, one container node can be used by a plurality of technicians to complete compiling of a source code, thereby saving hardware resources required by compiling of the source code. In addition, a preset file system is installed in the container node, and then the container with the compiling requirement obtains the compiling environment from the specified directory determined based on the preset file system without completely writing the compiling environment into the container, so that the obtaining efficiency of the compiling environment is improved, and the compiling efficiency is further improved.
Referring to fig. 5, a schematic diagram of an implementation environment is shown according to an embodiment of the present application. The implementation environment comprises at least one container node 51, a container management node 52.
The container node 51 is deployed with at least one container 512. The number of containers deployed by the container node 51 is not limited in the embodiment of the present application, and is determined according to the type of the compilation environment, for example, and is distributed by the container management node.
Optionally, different compiling environments are deployed in different containers in the container node 51, and since the containers can effectively isolate the compiling environments, compiling work on the source code under different compiling environments can be supported in different containers, that is, one container node 51 can support multiple technicians to complete compiling of the source code, so that hardware resources required by compiling the source code are saved.
Optionally, a preset file system is installed in the container node 51, for example, the storage driver of the container node 51 is set as the preset file system, or the storage driver of a part of the containers 512 in the container node 51 is set as the preset file system. The container node 51 can implement the snapshot function through the preset file system. The snapshot function is used for realizing online data backup and recovery, providing another data access channel for a storage user and the like. In the embodiment of the present application, the container 512 in the container node 51 accesses the compilation environment through the snapshot function, and then deploys the compilation environment inside itself. Optionally, the preset file system is a BtrFS file system.
Alternatively, the container node 51 is a physical server, such as a server, a server cluster composed of a plurality of servers, and the like. Optionally, the container node 51 is a virtual server, such as a virtual machine.
The container management node 52 is used to manage the creation, modification and destruction of containers. In the embodiment of the present application, the container management node 52 manages the containers in the container nodes, so that the container nodes can reasonably create and destroy the containers as required, and processing resources are saved. The container management node 52 may be one server, a server cluster formed by multiple servers, or a cloud computing service center.
The container node 51 and the container management node 52 establish a communication connection through a wired or wireless network. The wireless or wired networks described above use standard communication techniques and/or protocols. The Network is typically the internet, but may be any other Network including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, wireline or wireless Network, a private Network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including Hypertext Mark-up Language (HTML), Extensible Markup Language (XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec). In other embodiments, custom and/or dedicated data communication techniques may also be used in place of, or in addition to, the data communication techniques described above.
Please refer to fig. 6, which illustrates a flowchart of a compiling method according to an embodiment of the present application. The method is applied to container nodes, and the container nodes are provided with preset file systems. In one possible implementation, the storage driver of the container node is set as the preset file system. In another possible implementation, the storage driver of the target container in the container node is set to the preset file system. Optionally, the preset file system is a BtrFS file system.
The method comprises the following steps:
step 601, when the compiling environment is stored under the specified directory, accessing the specified directory to obtain the compiling environment.
The designated directory is determined according to a preset file system. For example, the designated directory is set by default according to a configuration file of a preset file system. As another example, the related art person sets a specified directory in a configuration file of a preset file system.
Optionally, step 601 is implemented as: and copying the index corresponding to the compiling environment, and accessing the index corresponding to the copied compiling environment to obtain the compiling environment. Based on the characteristics of the preset file system, the target container can access the index corresponding to the compiling environment to obtain the compiling environment, and due to the fact that the index copying speed is high and the occupied disk space is small, on one hand, the efficiency of obtaining the compiling environment can be improved, and on the other hand, the storage occupation of container nodes can be reduced.
Optionally, the obtaining the compiling environment further comprises the following steps: when the compiling environment under the specified directory is modified, the modified content is obtained from the specified directory, and the modified content is stored in the target container. When part of the contents of the compiling environment are modified, if the target container still obtains the compiling environment by accessing the index corresponding to the compiling environment, the contents before modification are obtained, so that the modified contents need to be stored locally by the target container, errors in the compiling environment are avoided, and the success rate of compiling is further improved.
At step 602, a compilation environment is deployed within a target container of a container node.
The target container deploys the compilation environment after acquiring the compilation environment, and the deployment process comprises the following steps: and completing the configuration of the environment variables and operating the specified command to enable the configured environment variables to take effect.
The source code file is a code file written in a high level programming language including, but not limited to: JAVA, C language, C + +, Python language, and the like. An executable file refers to a binary language recognizable by a computer device.
Program compilation refers to a process of generating a target program from an original program written in a source language using a compiler, and includes five stages: lexical analysis, syntactic analysis, semantic inspection, intermediate code generation and code optimization.
Lexical analysis, syntax analysis is also referred to as source program analysis to check source files for syntax errors. Intermediate code is an internal representation of the source program that makes the structure of the compiler logically simpler and more explicit, with intermediate languages having complexities intermediate between the source program language and the machine language. Intermediate languages have various forms, and are commonly known as inverse Polish notation, quaternion, tertiary, and tree. Code optimization refers to performing various equivalent transformations on a program, so that a more effective target code can be generated from the transformed program.
Optionally, a compiler is run in the target container, and the compiler compiles the source code file in a compilation environment deployed in the target container to obtain an executable file.
Optionally, before step 601, the container node needs to store the compilation environment to the specified directory. Optionally, before step 601, the compiling method further includes: when the compiling environment does not exist in the specified directory, acquiring a code file corresponding to the compiling environment from a storage space in which the code file is stored; compiling a code file corresponding to the compiling environment to obtain a compiling environment; the compilation environment is stored to the specified directory. The storage space in which the code file is stored may be in the container node (e.g., a non-designated directory in the container node) or may be separate from the container node (e.g., an external database). The container node needs to acquire a code file corresponding to the compiling environment first, compile the code file into the compiling environment based on the code file corresponding to the compiling environment, and store the compiling environment in the specified directory, and then other containers can acquire the compiling environment from the specified directory quickly through a snapshot technology.
Referring to fig. 7 in combination, a schematic diagram of compilation provided in an embodiment of the present application is shown, where a container engine and 3 containers are operated in one container node, and a storage driver of the container node is a preset file system, at this time, the container node supports the container to obtain a compilation environment and deploy the compilation environment through a snapshot technique, and then, a relevant technician implements compilation based on the preset file system through a terminal 71.
To sum up, according to the technical solution provided in the embodiment of the present application, a compiling environment is deployed in a container node, and then a source code file is compiled into an executable file in the compiling environment deployed in the container, and since one container node can install a plurality of containers and the containers are completely isolated from each other, one container node can be used by a plurality of technicians to complete compiling of a source code, thereby saving hardware resources required by compiling of the source code. In addition, a preset file system is installed in the container node, and then the container with the compiling requirement obtains the compiling environment from the specified directory determined based on the preset file system without completely writing the compiling environment into the container, so that the obtaining efficiency of the compiling environment is improved, and the compiling efficiency is further improved.
In an alternative embodiment provided based on the embodiment shown in fig. 6, before step 602, the compiling method further includes the following steps:
step 701, sending a container creation request to a container management node.
The container creation request is for requesting creation of a target container. The container creation request carries the identifier of the container node. Optionally, the container node also carries its own available resources, such as storage resources, computation resources, and the like.
Optionally, the container node sends a container creation request to the container management node when receiving a container creation instruction, and the related art person triggers the container creation instruction when there is a compilation requirement. Optionally, the container management node sends a container creation request to the container management node after obtaining the compilation schedule.
Accordingly, the container management node receives the container creation request sent by the container node.
Step 702, receiving first response information corresponding to the container creation request sent by the container management node.
And the container management node judges whether the target container is allowed to be created according to the available resources of the container node carried in the container creation request, and then generates a first response message based on the judgment result. If the available resources of the container node are sufficient, allowing the target container to be created; if the available resources of the container node are not sufficient, the target container is not allowed to be created.
And step 703, creating a target container according to the first response information.
If the first response message is used to indicate that the target container is allowed to be created, the container node creates the target container.
In an alternative embodiment provided based on the embodiment shown in fig. 5, after step 503, the compiling method further includes the following steps:
step 704, sending a container destruction request to the container management node.
The container destruction request is used to destroy the target container. The container destruction request carries an identification of the container node and an identification of the target container. And after the container node finishes compiling in the target container, requesting the container management node to destroy the target container.
Accordingly, the container management node receives a container destruction request sent by the container node.
Step 705, receiving second response information corresponding to the container destruction request sent by the container management node.
And after receiving the container destroying request, the container management node returns a second response message to the container node.
And step 706, destroying the target container according to the second response information.
And the container node destroys the target container according to the second response message and releases the resources occupied by the target container.
Optionally, when the container management platform manages the plurality of container nodes, the container management platform further abstracts the disk to the local disk based on a network protocol, and then the plurality of container nodes can share the disk, that is, the compiling environment is quickly acquired from the shared disk, so that the disk space is saved and the efficiency of acquiring the compiling environment is improved.
Optionally, the controller of the container management node sets the volume as a preset file system, so that the containers in the multiple container platforms can access the preset file system to obtain the compilation environment. The Volume is created and managed by a container, and data is placed in a specified directory and can be hung for a plurality of containers.
With reference collectively to FIG. 8, a diagram of the architecture involved in compiling as provided by one embodiment of the present application is shown. The container management node manages a plurality of container nodes, each container node is provided with a container, and the containers in the container nodes acquire the compiling environment images from the shared server based on the preset file system based on the snapshot technology.
To sum up, according to the technical solution provided in the embodiment of the present application, management scheduling of a container cluster is implemented through a container management node, such as creating a container, destroying a container, and the like.
In the following, embodiments of the apparatus of the present application are described, and for portions of the embodiments of the apparatus not described in detail, reference is made to technical details disclosed in the above-mentioned method embodiments.
Referring to fig. 9, a block diagram of a compiling apparatus provided in an exemplary embodiment of the present application is shown. The compiling means is implemented as all or a part of the terminal by software, hardware or a combination of both. The compiling apparatus includes:
an environment obtaining module 901, configured to, when the compiling environment is stored in a specified directory, access the specified directory to obtain the compiling environment, where the specified directory is determined according to a preset file system installed in a container node.
An environment deployment module 902 for deploying the compilation environment within a target container of the container node.
A compiling module 903, configured to compile the source code file in the compiling environment deployed by the target container to obtain an executable file.
To sum up, according to the technical solution provided in the embodiment of the present application, a compiling environment is deployed in a container node, and then a source code file is compiled into an executable file in the compiling environment deployed in the container, and since one container node can install a plurality of containers and the containers are completely isolated from each other, one container node can be used by a plurality of technicians to complete compiling of a source code, thereby saving hardware resources required by compiling of the source code. In addition, a preset file system is installed in the container node, and then the container with the compiling requirement obtains the compiling environment from the specified directory determined based on the preset file system without completely writing the compiling environment into the container, so that the obtaining efficiency of the compiling environment is improved, and the compiling efficiency is further improved.
In an alternative embodiment provided based on the embodiment shown in fig. 9, the environment obtaining module 901 is configured to:
copying an index corresponding to the compiling environment;
and accessing the specified directory through the copied index corresponding to the compiling environment to obtain the compiling environment.
In an alternative embodiment provided based on the embodiment shown in fig. 9, the environment obtaining module 901 is further configured to:
when the compiling environment under the specified directory is modified, obtaining modified contents from the specified directory;
storing the modified content within the target container.
In an alternative embodiment provided based on the embodiment shown in fig. 9, the apparatus further comprises: a container creation module (not shown in fig. 9).
A container creation module to:
sending a container creation request to a container management node, the container creation request being used to create the target container;
receiving first response information corresponding to the container creation request sent by the container management node;
and creating the target container according to the first response information.
Optionally, the apparatus further comprises: a container destruction module (not shown in fig. 9).
A container destruction module to:
sending a container destroying request to the container management node, wherein the container destroying request is used for destroying the target container;
receiving second response information which is sent by the container management node and corresponds to the container destruction request;
destroying the target container according to the second response information.
In an alternative embodiment provided based on the embodiment shown in fig. 9, the apparatus further comprises: a compilation environment acquisition module (not shown in fig. 9).
A compilation environment acquisition module to:
when the compiling environment does not exist in the specified directory, acquiring a code file corresponding to the compiling environment from a storage space in which the code file is stored;
compiling the code file corresponding to the compiling environment to obtain the compiling environment;
storing the compilation environment to the specified directory.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer apparatus 1000 includes a Central Processing Unit (CPU) 1001, a system Memory 1004 including a Random Access Memory (RAM) 1002 and a Read-Only Memory (ROM) 1003, and a system bus 1005 connecting the system Memory 1004 and the Central Processing Unit 1001. The computer device 1000 also includes a basic Input/Output system (I/O system) 1006, which helps to transfer information between devices within the computer, and a mass storage device 1007, which stores an operating system 1013, application programs 1014, and other program modules 1015.
The basic input/output system 1006 includes a display 1008 for displaying information and an input device 1009, such as a mouse, keyboard, etc., for user input of information. Wherein the display 1008 and input device 1009 are connected to the central processing unit 1001 through an input/output controller 1010 connected to the system bus 1005. The basic input/output system 1006 may also include an input/output controller 1010 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, an input/output controller 1010 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 1007 is connected to the central processing unit 1001 through a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer-readable media provide non-volatile storage for the computer device 1000. That is, the mass storage device 1007 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc-Only Memory (CD-ROM) drive.
Without loss of generality, the computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other solid state Memory technology, CD-ROM, Digital Versatile Disks (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the foregoing. The system memory 1004 and mass storage device 1007 described above may be collectively referred to as memory.
According to various embodiments of the present application, the computer device 1000 may also operate as a remote computer connected to a network via a network, such as the Internet. That is, the computer device 1000 may be connected to the network 1012 through the network interface unit 1011 connected to the system bus 1005, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 1011.
In particular, in the embodiment of the present application, the computer device 1000 further includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs include instructions for performing the compiling method.
In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor of a mobile terminal to implement the compiling method in the above-described method embodiments.
Alternatively, the computer readable storage medium may be a ROM, a RAM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations of the one aspect or the one aspect.
It should be understood that reference to "a plurality" herein means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. As used herein, the terms "first," "second," and the like, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (11)
1. A compilation method applied to a container node, the container node having a preset file system installed thereon, the method comprising:
when the compiling environment is stored under the appointed directory, accessing the appointed directory to obtain the compiling environment, wherein the appointed directory is determined according to the preset file system;
deploying the compilation environment within a target container of the container node;
compiling the source code file under the compiling environment deployed by the target container to obtain an executable file.
2. The method of claim 1, wherein said accessing the specified directory to obtain the compilation environment comprises:
copying an index corresponding to the compiling environment;
and accessing the copied index corresponding to the compiling environment to obtain the compiling environment.
3. The method of claim 1, wherein said accessing said specified directory to obtain said compilation environment further comprises:
when the compiling environment under the specified directory is modified, obtaining modified contents from the specified directory;
storing the modified content within the target container.
4. The method according to any of claims 1 to 3, further comprising, prior to deploying the compilation environment within a target container of the container node:
sending a container creation request to a container management node, the container creation request being used to create the target container;
receiving first response information corresponding to the container creation request sent by the container management node;
and creating the target container according to the first response information.
5. The method of claim 4, wherein after compiling the source code file in the compilation environment deployed by the target container to obtain an executable file, further comprising:
sending a container destroying request to the container management node, wherein the container destroying request is used for destroying the target container;
receiving second response information which is sent by the container management node and corresponds to the container destruction request;
destroying the target container according to the second response information.
6. The method of any of claims 1 to 3, wherein prior to said accessing said specified directory to obtain said compilation environment, further comprising:
when the compiling environment does not exist in the specified directory, acquiring a code file corresponding to the compiling environment from a storage space in which the code file is stored;
compiling the code file corresponding to the compiling environment to obtain the compiling environment;
storing the compilation environment to the specified directory.
7. A compiling apparatus characterized in that the apparatus comprises:
the environment acquisition module is used for accessing the specified directory to acquire the compiling environment when the compiling environment is stored under the specified directory, and the specified directory is determined according to a preset file system installed in the container node;
an environment deployment module for deploying the compilation environment within a target container of the container node;
and the compiling module is used for compiling the source code file under the compiling environment deployed by the target container to obtain an executable file.
8. The apparatus of claim 7, wherein the environment acquisition module is configured to:
copying an index corresponding to the compiling environment;
and accessing the copied index corresponding to the compiling environment to obtain the compiling environment.
9. The apparatus of claim 7, wherein the environment acquisition module is configured to:
when the compiling environment under the specified directory is modified, obtaining modified contents from the specified directory;
storing the modified content within the target container.
10. A computer device, characterized in that the computer device comprises a processor and a memory, the memory storing a computer program which is loaded by the processor and which executes the compilation method according to any one of claims 1 to 6.
11. A computer-readable storage medium, in which a computer program is stored, the computer program being loaded and executed by a processor to implement the compiling method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011239292.6A CN112256278B (en) | 2020-11-09 | 2020-11-09 | Compiling method, compiling device, compiling equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011239292.6A CN112256278B (en) | 2020-11-09 | 2020-11-09 | Compiling method, compiling device, compiling equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112256278A true CN112256278A (en) | 2021-01-22 |
CN112256278B CN112256278B (en) | 2024-10-01 |
Family
ID=74266494
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011239292.6A Active CN112256278B (en) | 2020-11-09 | 2020-11-09 | Compiling method, compiling device, compiling equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112256278B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113010179A (en) * | 2021-02-23 | 2021-06-22 | 深圳市广和通无线股份有限公司 | Software storage method under storage architecture |
CN113434146A (en) * | 2021-06-22 | 2021-09-24 | 青岛海尔科技有限公司 | Code compiling method, device, storage medium and electronic device |
CN114168150A (en) * | 2021-12-10 | 2022-03-11 | 北京鲸鲮信息系统技术有限公司 | Application program compiling method and device, electronic equipment and storage medium |
CN114168151A (en) * | 2021-12-10 | 2022-03-11 | 北京鲸鲮信息系统技术有限公司 | Container-based program compiling method and device, electronic equipment and storage medium |
CN115167874A (en) * | 2022-08-19 | 2022-10-11 | 禾多科技(北京)有限公司 | Automatic driving software mirror image deployment method and device, electronic equipment and readable medium |
CN115756483A (en) * | 2022-11-16 | 2023-03-07 | 中电金信软件有限公司 | Compiling method, compiling apparatus, computer device, and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108573049A (en) * | 2018-04-20 | 2018-09-25 | 联想(北京)有限公司 | Data processing method and distributed storage devices |
CN108984179A (en) * | 2018-06-28 | 2018-12-11 | 北京奇安信科技有限公司 | Process of compilation method and device under a kind of Linux |
CN109508178A (en) * | 2018-09-27 | 2019-03-22 | 咪咕文化科技有限公司 | program development method and device |
CN110955431A (en) * | 2018-09-27 | 2020-04-03 | 北京国双科技有限公司 | Processing method and device of compiling environment |
US10678522B1 (en) * | 2018-12-14 | 2020-06-09 | Mouri Tech Llc | Compiler and method for compiling business rules for a serverless runtime environment |
-
2020
- 2020-11-09 CN CN202011239292.6A patent/CN112256278B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108573049A (en) * | 2018-04-20 | 2018-09-25 | 联想(北京)有限公司 | Data processing method and distributed storage devices |
CN108984179A (en) * | 2018-06-28 | 2018-12-11 | 北京奇安信科技有限公司 | Process of compilation method and device under a kind of Linux |
CN109508178A (en) * | 2018-09-27 | 2019-03-22 | 咪咕文化科技有限公司 | program development method and device |
CN110955431A (en) * | 2018-09-27 | 2020-04-03 | 北京国双科技有限公司 | Processing method and device of compiling environment |
US10678522B1 (en) * | 2018-12-14 | 2020-06-09 | Mouri Tech Llc | Compiler and method for compiling business rules for a serverless runtime environment |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113010179A (en) * | 2021-02-23 | 2021-06-22 | 深圳市广和通无线股份有限公司 | Software storage method under storage architecture |
CN113010179B (en) * | 2021-02-23 | 2024-03-15 | 深圳市广和通无线股份有限公司 | Independent application running method based on real-time operating system |
CN113434146A (en) * | 2021-06-22 | 2021-09-24 | 青岛海尔科技有限公司 | Code compiling method, device, storage medium and electronic device |
CN114168150A (en) * | 2021-12-10 | 2022-03-11 | 北京鲸鲮信息系统技术有限公司 | Application program compiling method and device, electronic equipment and storage medium |
CN114168151A (en) * | 2021-12-10 | 2022-03-11 | 北京鲸鲮信息系统技术有限公司 | Container-based program compiling method and device, electronic equipment and storage medium |
CN114168151B (en) * | 2021-12-10 | 2024-10-11 | 北京字节跳动网络技术有限公司 | Container-based program compiling method and device, electronic equipment and storage medium |
CN115167874A (en) * | 2022-08-19 | 2022-10-11 | 禾多科技(北京)有限公司 | Automatic driving software mirror image deployment method and device, electronic equipment and readable medium |
CN115756483A (en) * | 2022-11-16 | 2023-03-07 | 中电金信软件有限公司 | Compiling method, compiling apparatus, computer device, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112256278B (en) | 2024-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112256278B (en) | Compiling method, compiling device, compiling equipment and storage medium | |
JP6856749B2 (en) | Systems and methods for implementing native contracts on the blockchain | |
CN107491329B (en) | Docker mirror image construction method, device, storage medium and electronic device | |
US6964034B1 (en) | Application development server and a mechanism for providing different views into the same constructs within a strongly encapsulated environment | |
CN107766126B (en) | Container mirror image construction method, system and device and storage medium | |
US8881139B1 (en) | Legacy application rehosting system | |
US7836106B2 (en) | Method, apparatus and computer program product for change management in a data processing environment | |
JP2021518619A (en) | Systems and methods for connector development and integrated channel deployment | |
JP4455403B2 (en) | Management method and management apparatus | |
US10338907B2 (en) | Cloud service framework for toolkit deployment | |
US20150220308A1 (en) | Model-based development | |
WO2020015191A1 (en) | Business rule releasing and managing method, electronic device and readable storage medium | |
JP7311710B2 (en) | runtime container | |
US20100095297A1 (en) | Method, system and computer program product for solution replication | |
US9189257B2 (en) | Computer device and method of providing configuration files in a computer device | |
Di Cosmo et al. | Supporting software evolution in component-based FOSS systems | |
CN113064595B (en) | QT application compiling method and device based on Docker mirror image | |
US12086575B2 (en) | System and method for a hybrid development platform | |
US7716663B2 (en) | Method, system and program product for controlling native applications using open service gateway initiative (OSGi) bundles | |
CN114072765B (en) | Method for container-based virtualization system | |
CN115080060A (en) | Application program distribution method, device, equipment, storage medium and program product | |
KR102352265B1 (en) | System and method for providing web application development platform | |
CN118276884A (en) | Container packaging method, device, equipment and storage medium | |
CN115113972A (en) | Application transformation method, system, cluster, medium and program product | |
Fortier et al. | Dyninka: a FaaS framework for distributed dataflow applications |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |