CN107797806A - A kind of dispositions method of program - Google Patents

A kind of dispositions method of program Download PDF

Info

Publication number
CN107797806A
CN107797806A CN201610751076.7A CN201610751076A CN107797806A CN 107797806 A CN107797806 A CN 107797806A CN 201610751076 A CN201610751076 A CN 201610751076A CN 107797806 A CN107797806 A CN 107797806A
Authority
CN
China
Prior art keywords
mirror image
level
image
language
mirror
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
CN201610751076.7A
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.)
Snowball (Beijing) Technology Development Co., Ltd.
Original Assignee
BEIJING XUEQIU 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 XUEQIU INFORMATION TECHNOLOGY Co Ltd filed Critical BEIJING XUEQIU INFORMATION TECHNOLOGY Co Ltd
Priority to CN201610751076.7A priority Critical patent/CN107797806A/en
Publication of CN107797806A publication Critical patent/CN107797806A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This application discloses a kind of dispositions method of program, including:The level carried out to program and its running environment from bottom to upper strata divides, and according to the mirror image of hierarchical relationship structure corresponding level, the wherein mirror image quantity of last layer level is more than or equal to the mirror image quantity of next level;The mirror image of level described in Bedding storage, mark the subordinate relation between level mirror image;The procedural item and running environment disposed as needed, select and read the mirror image of corresponding level, the mirror image read is deployed in the physical machine specified.Using the present invention, deployment efficiency can be improved, reduce deployment fault rate.

Description

