[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111984261A - Compiling method and compiling system - Google Patents

Compiling method and compiling system Download PDF

Info

Publication number
CN111984261A
CN111984261A CN201910441480.8A CN201910441480A CN111984261A CN 111984261 A CN111984261 A CN 111984261A CN 201910441480 A CN201910441480 A CN 201910441480A CN 111984261 A CN111984261 A CN 111984261A
Authority
CN
China
Prior art keywords
compiling
file
client
container
long connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910441480.8A
Other languages
Chinese (zh)
Inventor
王少星
巫耀恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910441480.8A priority Critical patent/CN111984261A/en
Publication of CN111984261A publication Critical patent/CN111984261A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides a compiling method and device. The compiling method comprises the following steps: responding to a preset file uploading instruction of a client to receive a file to be compiled and a configuration file; responding to the long connection establishment request of the client to establish long connection with the client; selecting a compiling environment mirror image from a plurality of compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image, and butting a control port of the container to the long connection; responding to a compiling instruction sent by the client through the long connection, and executing the compiling instruction on the file to be compiled in the container; and responding to a preset compiling ending instruction of the client to disconnect the long connection, and recycling the container. The compiling method provided by the disclosure can provide various compiling environments under the condition of reducing terminal consumption.

Description

Compiling method and compiling system
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a compiling method and a compiling system capable of providing multiple compiling environments and reducing resource consumption.
Background
At present, the engineering types of front ends (generally referred to as web, app, electron and other interfaces) are very diversified, and commonly include html5, exact, vue, angularjs and the like, but each technology needs to be compiled into a target engineering to run, so that front-end developers need to install various construction environments in terminals.
At present, developers can only adopt a local construction mode to respectively carry out environment deployment aiming at each different development environment, but when the environments are deployed at the same terminal, conflicts often occur, for example, one project depends on the python version 2.x, but the other project depends on the python version 3.0, or the dependent operating system environment is inconsistent with the terminal. Although there are currently some conflict handling schemes (e.g. nvm under node, use of virtual machines, etc.) for a specific technology stack, the operation is not convenient and relies on a local terminal.
First, since the local terminals have different performances, if the terminal has low performance or fails, the development efficiency is very low. Secondly, compiling is high-CPU consumption work, once the compiling work is started, the CPU resources of the whole terminal are all occupied, and developers sometimes have to enter an in-place waiting state. Thirdly, for the compiling environment depending on different operating systems, the compiling can be carried out only by adopting a virtual machine mode, the performance is low, and extra resources are occupied. Fourthly, the compiled front-end project directly appears in a local file form, and is not beneficial to team sharing and previewing, for projects developed by multiple persons in a collaborative mode, versions of certain modules are different possibly due to different installation time of two terminals, although project operation cannot be influenced by the transformation in most of the time, finally generated products are different after all, and hidden dangers are buried.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a compiling method and a compiling apparatus for overcoming, at least to some extent, the problems of low compiling efficiency, poor synchronization, and the like caused by installing a plurality of compiling environments in a terminal due to the limitations and disadvantages of the related art.
According to a first aspect of embodiments of the present disclosure, there is provided a compiling method including:
responding to a preset file uploading instruction of a client to receive a file to be compiled and a configuration file;
responding to the long connection establishment request of the client to establish long connection with the client;
selecting a compiling environment mirror image from a plurality of compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image, and butting a control port of the container to the long connection;
responding to a compiling instruction sent by the client through the long connection, and executing the compiling instruction on the file to be compiled in the container;
and responding to a preset compiling ending instruction of the client to disconnect the long connection, and recycling the container.
In an exemplary embodiment of the present disclosure, the selecting one of the plurality of compilation environment images according to the configuration file includes:
determining a project identifier of the file to be compiled according to the configuration file;
when the corresponding compiling environment mirror image exists in the project identifier, directly selecting the corresponding environment mirror image;
otherwise, selecting a specified compiling environment mirror image recorded by the configuration file;
and when the configuration file does not record the specified compiling environment image, selecting a default compiling environment image.
In an exemplary embodiment of the disclosure, the receiving a file to be compiled and a configuration file in response to a preset file upload instruction of a client includes determining a save directory of the file to be compiled according to the configuration file, and the starting a container according to the compilation environment image includes designating a shared directory of the container and a host as the save directory.
In an exemplary embodiment of the present disclosure, the booting a container according to the compilation environment image includes:
determining and exposing a container access port according to the configuration file.
In an exemplary embodiment of the disclosure, the executing the compiling instruction on the file to be compiled inside the container includes:
And feeding back an execution result of the compiling instruction to the client through the long connection.
According to an aspect of the present disclosure, there is provided a compiling system including:
a server configured to execute the following instructions:
responding to a preset file uploading instruction of a client to receive a file to be compiled and a configuration file;
responding to the long connection establishment request of the client to establish long connection with the client;
selecting a compiling environment mirror image from a plurality of compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image, and butting a control port of the container to the long connection;
responding to a compiling instruction sent by the client through the long connection, and executing the compiling instruction on the file to be compiled in the container;
responding to a preset compiling ending instruction of the client to disconnect the long connection, and recycling the container;
a plurality of clients coupled to the server, wherein each of the clients is configured to perform the following instructions:
responding to a preset file acquisition instruction to locally acquire the file to be compiled and the configuration file;
sending the preset file uploading instruction to the server and then transmitting the file to be compiled and the configuration file;
After the file is successfully transferred, sending the long connection establishment request to the server, and establishing the long connection with the server;
sending the compiling instruction formed according to user operation to the server through the long connection;
and responding to the preset operation of the user to send the preset compiling ending instruction.
In an exemplary embodiment of the disclosure, the configuration file includes an item identifier of the file to be compiled, and the server is configured to:
determining a project identifier of the file to be compiled according to the configuration file;
when the corresponding compiling environment mirror image exists in the project identifier, directly selecting the corresponding environment mirror image;
otherwise, selecting a specified compiling environment mirror image recorded by the configuration file;
and when the configuration file does not record the specified compiling environment image, selecting a default compiling environment image.
In an exemplary embodiment of the present disclosure, the client determines whether a configuration file corresponding to the file to be compiled exists when responding to the preset start command, and creates the configuration file if the configuration file does not exist.
In an exemplary embodiment of the present disclosure, includes:
the file receiving module is arranged for responding to a preset file uploading instruction of the client to receive the file to be compiled and the configuration file;
The connection management module is set to respond to the long connection establishment request of the client to establish long connection with the client; responding to a preset compiling ending instruction of the client to disconnect the long connection, and recycling the container;
the container starting module is used for selecting one compiling environment mirror image from the compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image and butting a control port of the container to the long connection;
and the file compiling module is used for responding to a compiling instruction sent by the client through the long connection and executing the compiling instruction on the file to be compiled in the container.
According to an aspect of the present disclosure, there is provided an electronic device including:
a memory; and
a processor coupled to the memory, the processor configured to perform the compilation method as recited in any of the above based on instructions stored in the memory.
According to an aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements a compiling method according to any one of the above-described methods.
The compiling method and the compiling system provided by the embodiment of the disclosure provide various compiling environments for a plurality of terminals by using the container located in the server, and can effectively overcome the problem that the terminal processing capacity is limited due to various compiling environments and more resource occupied by compiling tasks; in addition, the compiling records are stored in the server, so that the consistency of the collaborative development project can be improved, and the problem that various development versions are not uniform is avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 is a flow diagram of a compilation method 100 in an exemplary embodiment of the present disclosure.
Fig. 2 is a sub-flowchart of step S106 of the compiling method in the exemplary embodiment of the present disclosure.
Fig. 3 is a schematic diagram of a compiling system 300 in an exemplary embodiment of the disclosure.
Fig. 4A and 4B are flowcharts illustrating the operation of the client and the server in the compiling system 300 according to an embodiment.
Fig. 5 is a block diagram of a compiling apparatus in an exemplary embodiment of the disclosure.
FIG. 6 is a block diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Further, the drawings are merely schematic illustrations of the present disclosure, in which the same reference numerals denote the same or similar parts, and thus, a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The following detailed description of exemplary embodiments of the disclosure refers to the accompanying drawings.
Fig. 1 schematically shows a flow chart of a compiling method in an exemplary embodiment of the disclosure. Referring to fig. 1, a compiling method 100 may include:
step S102, responding to a preset file uploading instruction of a client to receive a file to be compiled and a configuration file;
step S104, responding the long connection establishment request of the client to establish long connection with the client;
step S106, selecting a compiling environment mirror image from a plurality of compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image, and butting a control port of the container to the long connection;
Step S108, responding to a compiling instruction sent by the client through the long connection, and executing the compiling instruction on the file to be compiled in the container;
and step S110, responding to a preset compiling ending instruction of the client to disconnect the long connection, and recycling the container.
The compiling method and the compiling system provided by the embodiment of the disclosure provide various compiling environments for a plurality of terminals by using the container located in the server, and can effectively overcome the problem that the terminal processing capacity is limited due to various compiling environments and more resource occupied by compiling tasks; in addition, the compiling records are stored in the server, so that the consistency of the collaborative development project can be improved, and the problem that various development versions are not uniform is avoided.
The steps of the compiling method 100 will be described in detail below.
In step S102, the to-be-compiled file and the configuration file are received in response to a preset file upload instruction of the client.
The compilation method 100 may be performed by a server. The server may first create a Web service to receive files uploaded by the client, including, for example, files to be compiled and configuration files.
The file to be compiled is a project file, and the uploading form is, for example, a package uploading.
The configuration file may contain, for example, a UUID field (item identifier), specify the item save directory, and specify the port number to be exposed by the server. The configuration file is used for setting a compiling environment, a communication environment and a file saving environment, and the specific fields of the configuration file can be adjusted by a person skilled in the art according to actual conditions.
Identifying the UUID to judge whether the file to be compiled belongs to a new project, if so, installing a corresponding dependence, and snapshotting a current container; otherwise, the existing snapshot is directly used, the command is run, and the command is issued/generated.
In step S104, a long connection is established with the client in response to the long connection establishment request of the client.
And the server receives the configuration file, determines a storage directory of the file to be compiled according to the configuration file, stores the file to be compiled, and waits for a long connection establishment request of the client. And after receiving the long connection establishment request, establishing the long connection with the client. At this point, the client's standard input-output (STD-IN/OUT) interfaces to the Socket (Socket) of the long connection.
Socket is an intermediate software abstraction layer for the application layer to communicate with the TCP/IP protocol suite, which can be understood as an interface. The two programs exchange data via a bidirectional communication link, one end of which is called a Socket. The long connection refers to the whole communication process, and the client and the server only use one pair of sockets and keep the connection of the sockets for a long time.
In embodiments of the present disclosure, a long connection may be used to transmit client-to-server instructions (e.g., compiled instructions) and server-to-client instruction feedback messages.
In step S106, a compilation environment image is selected from the plurality of compilation environment images according to the configuration file, a container is started according to the compilation environment image, and a control port of the container is docked to the long connection.
After a long connection is established, a mirror needs to be selected to start the container. In the embodiment of the disclosure, the server stores images of various compiling environments, and can provide various choices for various users.
FIG. 2 is a flow diagram of selecting a compilation environment image according to an embodiment of the present disclosure.
Referring to fig. 2, step S106 may include:
step S1061, determining a project identifier of a file to be compiled according to the configuration file;
step S1062, judging whether the corresponding compiling environment mirror image exists in the item identifier, if so, entering step S1063 to directly select the corresponding environment mirror image, otherwise, entering step S1064 to judge whether the configuration file records the specified compiling environment mirror image.
If yes, go to step S1065 to select the specified compilation environment image of the profile record, otherwise, go to step S1066 to select the default compilation environment image.
When the embodiment of the present disclosure is used for compiling front-end engineering, the compiling environment images may include, for example, an image of an Angular development environment, an image of an actual/actual-native development environment, an image of an Vue environment, and the like.
After the compilation environment image is selected, the container can be started according to the image, and the shared directory of the container and the host is designated as the storage directory for storing the file to be compiled.
When the container is started, a container access port, such as webpack-dev-server and the like, can be exposed according to the setting of the configuration file, so that the web service in the container can be accessed in a port mode under a public domain name, and a plurality of clients can conveniently consult the compiling process and the compiling effect. For the client sending the compiling instruction, the compiling effect can be previewed through the container access port, so that the compiling instruction can be sent and modified in time through long connection.
In step S108, in response to the compiling instruction sent by the client through the long connection, the compiling instruction is executed on the file to be compiled inside the container.
After the container is started, the compiling environment is established, and the file to be compiled is loaded, a console input/output (STD-IN/STD-OUT) pipeline IN the container can be connected to a Socket connected to the server end IN a long-distance mode, the compiling instruction of the client end is received and executed, and the instruction execution result and other types of feedback information (STD output) are sent to the client end through the long-distance connection.
In step S110, the long connection is disconnected in response to a preset compilation end instruction of the client, and the container is recovered.
The end of the compilation needs to be dominated by the client. After receiving a preset compiling ending instruction sent by the client, the server disconnects the long connection and the recovery container, returns a compiling result file to the client, and records information of the compiling at this time in the server, such as an item identifier UUID and a corresponding compiling environment mirror image thereof, a file storage directory and the like.
Corresponding to the above method, the present disclosure also provides a compiling system including a plurality of clients and a server, where the server is configured to execute the compiling method 100.
FIG. 3 is a schematic diagram of the operation of a compilation system.
Referring to fig. 3, the compiling system 300 may include:
a server 31 arranged to execute the following instructions:
step S102, responding to a preset file uploading instruction of a client to receive a file to be compiled and a configuration file;
Step S104, responding the long connection establishment request of the client to establish long connection with the client;
step S106, selecting one compiling environment mirror image from the compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image, and butting a control port of the container to the long connection;
step S108, responding to a compiling instruction sent by the client through long connection, and executing the compiling instruction on the file to be compiled in the container;
and step S110, responding to a preset compiling ending instruction of the client, disconnecting the long connection, and recycling the container.
A plurality of clients 32 coupled to the server 31, wherein each client 32 is configured to execute the following instructions:
step S100, responding to a preset file acquisition instruction to locally acquire a file to be compiled and a configuration file;
step S101, sending a preset file uploading instruction to a server and then transmitting a file to be compiled and a configuration file;
step S103, after the file is successfully transmitted, a long connection establishment request is sent to the server, and long connection is established with the server;
step S107, sending a compiling instruction formed according to the user operation to a server through long connection;
step S109, sending a preset compiling ending instruction in response to a preset operation of the user.
In one embodiment, the workflow of the client 31 may be as shown in FIG. 4A, and the workflow of the server may be as shown in FIG. 4B. The client 31 and the server 32 are both written by nodejs.
Referring to FIG. 4A, in the compilation system 300, the primary job of the client is to complete the interaction with the server and monitor local file changes.
Json configures the package to expose CLI commands at global installation time in step S401. For example, the yg command is designated as a client start command, and the default client is yg hereinafter. Among them, the CLI (command-line interface) is the most widely used user interface before the graphical user interface is popularized, and it usually does not support a mouse, and a user inputs an instruction through a keyboard, and a computer executes the instruction after receiving the instruction, also called a Character User Interface (CUI).
In step S402, when the user uses the yg command, it is checked whether the local directory has a configuration file (this configuration file is called yg. config later), and if not, the yg. config contains a UUID field and a port number to be exposed by the specified server.
And the UUID in the yg.config is the identification of the item, and the same item is initialized only when being uploaded for the first time to generate a mirror image of the construction environment for the item. When the command is executed again in the future, the corresponding mirror image is directly used. Yg is a client CLI command used for starting remote construction in the scheme, and after Yg is started, the subsequent parameters are analyzed into shell commands by the client and uploaded to the server.
In step S403, the local file is uploaded to the server, and listening for local file changes is started. When the local file is changed, the file is uploaded to the server in an incremental mode.
At step S404, a long connection is established with the server, and the standard input-output (STD-IN/OUT) of the client is docked to the socket long connection.
In step S405, a compile instruction is sent through the long connection, and information returned through the long connection is displayed.
In step S406, the completion of compilation is determined based on the user' S motion, and an end command is transmitted.
Referring to fig. 4B, the main job of the server is to create appropriate container environments from different images according to yg.config transmitted from the client:
in step S411, a file uploaded by the web service accepting client is first created, and the file is saved in a designated directory according to the configuration in yg.
At step S412, a long connection is established with the client (socket link is established).
At step S413, the compilation environment image is selected according to the yg.config configuration (if no image is specified in the configuration, a default image is used).
In step S414, the container is started using the image, and the shared directory of the container and the host is designated as the directory in which the client upload file is saved in the first step.
At step S415, port mapping is configured according to yg.config, and ports to be exposed in the container, such as webpack-dev-server, are exposed, so that the web service in the container can be accessed by means of the ports under a public domain name.
IN step S416, the console input/output (STD-IN/STD-OUT) pipes within the container are interfaced to the long connections of the client.
In step S417, the command inputted by the client is obtained, and the command is immediately executed in the container
In step S418, the container is executing and all STD outputs are sent from the long connection to the client.
In step S419, after the execution is completed, the socket long connection recycling container is disconnected.
By using a Docker (the Docker is an open-source application container engine, developers can pack their applications and dependence packages into a portable container and then release the application and dependence packages to any popular Linux machine, and virtualization can also be realized, the container completely uses a sandbox mechanism, and no interface exists between the containers), each front-end project can have an exclusive construction environment, and multiple environmental deployments on the same project are not needed during multi-user collaborative development. The client side carries out command interaction with the server side through the socket, each construction is carried out in a newly created container, the client side is mainly responsible for local file operation and client command capture, and the server side is responsible for container scheduling and cache mirroring.
Corresponding to the above method embodiment, the present disclosure further provides a compiling apparatus, which may be configured to execute the above method embodiment.
Fig. 5 schematically shows a block diagram of a compiling apparatus in an exemplary embodiment of the disclosure.
Referring to fig. 5, the compiling apparatus 500 may include:
a file receiving module 502 configured to receive a file to be compiled and a configuration file in response to a preset file uploading instruction of a client;
a connection module 504 configured to respond to the long connection establishment request of the client to establish a long connection with the client, and respond to a preset compilation end instruction of the client to disconnect the long connection and recycle the container;
a container start module 506 configured to select a compilation environment image from the plurality of compilation environment images according to the configuration file, start a container according to the compilation environment image, and interface a control port of the container to the long connection;
a file compiling module 508, configured to respond to a compiling instruction sent by the client through the long connection, and execute the compiling instruction on the file to be compiled inside the container.
Since the functions of the apparatus 500 have been described in detail in the corresponding method embodiments, the disclosure is not repeated herein.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the electronic device 600 is embodied in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: the at least one processing unit 610, the at least one memory unit 620, and a bus 630 that couples the various system components including the memory unit 620 and the processing unit 610.
Wherein the storage unit stores program code that is executable by the processing unit 610 to cause the processing unit 610 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 610 may perform steps S102 to S110 as shown in fig. 1.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
The memory unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 630 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. As shown, the network adapter 660 communicates with the other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
The program product may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (11)

1. A compilation method, comprising:
responding to a preset file uploading instruction of a client to receive a file to be compiled and a configuration file;
responding to the long connection establishment request of the client to establish long connection with the client;
selecting a compiling environment mirror image from a plurality of compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image, and butting a control port of the container to the long connection;
Responding to a compiling instruction sent by the client through the long connection, and executing the compiling instruction on the file to be compiled in the container;
and responding to a preset compiling ending instruction of the client to disconnect the long connection, and recycling the container.
2. The compilation method of claim 1 wherein selecting one of a plurality of compilation environment images based on the configuration file comprises:
determining a project identifier of the file to be compiled according to the configuration file;
when the corresponding compiling environment mirror image exists in the project identifier, directly selecting the corresponding environment mirror image;
otherwise, selecting a specified compiling environment mirror image recorded by the configuration file;
and when the configuration file does not record the specified compiling environment image, selecting a default compiling environment image.
3. The compilation method of claim 1 wherein receiving the files to be compiled and the configuration files in response to the pre-set file upload instruction from the client comprises determining a saved directory for the files to be compiled from the configuration files, and wherein launching the container from the compilation environment image comprises designating the shared directory of the container and the host as the saved directory.
4. The compilation method of claim 1 wherein the launching the container according to the compilation environment image comprises:
determining and exposing a container access port according to the configuration file.
5. The compiling method of claim 1 wherein the executing the compiling instruction on the file to be compiled inside the container comprises:
and feeding back an execution result of the compiling instruction to the client through the long connection.
6. A compilation system, comprising:
a server configured to execute the following instructions:
responding to a preset file uploading instruction of a client to receive a file to be compiled and a configuration file;
responding to the long connection establishment request of the client to establish long connection with the client;
selecting a compiling environment mirror image from a plurality of compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image, and butting a control port of the container to the long connection;
responding to a compiling instruction sent by the client through the long connection, and executing the compiling instruction on the file to be compiled in the container;
responding to a preset compiling ending instruction of the client to disconnect the long connection, and recycling the container;
A plurality of clients coupled to the server, wherein each of the clients is configured to perform the following instructions:
responding to a preset file acquisition instruction to locally acquire the file to be compiled and the configuration file;
sending the preset file uploading instruction to the server and then transmitting the file to be compiled and the configuration file;
after the file is successfully transferred, sending the long connection establishment request to the server, and establishing the long connection with the server;
sending the compiling instruction formed according to user operation to the server through the long connection;
and responding to the preset operation of the user to send the preset compiling ending instruction.
7. The compilation system of claim 6 wherein the configuration file includes an item identifier for the file to be compiled, the server configured to:
determining a project identifier of the file to be compiled according to the configuration file;
when the corresponding compiling environment mirror image exists in the project identifier, directly selecting the corresponding environment mirror image;
otherwise, selecting a specified compiling environment mirror image recorded by the configuration file;
and when the configuration file does not record the specified compiling environment image, selecting a default compiling environment image.
8. The compiling system of claim 6 wherein the client determines whether a configuration file corresponding to the file to be compiled exists in response to the preset start command, and creates the configuration file if not.
9. A compiling apparatus applied to a server side, comprising:
the file receiving module is arranged for responding to a preset file uploading instruction of the client to receive the file to be compiled and the configuration file;
the connection management module is set to respond to the long connection establishment request of the client to establish long connection with the client; responding to a preset compiling ending instruction of the client to disconnect the long connection and recycle the container;
the container starting module is used for selecting one compiling environment mirror image from the compiling environment mirror images according to the configuration file, starting a container according to the compiling environment mirror image and butting a control port of the container to the long connection;
and the file compiling module is used for responding to a compiling instruction sent by the client through the long connection and executing the compiling instruction on the file to be compiled in the container.
10. An electronic device, comprising:
A memory; and
a processor coupled to the memory, the processor configured to execute the compiling method of any of claims 1-5 based on instructions stored in the memory.
11. A computer-readable storage medium on which a program is stored, the program, when executed by a processor, implementing the compiling method according to any one of claims 1 to 5.
CN201910441480.8A 2019-05-24 2019-05-24 Compiling method and compiling system Pending CN111984261A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910441480.8A CN111984261A (en) 2019-05-24 2019-05-24 Compiling method and compiling system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910441480.8A CN111984261A (en) 2019-05-24 2019-05-24 Compiling method and compiling system

Publications (1)

Publication Number Publication Date
CN111984261A true CN111984261A (en) 2020-11-24

Family

ID=73436763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910441480.8A Pending CN111984261A (en) 2019-05-24 2019-05-24 Compiling method and compiling system

Country Status (1)

Country Link
CN (1) CN111984261A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596751A (en) * 2020-12-29 2021-04-02 Oppo广东移动通信有限公司 Compiling method, terminal, server and storage medium of application program installation package
CN113126997A (en) * 2021-04-21 2021-07-16 多点(深圳)数字科技有限公司 Compiling method for generating multiple operation containers by front-end code
CN113885875A (en) * 2021-09-30 2022-01-04 上海米哈游海渊城科技有限公司 Distributed compiling method, system, main server and storage medium
CN114035799A (en) * 2021-11-15 2022-02-11 上海闪马智能科技有限公司 Network file compiling method and device, storage medium and electronic device
CN114157654A (en) * 2021-10-28 2022-03-08 杭州未名信科科技有限公司 Integrated circuit collaborative design system and method
CN115167874A (en) * 2022-08-19 2022-10-11 禾多科技(北京)有限公司 Automatic driving software mirror image deployment method and device, electronic equipment and readable medium
CN116594632A (en) * 2023-07-18 2023-08-15 中国电信股份有限公司 Compiling method, compiling device, computer device, storage medium and compiling system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101799751A (en) * 2009-12-02 2010-08-11 山东浪潮齐鲁软件产业股份有限公司 Method for building monitoring agent software of host machine
US20170286074A1 (en) * 2016-03-29 2017-10-05 Le Holdings (Beijing) Co., Ltd. Electronic Device and Method for Multiple Compiling Platforms
CN108121543A (en) * 2017-11-30 2018-06-05 北京奇安信科技有限公司 A kind of software code process of compilation method and device
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101799751A (en) * 2009-12-02 2010-08-11 山东浪潮齐鲁软件产业股份有限公司 Method for building monitoring agent software of host machine
US20170286074A1 (en) * 2016-03-29 2017-10-05 Le Holdings (Beijing) Co., Ltd. Electronic Device and Method for Multiple Compiling Platforms
CN108121543A (en) * 2017-11-30 2018-06-05 北京奇安信科技有限公司 A kind of software code process of compilation method and device
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

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596751A (en) * 2020-12-29 2021-04-02 Oppo广东移动通信有限公司 Compiling method, terminal, server and storage medium of application program installation package
CN112596751B (en) * 2020-12-29 2024-05-17 Oppo广东移动通信有限公司 Compiling method, terminal, server and storage medium of application program installation package
CN113126997A (en) * 2021-04-21 2021-07-16 多点(深圳)数字科技有限公司 Compiling method for generating multiple operation containers by front-end code
CN113126997B (en) * 2021-04-21 2024-06-18 多点(深圳)数字科技有限公司 Compiling method for generating multiple operation containers by front-end codes
CN113885875A (en) * 2021-09-30 2022-01-04 上海米哈游海渊城科技有限公司 Distributed compiling method, system, main server and storage medium
CN114157654A (en) * 2021-10-28 2022-03-08 杭州未名信科科技有限公司 Integrated circuit collaborative design system and method
CN114157654B (en) * 2021-10-28 2024-03-19 杭州未名信科科技有限公司 Integrated circuit collaborative design system and method
CN114035799A (en) * 2021-11-15 2022-02-11 上海闪马智能科技有限公司 Network file compiling method and device, storage medium and electronic device
CN114035799B (en) * 2021-11-15 2022-12-06 上海闪马智能科技有限公司 Network file compiling method and device, storage medium and electronic device
CN115167874A (en) * 2022-08-19 2022-10-11 禾多科技(北京)有限公司 Automatic driving software mirror image deployment method and device, electronic equipment and readable medium
CN116594632A (en) * 2023-07-18 2023-08-15 中国电信股份有限公司 Compiling method, compiling device, computer device, storage medium and compiling system

Similar Documents

Publication Publication Date Title
CN111984261A (en) Compiling method and compiling system
EP3454213B1 (en) Function library build architecture for serverless execution frameworks
CN102402446B (en) Method and device for installing application software
US7703091B1 (en) Methods and apparatus for installing agents in a managed network
CN101876940B (en) Automatic test method and device
US20110072424A1 (en) System for creating virtual application, method for installing virtual application, method for calling native api and method for executing virtual application
CN108196915A (en) Code process method, equipment and storage medium based on application container engine
CN105144093A (en) Workload deployment with infrastructure management agent provisioning
US20100058319A1 (en) Agile deployment of server
US11977919B2 (en) Apparatus and method of securely and efficiently interfacing with a cloud computing service
JP7538330B2 (en) Cloud code development system, method, apparatus, device and storage medium
CN104182257A (en) Application software installation method and device
CN101316189A (en) Method, system and device for upgrading network appliance
US8418169B2 (en) Management method for managing software module and information processor
CN113946323A (en) Online development method, device, equipment and storage medium based on micro-service system
CN113778477B (en) File processing method and device, computer readable storage medium and electronic equipment
CN105389096A (en) Browser based data interaction method and apparatus
US8549545B2 (en) Abstraction of computer disk image cloning capabilities from bootable media
US9250885B2 (en) Image forming apparatus operating based on framework capable of sharing function among a plurality of bundles and method of installing bundle in image forming apparatus
CN113296795A (en) Application deployment method, device, equipment, storage medium and program product
CN109495298B (en) Method and device for managing nodes in OpenStack system
US9940334B2 (en) Image forming apparatus and control method thereof
CN116302398A (en) Workflow arrangement method, device, equipment and medium based on cloud protogenesis
JP2014157529A (en) Distribution device, device apparatus, control method of distribution device, and computer program
CN115509590B (en) Continuous deployment method and computer equipment

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