A kind of dispositions method of program
Technical field
The application is related to the process field of computer program, more particularly to a kind of dispositions method of program.
Background technology
At present, increasingly systematization and scale is developed for computer program, is calculated which results in substantial amounts of Machine program needs to be disposed accordingly.Described deployment is exactly that program and its running environment are installed to the physical machine specified On.Described physical machine is the computer or smart machine that there are data to calculate disposal ability.
In the prior art, the deployment way of program is broadly divided into two kinds.
First way is used in present most of companies.Use the version control tools such as svn, git, it would be desirable to portion The program code of administration is got.If the language of explanation type, code can be directly published to the machine of production environment if PHP Run in device;If compiled language, the process by a compiling is needed if C/C++, compiles out executable file, Then this document is published in the machine of production environment and run.The problem of this mode be configuration file needed for program with Program is disconnected from each other, it is possible to which causing configuration file to be mismatched with program causes failure.Simultaneously because need to finely control The file being replaced, sometimes it is frequently necessary to replace multiple files, it is not easy to manage, for exploitation and operation maintenance personnel, make Of a relatively high with cost, deployment efficiency is low.
The second way be by code with configuration uniform packing be a software kit, so avoid configuration file and journey Sequence is mismatched the problem of causing, while the software kit can both may be mounted at test environment, can also be arranged on production environment, Deployment is got up also more convenient.But the library file relied on because test environment and production environment have a greatest differences, during operation, Even operating system version is likely to different, so the software kit tested by test environment, runs in production environment It is also possible that the problem of various can occur, fault rate is higher.
The content of the invention
In view of this, the main object of the present invention is to provide a kind of dispositions method of program, to improve deployment efficiency, reduce Fault rate.
The technical proposal of the invention is realized in this way:
A kind of dispositions method of program, including:
The level carried out to program and its running environment from bottom to upper strata divides, and is built according to the hierarchical relationship corresponding The mirror image quantity of the mirror image of level, wherein last layer level is more than or equal to the mirror image quantity of next level;
The mirror image of level described in Bedding storage, mark the subordinate relation between level mirror image;
The procedural item and running environment disposed as needed, select and read the mirror image of corresponding level, by what is read Mirror image is deployed in the physical machine specified.
In an advantageous embodiment, the mirror image according to hierarchical relationship structure corresponding level, is specifically included:
Build clean mirror image corresponding to operating system;
Based on the clean mirror image, the storehouse specified and the instrument specified, foundation image corresponding to structure are further installed;
Based on the foundation image, the runtime environment needed for designated computer language is further installed, corresponding to structure Language mirror image;
Based on the language mirror image, service code is further added, builds business mirror image.
In an advantageous embodiment, it is described to be based on the language mirror image, service code is further added, builds business mirror Picture, specifically include:
Receive the submission instruction of service code;
Obtain the language mirror image that the service code is based on;
Service code is got into local from code storage;
Packing compiles the service code;
The service code that can be run is implanted in the language mirror image;
Stopping script being started to be implanted among the language mirror image;
The content for being implanted into the language mirror image is cured as new one layer of mirror image, and new one layer of the mirror image is to successfully construct Business mirror image.
In an advantageous embodiment, this method further comprises:The side added timestamp using entry name plus code release Formula names business mirror image.
In an advantageous embodiment, the mirror image of level described in the Bedding storage, mark between level mirror image from Category relation, is specifically included:
The cryptographic Hash of the content of each mirror image is calculated, the storage location of the mirror image is determined according to the cryptographic Hash;
For having the mirror image of subordinate relation, next layer of mirror image of its subordinate of the mirrored storage on each upper strata between level Cryptographic Hash, the sequence formed using the cryptographic Hash between level is come the subordinate relation between mark layer class mirror-image;
The reading mirror image, is specifically included:The sequence formed according to the cryptographic Hash, read since most last layer mirror image Each layer of mirror image is taken, obtains a complete mirror image.
In an advantageous embodiment, it is described to select and read the mirror image of corresponding level, the mirror image read is deployed to In the physical machine specified, specifically include:
A, the mirror image for the highest level for being currently needed for deployment is read, using the mirror image as current mirror image, performs step B;
B, judge whether the next layer of mirror image that current mirror image is based on is had been deployed in the physical machine specified, if it is, Then current mirror image is deployed in the physical machine that this specifies, or the mirror image of current mirror image and its upper strata is deployed to described specify Physical machine on;Otherwise next step is performed;
C, judge current mirror image whether be the bottom mirror image, current mirror image is if it is deployed to the thing specified On reason machine, or the mirror image of current mirror image and its upper strata is deployed in the physical machine specified;Otherwise, current mirror image is read Next layer of mirror image being based on, and using the next layer of mirror image as current mirror image, perform step B.
In an advantageous embodiment, before the structure mirror image, further comprise:To being currently needed for building mirror image Program and its running environment are tested, and after test passes through, then build the mirror image of corresponding level.
In an advantageous embodiment, this method further comprises:
The number being cited using reference count mark mirror image, when receiving the instruction of the deletion to a certain mirror image, first judge Whether the reference count of the mirror image is zero, if it is deletes the mirror image, and drawing next layer of mirror image of the mirror image institute subordinate Subtract 1 with counting;Otherwise the mirror image is not deleted.
Compared with prior art, present invention employs the deployment mechanisms of the mirror image based on layering, according to program and its operation Environment carries out the level division from bottom to upper strata, and each level is all corresponding with corresponding mirror image, successfully avoid configuration with Program file management complexity, the program code of any version easily can be disposed in test environment, greatly improve portion Efficiency is affixed one's name to, reduces fault rate.Meanwhile the program by test and its running environment equally can also be by structures under the test environment The mirror image of corresponding level is built up, and the mirror image of each level can be intactly deployed in production environment, so that production Environment is consistent with test environment, reduce further the fault rate of production environment.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of the dispositions method of program of the present invention;
Fig. 2 is a kind of layering schematic diagram of level mirror image;
Fig. 3 is the life cycle schematic diagram of mirror image of the present invention;
Fig. 4 is the registration component of memory image of the present invention and the schematic diagram of storage device;
Fig. 5 is a kind of state description schematic diagram of mirror image of the present invention.
Embodiment
Below in conjunction with the accompanying drawings and specific embodiment the present invention is further described in more detail.
Fig. 1 is a kind of schematic flow sheet of the dispositions method of program of the present invention.Referring to Fig. 1, this method mainly includes:
Step 101, the level carried out to program and its running environment from bottom to upper strata divide, according to the hierarchical relationship The mirror image of corresponding level is built, the wherein mirror image quantity of last layer level is more than or equal to the mirror image quantity of next level.
The mirror image of level described in step 102, Bedding storage, marks the subordinate relation between level mirror image.
Step 103, the procedural item disposed as needed and running environment, select and read the mirror image of corresponding level, will The mirror image read is deployed in the physical machine specified.
Fig. 2 is a kind of layering schematic diagram of level mirror image.It is of the present invention that program and its running environment are entered referring to Fig. 2 Level division of the row from bottom to upper strata, according to the mirror image of hierarchical relationship structure corresponding level, can specifically include:
Step 201, first, build clean mirror image corresponding to operating system.That is one is first built only with operation The clean mirror image of system, operating system is solidified, and this is a kind of a kind of mirror image of the most basic bottom.Can be according to operation The difference of system, the clean mirror image of different operating system version, such as the clean mirror image of structure windows operating systems are built, Clean mirror image corresponding to the operating system structure of each versions of Windows can be especially directed to, Linux operations system can also be built Unite the clean mirror image of each version.Clean mirror image is all to belong to same level corresponding to the operating system of these certain each versions Mirror image, belong to the mirror image of the most basic bottom.After constructing the clean mirror image, it is possible to calculate the content of the clean mirror image Cryptographic Hash H1, the unique mark using cryptographic Hash H1 as the clean mirror image, the clean mirror image is determined according to cryptographic Hash H1 Storage location, and by the clean mirrored storage to the storage location specified.
Step 202, secondly, as shown in Fig. 2 be based on above-mentioned clean mirror image, further refers in described totally installed on mirror image Fixed storehouse and the instrument specified, foundation image corresponding to structure.Such as will can be actually needed operation when storehouse and necessity The tool of production be installed in the clean mirror image, such as the related component of monitoring system, the instrument etc. of bulk management, after installation The content installed is constructed into a general foundation image in inside.After constructing foundation image, it is also desirable to calculate the basis The cryptographic Hash H2 of mirror image, the unique mark using cryptographic Hash H2 as the foundation image, determine that this is clean according to cryptographic Hash H2 The storage location of mirror image, the foundation image is stored to the storage location specified, while to store what the foundation image was based on The cryptographic Hash H1 of described next layer of clean mirror image, the i.e. foundation image will record H2+H1.
Step 203, again, based on the foundation image, designated computer language is further installed on the foundation image Required runtime environment, it is corresponding such as the running environment needed for the language such as java/nodejs/python/php, structure Language mirror image.After constructing language mirror image, it is also desirable to calculate the cryptographic Hash H3 of the language mirror image, regard cryptographic Hash H3 as this The unique mark of language mirror image, the storage location of the language mirror image is determined according to cryptographic Hash H3, the language mirrored storage is arrived The storage location specified, while to store the cryptographic Hash H2 for described next layer of the foundation image that the language mirror image is based on, i.e., The language mirror image will record H3+H2.
It is step 204, last, based on the language mirror image, specific service code is further added, constructs business mirror Picture.The specific service code is exactly the code of specific application program.After constructing business mirror image, it is also desirable to calculate the industry The cryptographic Hash H4 of business mirror image, the unique mark using cryptographic Hash H4 as the business mirror image, the industry is determined according to cryptographic Hash H4 The storage location of business mirror image, by the business mirrored storage to the storage location specified, while will store the business mirror image and be based on Described next layer of language mirror image cryptographic Hash H3, i.e. the business mirror image will record H4+H3..
Pass through said process, it can be seen that the mirror image of level described in the Bedding storage, between the mirror image for marking level Subordinate relation, particularly as being:
The cryptographic Hash of the content of each mirror image is calculated, the storage location of the mirror image, a Hash are determined according to the cryptographic Hash Mirror image corresponding to value only stores one, i.e., if mirror image was stored corresponding to a cryptographic Hash, then without repeating to store;
One complete mirror image is made up of multilayer, for having the mirror image of subordinate relation, the mirror on each upper strata between level As the cryptographic Hash of next layer of mirror image storing its subordinate, the sequence that is formed using the cryptographic Hash between level marks level Subordinate relation between mirror image.The sequence of the one as described above complete composition of cryptographic Hash corresponding to mirror image is H4+H3+H2+H1.
Certainly, in a kind of preferred embodiment, before each mirror image of above-mentioned structure, can further include:It is right The program and its running environment for being currently needed for building mirror image are tested, and after test passes through, then build the mirror image of corresponding level. That is, the process for currently building each mirror image is also to build under the test environment, it is therefore desirable to program and its operation ring Border is tested, and test builds the mirror image of corresponding level again after passing through, can reduce and be led in the case where mirror image being deployed to production environment The fault rate of cause.
Each edition code of each project is directed to, the deployment system for using the inventive method all can be this part of code structure A mirror image is built out, the required operating system of program operation, environmental variance, various base libraries, configuration are contained in the mirror image File and executable file.When the code stored in version control tool changes, deployment system will be triggered System constructs a mirror image.
Described in detail below for a kind of preferred embodiment in the step 204, for each version generation of each project Code, based on the language mirror image, service code is further added, builds business mirror image, its detailed process includes:
Step 241, the submission instruction for receiving service code.That is, for each edition code of each project, As long as programmer writes the service code of what a version, and have submitted service code, submission instruction can be all triggered, using this hair The submission instruction that the deployment system of bright method receives the service code will trigger the following step of execution, so as to targetedly Ground builds a corresponding business mirror image.
Step 242, obtain the language mirror image that the service code is based on.Need to judge institute's submission business in this step The relevant parameter of computer language used by code, then gone to obtain corresponding language according to the relevant parameter of the computer language Say mirror image.For example, if service code then needs to obtain language mirror image corresponding to PHP using PHP language.At this point it is possible to First determine whether to whether there is the language mirror image on present physical machine, if there is next step is then leapt to, if do not deposited Language mirror corresponding to (being specifically to be obtained from registration component as described below) is obtained in the then storage device from memory image Picture, then perform next step.
Step 243, service code got into local from code storage.
Step 245, packing compile the service code.
Step 246, the service code that can be run is implanted in the language mirror image, mesh when initialization program is run Record, change the content such as directory permission, addition configuration file.
Step 247, by start stop script being implanted among the language mirror image.
Step 248, the content for being implanted into the language mirror image are cured as new one layer of mirror image, and new one layer of the mirror image is The business mirror image successfully constructed.Such a business mirror image based on language mirror image, which is just built, to be completed.
After mirror image is constructed, for convenience of storing and managing, it is necessary to name mirror image.In a kind of preferred real of the present invention Apply in example, this method further comprises:The mode added timestamp using entry name plus code release names business mirror image.
In one preferred embodiment of the invention, mirror image can using the unified file system (aufs) of sophisticated multilevel come Layering is realized, the benefit using level is can to put the mirror image for comparing bottom well in advance on all machines of the present invention, such as dry Net mirror image, foundation image etc., when deployed, can in specified physical machine as long as that layer of mirror image of the top business is transferred to Can greatly save hard disk expense, lifting deployment efficiency.Because when the mirror image for all putting bottom on all machines well in advance Afterwards, when needing to dispose a new mirror image, as long as there is the mirror image can of variation on renewal upper strata, it is not necessary to update bottom Mirror image in file, it is possible to save the read-write expense of hard disk.The capacity saving of hard disk is by inside same machine Multiple upper strata mirror images share the mirror image of same bottom to realize
The aufs is a kind of union file system (Union File System), and so-called union file system is exactly handle The catalogue of different physical locations, which merges, to be mounted in same catalogue.It allows the file of individual files system and catalogue (to be referred to as Branch, branches), pellucidly covered, form single coherent consistent file system.In new, virtual file system In system, the content that the catalogue of same paths is possessed in former branch in the catalogue after a single merging while will occur.One Individual most important application is to give joint carry together CD/DVD and hard disk catalogue, then, it is possible to this File on read-only CD/DVD is modified (file of modification is stored in the catalogue on hard disk).
It is described construct mirror image after, the mirror image is whether deployed to test environment or production environment, be required for from The place of one centrally stored mirror image gets mirror image, so needing the service of a memory image.Fig. 3 is mirror of the present invention The life cycle schematic diagram of picture.Referring to Fig. 3, mirror image is stored from creating, to deployment then it is discarded be a complete life Cycle.In a preferred embodiment of the present invention, it can be realized using a component for being called registration component (registry) The storage of mirror image.
Fig. 4 is the registration component of memory image of the present invention and the schematic diagram of storage device.Referring to Fig. 4, the registration Component is broadly divided into two parts, and a part is to provide HTTP (HTTP, HyperText Transfer Protocol) the webserver (webserver) 401 of protocol interface, another part are the memory drives for data storage Dynamic device (storage driver) 402.Orlop be specific storage device 403 (such as specific disk storage device) so as to The persistent storage of data can be realized.
The HTTP interface of the webserver 401 mainly provides acquisition, increase, deletion, the function of searching mirror image, at this In a kind of preferred embodiment of invention, mirror image is named using the mode of entry name+code release+timestamp, is disposed when needs When, the mirror image of all versions that can be disposed of user can be showed, is selected for user, due to wherein having project and code release Information, it is possible to some mirror image is directly targeted in registration component.
When storage, due to present invention uses the mirror image of hierarchical relationship, the mirror image of base level (such as operating system Clean mirror image) only need to store a can, the mirror image on upper strata is if difference, then mirror image corresponding to each different editions It is required for storing.
Specifically, as set forth above, it is possible to be hash according to the content of each level mirror image, determine to store according to the hash To the position of storage device, if the hash was stored, without repeating to store.One complete mirror image is by multilayer Form, the mirror image on each upper strata can store the hash values of next layer of mirror image.
When mirror image is read, specifically include:The sequence formed according to the cryptographic Hash, opened from most last layer mirror image Beginning reads each layer of mirror image, it is possible to obtains a complete mirror image.
In addition, in another preferred embodiment, method of the present invention can further include:Storage and During managing the mirror image, using the number that is cited of reference count mark mirror image, i.e., each mirror image storage when Hou Douhui records a reference count, if when successfully constructing some new mirror image, next layer of the new mirror image institute subordinate Reference count corresponding to mirror image will add 1.That is the mirror image on basis, its reference count are higher.
The present invention can also delete stored mirror image, when receiving the instruction of the deletion to a certain mirror image, first judge the mirror Whether the reference count of picture is zero, if it is deletes the mirror image, and by the reference meter of next layer of mirror image of the mirror image institute subordinate Number subtracts 1;Otherwise the mirror image is not deleted.It can thus be reclaimed when deleting by the way of reference count, when the reference of mirror image It can be deleted after being counted as 0.
After building and having stored mirror image, the issue of the deployment of mirror image, i.e. mirror image is described below.
The deployment process of mirror image needs user to select to need procedural item and environment (test environment or the exploitation disposed first Environment);Then selection needs the mirror image disposed, because the code of each version can have a mirror image, this step be in fact The code of which version is issued in selection;Finally confirm to be deployed to the triggering deployment behavior of physical machine can.
Such as a kind of state description schematic diagram that Fig. 5 is mirror image of the present invention.Referring to Fig. 5, mirror image since initial create, Then it is deployed in test environment and is tested, only can be just deployed in production environment, i.e., just may be used by the mirror image of test To be published on line.When needing to be deployed in production environment, it is possible to the mirror image by testing is obtained from the mirror image of storage Disposed.
In above-mentioned steps 103, the procedural item and running environment disposed as needed, select and read the mirror of corresponding level Picture, the mirror image read is deployed in the physical machine specified, in an advantageous embodiment, can include walking in detail below Suddenly:
Step A, the procedural item and running environment disposed as needed, the mirror for the highest level for being currently needed for deployment is read Picture, using the mirror image as current mirror image, perform step B.Such as need deployment business mirror image 1, then being read from storage device should Business mirror image 1.
Step B, judge whether the next layer of mirror image that current mirror image is based on is had been deployed in the physical machine specified, if It is then to be deployed to current mirror image in the physical machine that this specifies, or the mirror image of current mirror image and its upper strata is deployed to described In the physical machine specified;Otherwise next step is performed.
For example, in the step B of this execution, current business mirror image 1 is top mirror image, by reading the business mirror image The sequence of hash values value of 1 storage, the cryptographic Hash of next layer of mirror image of the business mirror image 1 can be learnt, it is assumed that the next layer of mirror It seem PHP language mirror image;Judge the next layer of mirror image whether portion then according to the cryptographic Hash of the next layer of mirror image Administration, if deployed, need not repeat to read and dispose in specified physical machine, but directly by current business mirror As 1 is deployed in the physical machine, because the business mirror image 1 has been top mirror image, therefore only need to dispose the industry Business mirror image 1.If the next layer of mirror image is not deployed in also in the physical machine specified, next step is performed.
Step C, judge current mirror image whether be the bottom mirror image, if it is by current mirror image be deployed to it is described specify Physical machine on, or the mirror image of current mirror image and its upper strata is deployed in the physical machine specified;Otherwise, read current The next layer of mirror image that mirror image is based on, and using the next layer of mirror image as current mirror image, perform step B.
For example, in the step C of this execution, current business mirror image is apparently not the mirror image of the bottom, therefore is read Current next layer of mirror image being based on, i.e., read the language mirror image of the PHP from storage device, and by the language of the PHP Say that mirror image as current mirror image, re-executes step B.
When re-executing step B, due to the language mirror image that current mirror image is PHP, the cryptographic Hash sequence stored according to it Train value, the cryptographic Hash of next layer of mirror image of the PHP language mirror images can be learnt, it is assumed that the next layer of mirror image for a basic mirror Picture;Judge whether the next layer of mirror image is had been deployed in the physical machine specified then according to the cryptographic Hash of the next layer of mirror image, If deployed, need not repeat to read and dispose, but directly by the industry of current PHP language mirror image and its last layer Business mirror image 1 is deployed in the physical machine.If the next layer of mirror image is not deployed in also in the physical machine specified, then is weighed It is new to perform next step C.
In the step C performed again, it is clear that this PHP language mirror image is not also the mirror image of the bottom, then according to next The cryptographic Hash of layer mirror image reads next layer of mirror image from storage device, it is assumed that next layer of mirror image is a foundation image, and this is next Layer mirror image performs step B again as current mirror image.Continue executing with foregoing judgement and operation, until the business mirror image 1 and its All mirror images of institute's subordinate are all deployed in specified physical machine.
More specifically, it is exactly one after mirror image is behaved because mirror image is one group of static file in fact in itself Individual container (container), container startup need to rely on docker engine as engine.The docker Engine is the present invention used engine by image starting for container in one embodiment.
The concrete operations for once disposing mirror image in a kind of specific application scenarios are described below, the operation includes as follows Step.
Step 601, deployment information needed is got first, these information include:Mirror image ID is the cryptographic Hash, container (container) the ip addresses for the physical machine that quantity, the ip addresses of each container and needs are deployed to.
Step 602, corresponding required mirror image is read, according to the ip addresses of physical machine, concurrent is transferred to required mirror image In physical machine.
Some hooks action (hook) before step 603, operation deployment, for example removed in the nginx of upstream in deployment Node, add maintenance state etc. in monitoring system for the node.The nginx is a load equalizer, is a generation Server is managed, all requests of user are all first to access nginx, and nginx recalls the service of the method for the invention to provide Service.So if the service of a certain rear end hangs, nginx timely can also extract it.
Step 604,3 classes are classified as according to the ip addresses of container:In newly-increased, operation, it is deleted.
Step 605, directly initiate newly-increased container.
Step 606, for operating container, first stop successively in being currently running, will be new further according to new mirror image Container starts up, if the deployment task of production environment, after the completion of first node deployment, deployment behavior can be automatically temporary Stop, can just continue to dispose after confirmed service is normal.
Step 607, delete container just out of service.
Step 608, delete what user's manually determined was deleted.
Some hook performed are needed after step 909, operation deployment, for example are added the node in upstream, are removed Maintenance state, time test case of operation etc..
This patent essentially discloses the deployment mechanisms based on layering mirror image.According to hierarchical relationship, constructing one first will The lower floor that operating system, base library, environmental variance, configuration file and the program file that program relies on when running are included Mirror image (including one layer or several layers of);Then by lower floor's mirrored storage in a centrally stored service, business generation The mirror image of code level can be directly based upon these lower floor's mirror image structures;Finally by constructed and storage mirror image, as needed issue Into the machine for needing operation program, the program in mirror image is behaved.The present invention is considered in existing frequently-used scheme Weak point, using the deployment mechanisms of the mirror image based on layering, successfully avoid configuration and program file complex management, program Runtime environment is in test with producing the problems such as inconsistent.The present invention easily can also dispose any version generation in test environment Code, greatly improves efficiency.
In addition, each embodiment of the present invention can pass through the data processing by data processing equipment such as computer execution Program is realized.Obviously, data processor constitutes the present invention.In addition, it is generally stored inside the data in a storage medium Processing routine by program by directly reading out storage medium or by installing or copying to data processing equipment by program Performed in storage device (such as hard disk and/or internal memory).Therefore, such storage medium also constitutes the present invention.Storage medium can be with Use any kind of recording mode, such as paper storage medium (such as paper tape), magnetic storage medium (such as floppy disk, hard disk, flash memory Deng), optical storage media (such as CD-ROM), magnetic-optical storage medium (such as MO) etc..
Therefore the invention also discloses a kind of storage medium, wherein data processor is stored with, the data processor For performing any embodiment of the above method of the present invention.
In addition, method and step of the present invention is with data processor except can be realized, can also by hardware Lai Realize, for example, can be by gate, switch, application specific integrated circuit (ASIC), programmable logic controller (PLC) and embedded microcontroller Etc. realizing.Therefore this hardware that can realize the method for the invention can also form the present invention.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention God any modification, equivalent substitution and improvements done etc., should be included within the scope of protection of the invention with principle.

Claims (8)

  1. A kind of 1. dispositions method of program, it is characterised in that including:
    The level carried out to program and its running environment from bottom to upper strata is divided, and corresponding level is built according to the hierarchical relationship Mirror image, wherein the mirror image quantity of last layer level be more than or equal to next level mirror image quantity;
    The mirror image of level described in Bedding storage, mark the subordinate relation between level mirror image;
    The procedural item and running environment disposed as needed, select and read the mirror image of corresponding level, the mirror image that will be read It is deployed in the physical machine specified.
  2. 2. according to the method for claim 1, it is characterised in that the mirror according to hierarchical relationship structure corresponding level Picture, specifically include:
    Build clean mirror image corresponding to operating system;
    Based on the clean mirror image, the storehouse specified and the instrument specified, foundation image corresponding to structure are further installed;
    Based on the foundation image, the runtime environment needed for designated computer language, language corresponding to structure are further installed Mirror image;
    Based on the language mirror image, service code is further added, builds business mirror image.
  3. 3. according to the method for claim 2, it is characterised in that it is described to be based on the language mirror image, further add business Code, business mirror image is built, is specifically included:
    Receive the submission instruction of service code;
    Obtain the language mirror image that the service code is based on;
    Service code is got into local from code storage;
    Packing compiles the service code;
    The service code that can be run is implanted in the language mirror image;
    Stopping script being started to be implanted among the language mirror image;
    The content for being implanted into the language mirror image is cured as new one layer of mirror image, and new one layer of the mirror image is the industry successfully constructed Business mirror image.
  4. 4. according to the method in claim 2 or 3, it is characterised in that this method further comprises:Use entry name plus code The mode that version adds timestamp names business mirror image.
  5. 5. according to the method for claim 1, it is characterised in that the mirror image of level described in the Bedding storage, mark layer Subordinate relation between class mirror-image, is specifically included:
    The cryptographic Hash of the content of each mirror image is calculated, the storage location of the mirror image is determined according to the cryptographic Hash;
    For having the mirror image of subordinate relation, the Kazakhstan of next layer of mirror image of its subordinate of the mirrored storage on each upper strata between level Uncommon value, the sequence formed using the cryptographic Hash between level is come the subordinate relation between mark layer class mirror-image;
    The reading mirror image, is specifically included:The sequence formed according to the cryptographic Hash, read since most last layer mirror image every One layer of mirror image, obtain a complete mirror image.
  6. 6. according to the method for claim 1, it is characterised in that it is described to select and read the mirror image of corresponding level, it will be read The mirror image taken is deployed in the physical machine specified, and is specifically included:
    A, the mirror image for the highest level for being currently needed for deployment is read, using the mirror image as current mirror image, performs step B;
    B, judge whether the next layer of mirror image that current mirror image is based on is had been deployed in the physical machine specified, if it is, will Current mirror image is deployed in the physical machine that this is specified, or the mirror image of current mirror image and its upper strata is deployed into the thing specified On reason machine;Otherwise next step is performed;
    C, judge current mirror image whether be the bottom mirror image, current mirror image is if it is deployed to the physical machine specified On, or the mirror image of current mirror image and its upper strata is deployed in the physical machine specified;Otherwise, current mirror image institute base is read In next layer of mirror image, and using the next layer of mirror image as current mirror image, perform step B.
  7. 7. according to the method for claim 1, it is characterised in that before the structure mirror image, further comprise:To current The program and its running environment for needing structure mirror image are tested, and after test passes through, then build the mirror image of corresponding level.
  8. 8. according to the method for claim 1, it is characterised in that this method further comprises:
    The number being cited using reference count mark mirror image, when receiving the instruction of the deletion to a certain mirror image, first judge the mirror Whether the reference count of picture is zero, if it is deletes the mirror image, and by the reference meter of next layer of mirror image of the mirror image institute subordinate Number subtracts 1;Otherwise the mirror image is not deleted.
CN201610751076.7A 2016-08-29 2016-08-29 A kind of dispositions method of program Pending CN107797806A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610751076.7A CN107797806A (en) 2016-08-29 2016-08-29 A kind of dispositions method of program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610751076.7A CN107797806A (en) 2016-08-29 2016-08-29 A kind of dispositions method of program

Publications (1)

Publication Number Publication Date
CN107797806A true CN107797806A (en) 2018-03-13

Family

ID=61527850

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610751076.7A Pending CN107797806A (en) 2016-08-29 2016-08-29 A kind of dispositions method of program

Country Status (1)

Country Link
CN (1) CN107797806A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108829399A (en) * 2018-04-13 2018-11-16 杭州朗和科技有限公司 A kind of test method of application, test device, medium and calculate equipment
CN108829588A (en) * 2018-05-30 2018-11-16 北京顺丰同城科技有限公司 A kind of processing method of test application program, deployment system and device
CN109194725A (en) * 2018-08-17 2019-01-11 杭州数梦工场科技有限公司 A kind of transmission method of mirror image, device, equipment and computer storage medium
CN109375929A (en) * 2018-11-22 2019-02-22 东软集团股份有限公司 Installation kit generation method, device, storage medium and the equipment of Java web application
CN109871213A (en) * 2018-12-25 2019-06-11 武汉烽火信息集成技术有限公司 OpenStack containerization system and method based on Domestic Platform
CN110019145A (en) * 2018-06-19 2019-07-16 杭州数澜科技有限公司 A kind of multi-environment cascade method and apparatus of big data platform
CN110502268A (en) * 2019-08-29 2019-11-26 恩亿科(北京)数据科技有限公司 Application program update method, apparatus, server and storage medium
CN110908675A (en) * 2019-11-15 2020-03-24 北京百度网讯科技有限公司 Operating environment acquisition method and device and electronic equipment
CN111459668A (en) * 2020-03-30 2020-07-28 中科边缘智慧信息科技(苏州)有限公司 Lightweight resource virtualization method and device for server
CN111459614A (en) * 2020-03-30 2020-07-28 中科边缘智慧信息科技(苏州)有限公司 Service lightweight containerized packaging migration method
CN115576903A (en) * 2022-11-16 2023-01-06 统信软件技术有限公司 File system construction method, computing device and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740048A (en) * 2016-01-26 2016-07-06 华为技术有限公司 Image management method, device and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740048A (en) * 2016-01-26 2016-07-06 华为技术有限公司 Image management method, device and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
天符云创: "DevOps 流程中对于 Docker Image 的分层管理与实践", 《HTTPS://BLOG.CSDN.NET/ENWEITECH/ARTICLE/DETAILS/51782636》 *
高磊: "雪球的Docker实践", 《HTTPS://WWW.INFOQ.CN/ARTICLE/DOCKER-IN-XUEQIU》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108829399A (en) * 2018-04-13 2018-11-16 杭州朗和科技有限公司 A kind of test method of application, test device, medium and calculate equipment
CN108829399B (en) * 2018-04-13 2022-05-20 杭州朗和科技有限公司 Application testing method, testing device, medium and computing equipment
CN108829588A (en) * 2018-05-30 2018-11-16 北京顺丰同城科技有限公司 A kind of processing method of test application program, deployment system and device
CN110019145B (en) * 2018-06-19 2021-09-14 杭州数澜科技有限公司 Multi-environment cascading method and device for big data platform
CN110019145A (en) * 2018-06-19 2019-07-16 杭州数澜科技有限公司 A kind of multi-environment cascade method and apparatus of big data platform
CN109194725A (en) * 2018-08-17 2019-01-11 杭州数梦工场科技有限公司 A kind of transmission method of mirror image, device, equipment and computer storage medium
CN109194725B (en) * 2018-08-17 2019-07-09 杭州数梦工场科技有限公司 A kind of transmission method of mirror image, device, equipment and computer storage medium
CN109375929A (en) * 2018-11-22 2019-02-22 东软集团股份有限公司 Installation kit generation method, device, storage medium and the equipment of Java web application
CN109871213A (en) * 2018-12-25 2019-06-11 武汉烽火信息集成技术有限公司 OpenStack containerization system and method based on Domestic Platform
CN110502268A (en) * 2019-08-29 2019-11-26 恩亿科(北京)数据科技有限公司 Application program update method, apparatus, server and storage medium
CN110908675A (en) * 2019-11-15 2020-03-24 北京百度网讯科技有限公司 Operating environment acquisition method and device and electronic equipment
CN110908675B (en) * 2019-11-15 2023-10-24 北京百度网讯科技有限公司 Method and device for acquiring running environment and electronic equipment
CN111459668A (en) * 2020-03-30 2020-07-28 中科边缘智慧信息科技(苏州)有限公司 Lightweight resource virtualization method and device for server
CN111459614A (en) * 2020-03-30 2020-07-28 中科边缘智慧信息科技(苏州)有限公司 Service lightweight containerized packaging migration method
CN115576903A (en) * 2022-11-16 2023-01-06 统信软件技术有限公司 File system construction method, computing device and storage medium

Similar Documents

Publication Publication Date Title
CN107797806A (en) A kind of dispositions method of program
US8589903B2 (en) Patch attachment facility
US9477462B2 (en) System and method for software product versioning packaging, distribution, and patching
US7926051B2 (en) Automatic parallel non-dependent component deployment
JP5380540B2 (en) Data tier application component
CN107577469A (en) A kind of Software package method for release management
US8769494B2 (en) Globally sound and consistent configuration management for distributed datacenter components
US10963236B2 (en) Creation of software images of software applications for image-based maintenance of the software applications
JP6238983B2 (en) Browsing open file history
JP2008507775A (en) System and method for extracting and creating application meta information in a software application repository
US20080047000A1 (en) Program Execution Device And Program Execution Method
CN105468473A (en) Data migration method and data migration apparatus
CN102339219A (en) System and method for supporting object-oriented script tool
JP2010198383A (en) Storage device, software updating method, and software updating program
CN101375280A (en) Event structured file system (ESFS)
CN102999349A (en) Software upgrading method
CN110347483A (en) Physical machine is to virtual machine migration method, device and storage medium
US7890945B2 (en) Method for versioning classes loaded in an OSGi-enabled J2EE environment
KR100858157B1 (en) System and merhod for map uapdate, storage medium recording that method program, user termianl
CN103207872A (en) Real-time indexing method and server
CN113672255A (en) Distributed storage software upgrading method and device
CN106484312B (en) A kind of magnetic disk of virtual machine data migration method and device
US9047161B1 (en) Discovery, consolidation, and archival of multiple operating system software licenses
US20050102666A1 (en) Pre-deployment component hosting environment analyzer
US8694550B2 (en) Merging file directories

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
TA01 Transfer of patent application right

Effective date of registration: 20181225

Address after: 100102 19th Floor, 3A Block, Soho Tower, Wangjing, No. 1 Courtyard, Futong East Street, Chaoyang District, Beijing

Applicant after: Snowball (Beijing) Technology Development Co., Ltd.

Address before: 100102 19th Floor, 3A Block, Soho Tower, Wangjing, No. 1 Courtyard, Futong East Street, Chaoyang District, Beijing

Applicant before: BEIJING XUEQIU INFORMATION TECHNOLOGY CO., LTD.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20180313

RJ01 Rejection of invention patent application after publication