CN110275717B - Private image cloning method, private image cloning device, computer equipment and storage medium - Google Patents

Private image cloning method, private image cloning device, computer equipment and storage medium Download PDF

Info

Publication number
CN110275717B
CN110275717B CN201910410585.7A CN201910410585A CN110275717B CN 110275717 B CN110275717 B CN 110275717B CN 201910410585 A CN201910410585 A CN 201910410585A CN 110275717 B CN110275717 B CN 110275717B
Authority
CN
China
Prior art keywords
image
private
original
cloning
warehouse
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.)
Active
Application number
CN201910410585.7A
Other languages
Chinese (zh)
Other versions
CN110275717A (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910410585.7A priority Critical patent/CN110275717B/en
Publication of CN110275717A publication Critical patent/CN110275717A/en
Application granted granted Critical
Publication of CN110275717B publication Critical patent/CN110275717B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Facsimiles In General (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application provides a private mirror cloning method, a private mirror cloning device, computer equipment and a storage medium, which relate to the technical field of cloud computing and can be applied to a PaaS platform. The method comprises the following steps: determining a target mirror image warehouse according to the set target application environment and target area to be cloned; judging whether an original private mirror image exists on a physical machine generating a clone instruction; and if the original private mirror image exists on the physical machine generating the cloning instruction, cloning the original private mirror image to a target mirror image warehouse. The cloning process of the embodiment of the application is automatically completed without user intervention, the speed and efficiency of private mirror image cloning are improved, after the private mirror image is cloned to the target mirror image warehouse, the cloned private mirror image can be directly utilized, thus private mirror images do not need to be acquired in a trans-regional mode, the safety is improved, and the efficiency of creating container applications by utilizing the private mirror image is further improved.

Description

Private image cloning method, private image cloning device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of cloud computing technologies, and in particular, to a private image cloning method, a private image cloning device, a computer device, and a storage medium.
Background
After the private image is successfully manufactured, the private image is used to complete quick deployment. In a cloud Platform, for example, in a PaaS (Platform-as-a-Service) Platform, if a container instance corresponding to a container application is to be created by using a private image, the private image is obtained from an image repository under an area corresponding to the created container application. However, the private application image may not exist in the image warehouse under the area corresponding to the created container application, and the cross-regional direct acquisition of the private application image may have security problems and inefficiency problems.
Disclosure of Invention
The embodiment of the application provides a private image cloning method, a private image cloning device, computer equipment and a storage medium, which can clone a private image, and when a container application is created by using the private image, the private image does not need to be acquired in a transregional way, so that the safety and the efficiency of creating the container application by using the private image are improved.
In a first aspect, an embodiment of the present application provides a private mirror cloning method, including:
if a private image cloning instruction is received, acquiring an original private image in the cloning instruction, and calling a preset setting interface according to the cloning instruction so as to receive a target application environment and a target area which are set by the preset setting interface and need cloning; determining a destination mirror warehouse according to the destination application environment and the destination area; judging whether the original private mirror image exists on the physical machine generating the clone instruction; and if the original private mirror image exists on the physical machine generating the cloning instruction, cloning the original private mirror image to the target mirror image warehouse.
In a second aspect, an embodiment of the present invention provides a private mirror cloning apparatus, where the private mirror cloning apparatus includes a unit configured to perform a method according to the first aspect.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a memory, and a processor connected to the memory;
the memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory, so as to perform the method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium storing a computer program, which when executed by a processor, implements the method according to the first aspect.
In the embodiment of the application, except that the cloning instruction can involve user triggering, the cloning is automatically completed without user intervention, so that the speed and efficiency of cloning the private mirror image are improved, after the private mirror image is cloned to the target mirror image warehouse, the cloned private mirror image can be directly utilized, thus, the private mirror image does not need to be acquired in a trans-regional mode, the safety is improved, and the efficiency of creating the container application by utilizing the private mirror image is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a private mirror cloning method provided in an embodiment of the present application;
FIG. 2 is a flowchart of a private mirror cloning method according to another embodiment of the present application;
FIG. 3 is a flowchart of a private mirror cloning method according to another embodiment of the present disclosure;
FIG. 4 is a flowchart of a private mirror cloning method according to another embodiment of the present application;
FIG. 5 is a schematic sub-flowchart of a private mirror cloning method according to another embodiment of the present application;
FIG. 6 is a schematic block diagram of a private mirror clone device provided by embodiments of the present application;
FIG. 7 is a schematic block diagram of a private mirror clone device provided by another embodiment of the present application;
FIG. 8 is a schematic block diagram of a private mirror clone device provided by another embodiment of the present application;
FIG. 9 is a schematic block diagram of a private mirror clone device provided by another embodiment of the present application;
FIG. 10 is a schematic block diagram of a creation unit provided by another embodiment of the present application;
fig. 11 is a schematic block diagram of a computer device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be noted that in the following description, the container instance of the container application and the container of the container application are the same.
Fig. 1 is a schematic flow chart of a private mirror cloning method according to an embodiment of the present application. As shown in FIG. 1, the method includes S101-S107.
S101, if a private image cloning instruction is received, acquiring an original private image in the cloning instruction, and calling a preset setting interface according to the cloning instruction so as to receive a target application environment and a target area which are set through the preset setting interface and need cloning.
The private mirror image cloning instruction triggering mode comprises various modes, such as a user touching or clicking a related button or image triggering, such as clicking a cloning button corresponding to a private mirror image in a private mirror image list, and triggering the private mirror image cloning instruction; the user's voice clone private mirror information may also be received to trigger. In this embodiment, the manner in which the private image clone instruction triggers is not limited.
If a private image clone instruction is received, a private image in the clone instruction is obtained, and the private image in the clone instruction is called the original private image, for example, the original private image in the clone instruction comprises identification information of which private image can be determined by the name, the number and the like of the original private image. All information of the private image can be obtained from the database according to the identification information. And acquiring the original private mirror image in the clone instruction, and calling a preset setting interface according to the clone instruction. The preset setting interface may exist in the form of an interface. The destination application environment and the destination area of the private image to be cloned can be set through a preset setting interface. The target application environment comprises a production environment, a testing environment and a development environment. The production environment is understood to be an environment for providing services for internet users, the test environment is an environment for testing required use internally, and the development environment is an environment for developing required use internally. The destination area includes two parts: "region" + "safe region". Where a "safe zone" is a sub-zone below the "zone". The private image clone is determined in which specific position according to the destination application environment and the destination area, and the private image clone can be understood to be cloned in a machine room corresponding to a certain area under a certain application environment. Alternatively, it is also understood that a machine room position is determined together according to the application environment of the purpose and the area of the purpose. For example, a certain area corresponds to a machine room position under a certain application environment. Such as cloning the original private image in the room where the SF (smaller area identifier below the businessman) sub-area under the businessman (place name) area under the test environment.
S102, determining a destination mirror warehouse according to the destination application environment and the destination area.
Wherein an application environment and an area define a destination image repository. It is understood that one machine room corresponds to one mirrored warehouse. Therefore, when the container application is created, the needed mirror image information is conveniently obtained from the corresponding mirror image warehouse, the mirror image information is not required to be obtained from other mirror image warehouses in a transregional mode, and the efficiency of obtaining the mirror image information is improved. Determining the destination mirror warehouse comprises determining an IP address and/or a destination mirror warehouse name corresponding to the destination mirror warehouse. Specifically, the corresponding IP address and/or the destination mirror warehouse name of the destination mirror warehouse are obtained from the database.
S103, judging whether the original private mirror image exists on the physical machine generating the clone instruction.
Specifically, the name of the original private image is obtained; inquiring whether a private mirror image with the same name as the original private mirror image exists on a physical machine generating the clone instruction; if the private mirror image with the same name as the original private mirror image exists on the physical machine, determining that the original private mirror image exists on the physical machine; otherwise, determining that the original private image does not exist on the physical machine. The searching whether the private mirror image with the same name as the original private mirror image exists on the physical machine comprises the following steps: and checking all private images existing on the physical machine through the command, and matching the original private image with all private images existing on the host machine. Wherein a list of all private images present on the host can be viewed through the dockerimages command. A physical machine is also understood to be a local physical machine, i.e. a machine that generates clone instructions.
If the original private image does not exist on the physical machine, step S104 is executed, and if the original private image exists on the physical machine, step S107 is executed.
S104, determining an original mirror warehouse according to the information of the original private mirror.
And determining an application environment and an area corresponding to the original private image according to the original private image, and determining an original image warehouse according to the application environment and the area corresponding to the original private image. And acquiring information such as an original mirror image warehouse corresponding to the original private mirror image, an IP address and/or a destination mirror image warehouse name corresponding to the original mirror image warehouse and the like from a database according to an application environment and an area corresponding to the original private mirror image.
S105, judging whether the original private image exists in the original image warehouse.
Specifically, whether the original private image exists or not is inquired in an original image warehouse according to information such as the name of the original private image.
If the original private image exists in the original image warehouse, the execution step is S106; otherwise, a prompt message is returned to inform the user that the original private image is not found.
S106, downloading the private image from the original image warehouse to the physical machine.
And if the original private image exists in the original image warehouse, downloading the private image from the original image warehouse to the physical machine. The original private image can be downloaded from the original image repository to the local physical machine by executing a command. Such as the dockerin command. Specifically, the name of the original private image is like dockertul. It should be noted that, the original private image is downloaded to the local physical machine and then cloned to the destination image repository, instead of directly cloning the original private image from the original image repository to the destination image repository, the security of the data in the image repository is considered, a large amount of data is stored in the image repository, and for security reasons, the original private image is not directly cloned from the original image repository to the destination image repository.
S107, cloning the original private image to the destination image warehouse.
The original private image on the local physical machine can be cloned into the destination image repository, for example, by executing a command. Such as a dockenkush command, to push the original private image to the destination image repository. Specifically, if the dockenp mirror name is the same, the original private mirror is pushed to the destination mirror warehouse. Therefore, the effect of cloning the original private image to the target image warehouse is achieved. It should be noted that the corresponding private image name cloned into the destination image repository is the same as the original private image name.
If the destination image repository is the image repository corresponding to the original private image, the private image is cloned to the image repository corresponding to the original private image. It can be understood that if the original private image is generated for the first time, the generated original private image is saved to the image warehouse corresponding to the original private image; if the original private image is not generated for the first time, it is understood that the original private image is updated.
If the destination image repository is not the image repository corresponding to the original private image, the original private image is cloned to other image repositories. If the original private mirror image exists on the local physical machine, the original private mirror image is directly pushed to a target mirror image warehouse from the local physical machine, if the original private mirror image does not exist on the local physical machine, the private mirror image is obtained from the original mirror image warehouse to the local physical machine, and then the private mirror image is pushed to the target mirror image warehouse from the local physical machine.
In an embodiment, after pushing the original private image to the destination image repository, the method further comprises:
s108, adding the cloned private image information into the database.
If the private mirror information is in the database, the cloned private mirror information is added in the data table corresponding to the target mirror warehouse. The information of the cloned private image includes the name of the cloned private image, cloning time, etc.
The private mirror image can be cloned to the target mirror image warehouse in the embodiment of the method. The private mirror image cloned into the destination mirror image warehouse can be directly used by a user when the application is created by using the private mirror image next time, for example, the private mirror image can be directly obtained from a corresponding destination data warehouse, and the container application corresponding to the private mirror image is created under the application environment and the area corresponding to the destination mirror image warehouse, so that the private mirror image is not required to be obtained across the mirror image warehouse, and the efficiency of creating the application by using the private mirror image is improved.
In an embodiment, after step S102, i.e. after determining a destination mirror repository according to the destination application environment and the destination area, the method further comprises: searching whether private images with the same name exist in a destination image warehouse according to the original private image name; if the private images with the same name do not exist in the destination image warehouse, executing step S103; and if the private images with the same name exist in the destination image warehouse, prompting. This embodiment further defines the case where there is and does not exist a private image of the same name as the original private image in the destination image repository. It can be understood that if the private image with the same name as the original private image exists in the destination image repository, when the original private image is cloned into the destination image repository, the original private image name is used, that is, the name of the cloned private image cloned into the destination image repository is identical to the name of the original private image because the original private image name is not modified, so that the cloned private image may cover the private image with the same name as the original private image in the destination image repository, and thus the data of the destination image repository may be destroyed. Therefore, in this embodiment, it is further defined that the original private image is cloned to the destination image repository only when the private image with the same name as the original private image does not exist in the destination image repository, so as to avoid the situation of data corruption of the destination image repository.
In an embodiment, the preset setting interface is further configured to set the cloned private image name. Correspondingly, fig. 2 is a schematic flow chart of a private mirror cloning method provided in an embodiment of the present application. The method comprises steps S201-S209.
S201, if a private image cloning instruction is received, an original private image in the cloning instruction is obtained, and a preset setting interface is called according to the cloning instruction so as to receive a target application environment, a target area and a cloned private image name which are set through the preset setting interface and need cloning.
S202, determining a destination mirror warehouse according to the destination application environment and the destination area.
S203, searching whether the private images with the same name exist in a destination image warehouse according to the cloned private image names.
If the private images with the same name do not exist in the destination image warehouse, executing step S204; and if the private images with the same name exist in the destination image warehouse, prompting.
S204, judging whether the original private mirror image exists on the physical machine generating the clone instruction.
If the original private image does not exist on the physical machine generating the clone instruction, executing step S205; if the original private image exists on the physical machine generating the clone instruction, step S208 is executed.
S205, determining an original mirror warehouse according to the information of the original private mirror.
S206, judging whether the original private image exists in the original image warehouse.
If the original private image exists in the original image warehouse, executing step S207; and if the original private mirror image does not exist in the original mirror image warehouse, prompting.
S207, downloading the original private image from the original image warehouse to the physical machine.
It should be noted that, the reason for downloading the original private image to the physical machine is that the original private image name is conveniently modified on the local physical machine, that is, the original private image name downloaded to the local physical machine is modified into the cloned private image name. Or on the other hand, if the original private image is not downloaded to the local physical machine from the original image warehouse, the original private image name is directly modified in the original image warehouse, and then the data of the original private image in the original image warehouse is destroyed; if the name of the original private image is not modified, the identification and management of the user are inconvenient, and meanwhile, if the private image with the same name as the original private image exists in the target image warehouse, the original private image is pushed into the target image warehouse, so that the data in the target image warehouse can be damaged.
S208, the name of the original private image on the physical machine is modified to be the set cloned private image name.
It will be appreciated that, for convenience of user identification and management, the original private image name is modified to be the cloned private image name during cloning. The name of the original private image may be modified, such as by a command, such as a dockertag command. Specifically, the private image name after the original private image name of the dockertag is cloned is shown.
S209, cloning the original private image to the target image warehouse.
The original private image may be cloned into the destination image repository, such as by executing a command. Such as a dockenkush command, to push the original private image to the destination image repository. Specifically, for example, a dockenpyrush { cloned private image name }, so as to achieve the effect of cloning the original private image to the destination image repository. It should be noted that, although the original private image is the original private image, the name of the original private image has been changed, and the name of the original private image has been changed to the cloned private image name, that is, the private image corresponding to the private image name cloned is pushed to the destination image repository.
In an embodiment, as shown in fig. 2, after the original private image is pushed to the destination image repository, the method further includes:
s210, adding the cloned private image information into a database.
It should be noted that, in the steps of this embodiment, the steps corresponding to those of the embodiment of fig. 1 are referred to the corresponding descriptions in the embodiment of fig. 1, and are not repeated here.
The embodiment further modifies the original private image name into the cloned private image name before cloning so as to further facilitate identification and management, and simultaneously judges whether the private image with the same name as the cloned private image exists in the destination image warehouse or not so as to further exclude the condition that the private image with the same name as the cloned private image exists in the destination image warehouse and avoid destroying the data in the destination image warehouse.
In one embodiment, after the original private image is cloned into the destination image repository, the private image cloned in the destination image repository may be edited to modify the information of the private image. Thus, as shown in FIG. 3, the private mirror cloning method includes steps S301-S313. This embodiment differs from the embodiment shown in fig. 2 in that: steps S311-S313 are added. The following details S311-S313, and the other steps S301-S310 correspond to the steps S201-S210, and refer specifically to the description of the embodiment of fig. 2.
S311, if an editing instruction is received, acquiring a private image to be edited in the editing instruction, wherein the private image to be edited comprises a cloned private image.
The editing instruction is triggered in various modes, such as touching or clicking a related button or triggering an image by a user, for example, clicking an editing button corresponding to a cloned private image (or a private image) in a private image list to trigger the editing instruction of the private image; or may receive voice edit information of the user to trigger, etc. The private image to be edited in the editing instruction comprises identification information such as the name of the private image.
S312, calling an editing interface according to the editing instruction to receive modification information of the private image to be edited, which is set through the editing interface.
The editing interface is developed by a developer, and can exist in the form of the editing interface, and the information of the private image is modified through the editing interface. Such as the name of the private image, a description of the private image, a group of images of the private image, etc. The description of the private image includes what the specific role of the private image is, including what content, etc., so as to facilitate quick understanding of the private image. The image group of private images may be understood as dividing the private images into different groups for convenience of management, and each group includes one or more private images.
S313, if an editing completion instruction is received, receiving the modification information of the private image to be edited, and updating the modification information to a database.
In this embodiment, modification of the information of the private image is achieved. Because the private mirror image cloning process is automatically completed, an editing interface is provided, so that a user can conveniently modify the information of the private mirror image, and the user experience is improved.
In an embodiment, the container application may be created using a private image cloned into the destination image repository. Thus, as shown in FIG. 4, the private mirror cloning method includes steps S401-S413. This embodiment differs from the embodiment shown in fig. 2 in that: steps S411 to S413 are added. The following details S411-S413, and the other steps S401-S410 correspond to the steps S201-S210, see in particular the description of the embodiment of fig. 2.
S411, if an application creation instruction is received, a private image in the application creation instruction is obtained, wherein the private image in the application creation instruction comprises a cloned private image.
The application creation instruction is triggered in various modes, such as touching or clicking a related button or image by a user, for example, clicking an application creation button corresponding to a cloned private image (or a private image) in a private image list to trigger the application creation instruction of the private image; the user's voice application creation information may also be received to trigger, etc. The private image in the application creation instruction includes identification information such as the name of the private image.
S412, calling a setting interface according to the application creation instruction to receive information of the container application to be created, which is set through the setting interface, wherein the mirror image of the container application in the information of the container application is a private mirror image in the application creation instruction.
The setting interface is developed by a developer, can exist in the form of an editing interface, and sets information of the container application to be created through the setting interface, wherein the mirror image of the container application in the information of the container application defaults to a private mirror image in the application creation instruction, and the setting is not needed to be reset again. The information of the set container application includes an application environment of the container application, an area of the container application, the number of container instances of the container application, and the like. The application environment of the container application, the destination application environment of the area of the container application, and the destination area are the same, and may be different in other embodiments.
S413, creating the container application according to the private image in the application creation instruction and the information of the set container application.
The information of the set container application includes an application environment of the container application, an area of the container application, the number of container instances of the container application, and the like. And the mirror information of the container application is a private mirror in the create instruction.
The embodiment further uses the cloned private image to create the container application, thereby improving the speed and efficiency of creating the container application. Because the cloned private image itself comprises some other installed components or services and the like, after the container instance of the container application is created by utilizing the cloned private image, the speed and the efficiency of the creation of the container application are further improved without reinstalling other components or services.
In an embodiment, after step S413, the method further comprises: the information of the created container application is updated to the database.
In one embodiment, as shown in FIG. 5, step S413 includes the following steps S501-S503.
S501, determining the IP of the container instance of the container application according to the application environment of the container application, the area of the container application and the number of the container instances of the container application.
Determining the IP of the container instance of the container application according to the set application environment of the container application, the region of the container application and the number of the container instances of the container application, comprising: determining the position (such as a machine room position) of the creation of the container application according to the application environment of the container application and the region of the container application; determining a pre-allocated IP address pool for creating container instances according to the determined position (such as a machine room position) of container application creation; the same number of IP addresses as the container instances of the container application are acquired from the IP address pool, and the acquired IP addresses are determined to be the IP of the container instances of the container application.
S502, determining a host for creating the container instance of the container application according to the application environment of the container application, the area of the container application, the number of container instances of the container application and the private mirror image in the application creation instruction.
Determining the creation position of the container application according to the application environment of the container application and the area of the container application; determining a host cluster from the determined location of the container application creation; and determining a specific host machine for creating the container instance of the container application from the determined host machine cluster according to the private mirror resource information. Specifically, the specific host computer cluster is automatically determined through a container arrangement tool, the host computer cluster where the container application is located is identified through the container arrangement tool according to the application environment of the container application and the area of the container application, and the container arrangement tool determines the host computer for creating the container instance of the container application from the host computer cluster according to the resource information of the private mirror image and the resource condition of the host computer cluster. The container arranging tool can be a Marathon arranging tool, and can also be other container arranging tools. Where a container instance is created on a host, it will be appreciated that a container instance corresponds to a host.
The order of step S501 and step S502 is not strictly limited, and step S502 may be performed first, and then step S501 may be performed, where steps S501 and S502 may be performed simultaneously or separately.
S503, creating a container instance of the container application on the determined host according to the private image in the application creation instruction, and setting the determined IP as the IP of the created container instance.
Specifically, step S503 includes: pushing, by a container orchestration tool, the private image onto the determined host to create a container instance for the container application on the host from the private image; if the creation of the container instance of the container application is completed, connecting the created container instance through an automated operation and maintenance tool, and binding the created container instance with the determined IP to set the determined IP as the IP of the created container instance.
Wherein the container orchestration tool may be a Marathon tool. The Marathon tool can be simply understood as a transfer station, sending the private image to the container orchestration tool, and then issuing a specific image allocation by the container orchestration tool to the determined hosts for creation of the container instance. Wherein an operation and maintenance tool such as an automated operation and maintenance tool.
In an embodiment, the set information of the container application further includes a use time of the container application, a resource group of the container application, and the like. The use time of the container application may be in units of months, or may be in units of other times. It will be appreciated that the container instance of the container application may be charged after it has been successfully created, and that the resource group of the container application may include a resource account for the cost of the use required to create the container instance of the container application. Thus, as shown in fig. 5, before determining the container instance IP of the container application and the host machine where the container instance of the container application is located, step S413 further includes the steps of:
501a, determining whether there is a sufficient amount in the resource group of the container application to use to create the container instance of the container application according to the usage time of the container instance, the resource group of the container application, and the number of container instances of the container application.
Since each container instance created is paid, calculating the amount to be paid for creating the current container application according to the number of container instances of the container application, the use time of the container instances and the cost of each container instance; judging whether the residual amount in the resource group of the container application is greater than or equal to the amount required to be paid by creating the current container application; if yes, determining that the resource group of the container application has enough amount for creating the corresponding container application; if not, it is determined that the resource group of the container application does not have a sufficient amount to create.
If the resource group of the container application is not created with enough amount, returning the reason of the creation failure. If there is a sufficient amount to create a container instance for the container application, step S501 is performed.
This embodiment further considers some practical situations of creating container applications. The process of creating the container application is automatically completed without manual intervention, so that the speed of creating the container application is improved.
In an embodiment, if the information of the set container application includes enabling monitoring information, the above process of creating the container application further involves enabling monitoring for the container instance of the created container application, and the corresponding steps further include:
pushing the enabling monitoring identification in the enabling monitoring information corresponding to the container instance to the determined host machine so as to collect the operation data information of the container instance according to the monitoring process of the host machine.
It should be noted that by default, all hosts will have a monitor process installed on them and the monitor process is enabled. The enabling monitoring identity is pushed to the determined host and the container instance is monitored by a monitoring process installed on the host. Such as the CPU, memory, etc. resources of the container instance of the container application.
It should be noted that the operation of the above method embodiment is that a user with specific rights is required to operate. In another embodiment, before step S101 (or S201 or S301 or S401), the method further comprises: acquiring the authority of a login user; judging whether the authority of the login user is the same as the preset authority; if the same is true, the step S101 (or S201 or S301 or S401) is correspondingly executed, otherwise, the presentation is performed.
Fig. 6 is a schematic block diagram of a private mirror clone device provided in an embodiment of the present application. The device comprises a unit corresponding to the private mirror cloning method. As shown in fig. 6, the private image clone apparatus 100 includes a setting unit 101, a destination warehouse determination unit 102, a physical machine judgment unit 103, an original warehouse determination unit 104, an image judgment unit 105, a download unit 106, and a clone unit 107.
The setting unit 101 is configured to, if a private image cloning instruction is received, obtain an original private image in the cloning instruction, and call a preset setting interface according to the cloning instruction, so as to receive a destination application environment and a destination area to be cloned, which are set by the preset setting interface.
And the destination warehouse determining unit 102 is used for determining a destination mirror warehouse according to the destination application environment and the destination area.
And a physical machine judging unit 103, configured to judge whether the original private image exists on the physical machine that generates the clone instruction.
And the cloning unit 107 is configured to clone the original private image to the destination image repository if the original private image exists on the physical machine that generates the cloning instruction.
And the original repository determining unit 104 is configured to determine an original image repository according to the information of the original private image if the original private image does not exist on the physical machine that generates the clone instruction.
And the image judgment unit 105 is used for judging whether the original private image exists in the original image warehouse.
And the downloading unit 106 is configured to download the original private image from the original image repository to the physical machine if the original private image exists in the original image repository.
The cloning unit 107 is further configured to clone the original private image to the destination image repository if the original private image exists on the physical machine that generates the cloning instruction.
In an embodiment, as shown in fig. 6, the private mirror cloning apparatus 100 further comprises an updating unit 108. An updating unit 108, configured to add the cloned private image information to the database.
In another embodiment, the private image cloning apparatus 100 further includes a rights acquisition unit and a rights judgment unit. The permission acquisition unit is used for acquiring the permission of the login user. And the permission judging unit is used for judging whether the permission of the login user is the same as the preset permission. If the authority of the login user is the same as the preset authority, the setting unit 101 is triggered. If the authority of the login user is different from the preset authority, prompting is carried out.
Fig. 7 is a schematic block diagram of a private mirror clone device provided in another embodiment of the present application. As shown in fig. 7, the private image clone apparatus 200 includes a setting unit 201, a destination repository determination unit 202, a name judgment unit 203, a physical machine judgment unit 204, an original repository determination unit 205, an image judgment unit 206, a download unit 207, a name modification unit 208, and a clone unit 209. The difference between this embodiment and the embodiment shown in fig. 6 is that: a name judging unit 203, a name modifying unit 208 are added. The setting unit 201, the destination warehouse determining unit 202, the physical machine judging unit 204, the original warehouse determining unit 205, the image judging unit 206, the downloading unit 207, and the cloning unit 209 in this embodiment are in one-to-one correspondence with the setting unit 101, the destination warehouse determining unit 102, the physical machine judging unit 103, the original warehouse determining unit 104, the image judging unit 105, the downloading unit 106, and the cloning unit 107 in the embodiment of fig. 6, and will not be described again. The differences between this embodiment and the embodiment shown in fig. 6 will be described below.
And the name judging unit 203 is configured to search whether the private images with the same name exist in the destination image repository according to the cloned private image names. If there is no private image with the same name in the destination image repository, the physical machine judging unit 204 is triggered.
And a name modifying unit 208, configured to modify the name of the original private image on the physical machine to the set cloned private image name. The cloning unit 209 is then triggered.
In an embodiment, as shown in fig. 7, the private mirror cloning apparatus 200 further includes an updating unit 210. An updating unit 210, configured to add the information of the cloned private image to the database.
Fig. 8 is a schematic block diagram of a private mirror clone device provided in another embodiment of the present application. As shown in fig. 8, the private image clone apparatus 300 includes a setting unit 301, a destination repository determination unit 302, a name judgment unit 303, a physical machine judgment unit 304, an original repository determination unit 305, an image judgment unit 306, a download unit 307, a name modification unit 308, a clone unit 309, an update unit 310, an edit acquisition unit 311, and an edit unit 312. This embodiment differs from the embodiment shown in fig. 7 in that: an edit acquiring unit 311, an editing unit 312 are added. The other units are in one-to-one correspondence with the units in the embodiment of fig. 7, and detailed description of the embodiment of fig. 7 is omitted herein. The differences between this embodiment and the embodiment of fig. 7 will be described below.
The editing obtaining unit 311 is configured to obtain a private image to be edited in an editing instruction if the editing instruction is received, where the private image to be edited includes a cloned private image.
And an editing unit 312, configured to call an editing interface according to the editing instruction, so as to receive modification information of the private image to be edited, which is set through the editing interface.
The updating unit 310 is further configured to receive modification information of the private image to be edited if an editing completion instruction is received, and update the modification information to a database.
Fig. 9 is a schematic block diagram of a private mirror clone device provided in another embodiment of the present application. As shown in fig. 9, the private image clone apparatus 400 includes a setting unit 401, a destination repository determination unit 402, a name judgment unit 403, a physical machine judgment unit 404, an original repository determination unit 405, an image judgment unit 406, a download unit 407, a name modification unit 408, a clone unit 409, an update unit 410, a creation acquisition unit 411, and a creation unit 412. This embodiment differs from the embodiment shown in fig. 7 in that: a creation acquisition unit 411, a creation unit 412 are added. The other units are in one-to-one correspondence with the units in the embodiment of fig. 7, and detailed description of the embodiment of fig. 7 is omitted herein. The differences between this embodiment and the embodiment of fig. 7 will be described below.
The creation obtaining unit 411 is configured to obtain a private image in an application creation instruction if an application creation instruction is received, where the private image in the application creation instruction includes a cloned private image.
The creation obtaining unit 411 is further configured to call a setting interface according to the application creation instruction, so as to receive information of a container application to be created, where the image of the container application in the information of the container application is a private image in the application creation instruction.
A creating unit 412, configured to create a container application according to the private image in the application creation instruction and the information of the set container application.
In an embodiment, the updating unit 410 is further configured to update the information of the created container application to the database.
In an embodiment, the set mirror information of the container application includes an application environment of the container application, an area of the container application, and a number of container instances of the container application. As shown in fig. 10, the creation unit 412 includes an IP determination unit 4121, a host determination unit 4122, and a container creation unit 4123.
An IP determining unit 4121 for determining the IP of the container instance of the container application according to the application environment of the container application, the area of the container application, and the number of container instances of the container application.
The host determining unit 4122 is configured to determine a host that creates a container instance of the container application according to the application environment of the container application, the area of the container application, the number of container instances of the container application, and the private mirror image in the application creation instruction.
The container creation unit 4123 creates a container instance of the container application on the determined host according to the private image in the application creation instruction, and sets the determined IP as the IP of the created container instance.
In an embodiment, the set information of the container application further includes a use time of the container application, a resource group of the container application, and the like. The creation unit 412 further includes an amount judgment unit 4121a. Wherein the amount determining unit 4121a is configured to determine whether there is a sufficient amount of money in the resource group of the container application to create the container instance of the container application according to the use time of the container instance, the resource group of the container application, and the number of container instances of the container application.
If the resource group of the container application is not created with enough amount, returning the reason of the creation failure. If there is a sufficient amount to create a container instance for the container application, the IP determination unit 4121 is triggered.
In an embodiment, the information of the set container application further includes enabling monitoring information, and the creating unit 412 further includes a monitoring enabling unit. The monitoring enabling unit is used for pushing enabling monitoring identification in enabling monitoring information corresponding to the container instance to the determined host machine so as to collect operation data information of the container instance according to a monitoring process of the host machine. Such as the CPU, memory, etc. of the container instance of the monitoring container application.
It should be noted that, as those skilled in the art can clearly understand the specific implementation process of the foregoing apparatus and each unit, reference may be made to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The above-described apparatus may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 11.
Fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present application. The device is a terminal and other devices, such as a server in a PaaS platform. The device 100 comprises a processor 102, a memory and a network interface 103 connected by a system bus 101, wherein the memory may comprise a non-volatile storage medium 104 and an internal memory 105.
The non-volatile storage medium 104 may store an operating system 1041 and computer programs 1042. The computer program 1042 stored in the nonvolatile storage medium, when executed by the processor 102, can implement the private image cloning method described in the server. The processor 102 is used to provide computing and control capabilities to support the operation of the overall device 100. The internal memory 105 provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by the processor 102, causes the processor 102 to perform the private mirror cloning method described in the server above. The network interface 103 is used for network communication. It will be appreciated by persons skilled in the art that the structures shown in the figures are block diagrams of only some of the structures associated with the aspects of the present application and do not constitute limitations on the apparatus to which the aspects of the present application may be applied, and that a particular apparatus may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
Wherein the processor 102 is configured to execute a computer program stored in a memory to implement any of the embodiments of the private mirror cloning method described above.
It should be appreciated that in embodiments of the present application, the processor 102 may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (application lication Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program may be stored in a storage medium, which may be a computer readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium including a non-volatile computer-readable storage medium. The storage medium stores a computer program which, when executed by a processor, implements any of the embodiments of the private mirror cloning method described above.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus, device, and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and the division of the units is merely a logical function division, and other divisions may be implemented in practice. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (7)

1. A private mirror cloning method, the method comprising:
if a private image cloning instruction is received, acquiring an original private image in the cloning instruction, and calling a preset setting interface according to the cloning instruction so as to receive a target application environment and a target area which are set by the preset setting interface and need cloning;
determining a destination mirror warehouse according to the destination application environment and the destination area;
searching whether private images with the same name exist in a destination image warehouse according to the original private image name;
if the private images with the same name do not exist in the target image warehouse, judging whether the original private images exist on the physical machine generating the clone instruction;
if the original private mirror image exists on the physical machine generating the cloning instruction, cloning the original private mirror image to the target mirror image warehouse;
if the original private image does not exist on the physical machine generating the clone instruction, determining an original image warehouse according to the information of the original private image;
judging whether the original private image exists in the original image warehouse;
if the original private image exists in the original image warehouse, downloading the original private image from the original image warehouse to the physical machine, and executing the step of cloning the original private image to the target image warehouse;
The preset setting interface is also used for setting the private image name after the original private image cloning;
after the destination mirror repository is determined according to the destination application environment and the destination area, the method further includes:
searching whether private images with the same name exist in a destination image warehouse according to the cloned private image names; if the private images with the same name do not exist in the target image warehouse, executing the step of judging whether the original private images exist on the physical machine generating the clone instruction;
before said cloning said original private image to said destination image repository, said method further comprises:
and modifying the name of the original private image on the physical machine into the set cloned private image name.
2. The method according to claim 1, wherein the method further comprises:
and adding the cloned private image information into the database.
3. The method according to claim 2, wherein the method further comprises:
if an editing instruction is received, acquiring a private image to be edited in the editing instruction, wherein the private image to be edited comprises a cloned private image;
Invoking an editing interface according to the editing instruction to receive modification information of the private image to be edited, which is set through the editing interface;
and if an editing completion instruction is received, receiving the modification information of the private image to be edited, and updating the modification information to a database.
4. A method according to claim 3, characterized in that the method further comprises:
if an application creation instruction is received, acquiring a private image in the application creation instruction, wherein the private image in the application creation instruction comprises a cloned private image;
calling a setting interface according to the application creation instruction to receive information of a container application to be created, which is set through the setting interface, wherein a mirror image of the container application in the information of the container application is a private mirror image in the application creation instruction;
and creating the container application according to the private image in the application creation instruction and the information of the set container application.
5. A private image clone apparatus, characterized in that the private image clone apparatus comprises:
the setting unit is used for acquiring an original private image in the cloning instruction if the private image cloning instruction is received, and calling a preset setting interface according to the cloning instruction so as to receive a target application environment and a target area which are set by the preset setting interface and need cloning;
The destination warehouse determining unit is used for determining a destination mirror warehouse according to the destination application environment and the destination area;
the name judging unit is used for searching whether the private images with the same name exist in the destination image warehouse according to the original private image name;
the physical machine judging unit is used for judging whether the original private image exists on the physical machine generating the clone instruction if the private images with the same name do not exist in the target image warehouse;
the cloning unit is used for cloning the original private mirror image to the target mirror image warehouse if the original private mirror image exists on the physical machine generating the cloning instruction;
the original warehouse determining unit is used for determining an original mirror image warehouse according to the information of the original private mirror image if the original private mirror image does not exist on the physical machine generating the cloning instruction;
the image judging unit is used for judging whether the original private image exists in the original image warehouse;
the downloading unit is used for downloading the original private image from the original image warehouse to the physical machine if the original private image exists in the original image warehouse, and executing the step of cloning the original private image to the target image warehouse;
The preset setting interface is also used for setting the private image name after the original private image cloning;
after the destination warehouse determination unit, the apparatus further comprises:
the name judging unit is used for searching whether the private images with the same name exist in the destination image warehouse according to the cloned private image names; if the private images with the same name do not exist in the target image warehouse, executing the step of judging whether the original private images exist on the physical machine generating the clone instruction;
the apparatus further comprises, prior to the cloning unit:
and the name modifying unit is used for modifying the name of the original private image on the physical machine into the set cloned private image name.
6. A computer device comprising a memory, and a processor coupled to the memory;
the memory is used for storing a computer program; the processor is configured to execute a computer program stored in the memory to perform the method of any one of claims 1-4.
7. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-4.
CN201910410585.7A 2019-05-17 2019-05-17 Private image cloning method, private image cloning device, computer equipment and storage medium Active CN110275717B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910410585.7A CN110275717B (en) 2019-05-17 2019-05-17 Private image cloning method, private image cloning device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910410585.7A CN110275717B (en) 2019-05-17 2019-05-17 Private image cloning method, private image cloning device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110275717A CN110275717A (en) 2019-09-24
CN110275717B true CN110275717B (en) 2024-03-22

Family

ID=67959720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910410585.7A Active CN110275717B (en) 2019-05-17 2019-05-17 Private image cloning method, private image cloning device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110275717B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835609B (en) * 2019-11-22 2024-04-05 北京沃东天骏信息技术有限公司 Method and device for modifying download address of dependent packet
CN113296873A (en) * 2020-05-15 2021-08-24 阿里巴巴集团控股有限公司 Mirror image construction method and device, terminal equipment and computer storage medium
CN112764881B (en) * 2021-01-19 2024-04-05 深圳软通动力信息技术有限公司 Method, system, computer device and storage medium for pipeline deployment mirroring

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103795759A (en) * 2012-10-31 2014-05-14 北京搜狐新媒体信息技术有限公司 Method and system for scheduling virtual machine mirror image file
CN105260231A (en) * 2015-11-03 2016-01-20 国云科技股份有限公司 Method of reducing physical disk I/O reading and writing
CN105718570A (en) * 2016-01-20 2016-06-29 北京京东尚科信息技术有限公司 Data migration method and device used for database
CN106445563A (en) * 2016-11-24 2017-02-22 合肥中科云巢科技有限公司 Operation system mirror image manufacturing method and device
CN107291525A (en) * 2016-04-01 2017-10-24 华为技术有限公司 A kind of method, host and system for disposing virtual machine
CN107357691A (en) * 2016-05-09 2017-11-17 中兴通讯股份有限公司 The processing method and processing device of image file
CN108205481A (en) * 2016-12-19 2018-06-26 华为技术有限公司 The container instance creation method and device of application
CN109634621A (en) * 2018-11-30 2019-04-16 武汉烽火信息集成技术有限公司 Openstack Platform deployment method, storage medium, electronic equipment and system
CN109688232A (en) * 2019-01-28 2019-04-26 杭州涂鸦信息技术有限公司 A kind of mirror image retrogressive method, mirror image backtracking system and proxy server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8970569B2 (en) * 2005-03-01 2015-03-03 Eyesmatch Ltd Devices, systems and methods of virtualizing a mirror

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103795759A (en) * 2012-10-31 2014-05-14 北京搜狐新媒体信息技术有限公司 Method and system for scheduling virtual machine mirror image file
CN105260231A (en) * 2015-11-03 2016-01-20 国云科技股份有限公司 Method of reducing physical disk I/O reading and writing
CN105718570A (en) * 2016-01-20 2016-06-29 北京京东尚科信息技术有限公司 Data migration method and device used for database
CN107291525A (en) * 2016-04-01 2017-10-24 华为技术有限公司 A kind of method, host and system for disposing virtual machine
CN107357691A (en) * 2016-05-09 2017-11-17 中兴通讯股份有限公司 The processing method and processing device of image file
CN106445563A (en) * 2016-11-24 2017-02-22 合肥中科云巢科技有限公司 Operation system mirror image manufacturing method and device
CN108205481A (en) * 2016-12-19 2018-06-26 华为技术有限公司 The container instance creation method and device of application
CN109634621A (en) * 2018-11-30 2019-04-16 武汉烽火信息集成技术有限公司 Openstack Platform deployment method, storage medium, electronic equipment and system
CN109688232A (en) * 2019-01-28 2019-04-26 杭州涂鸦信息技术有限公司 A kind of mirror image retrogressive method, mirror image backtracking system and proxy server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"浅谈使用Docker 搭建本地私有仓库";欧阳桂秀;《福建电脑》(第10期);156-157 *

Also Published As

Publication number Publication date
CN110275717A (en) 2019-09-24

Similar Documents

Publication Publication Date Title
CN110275717B (en) Private image cloning method, private image cloning device, computer equipment and storage medium
CN106708557B (en) Update processing method and device for terminal application
CN110289982B (en) Container application capacity expansion method and device, computer equipment and storage medium
CN108572795B (en) Capacity expansion method, device, equipment and storage medium based on built storage virtualization
US10129264B2 (en) Method and apparatus for implementing document sharing between user groups
US10474977B2 (en) Cognitive learning workflow execution
CN110262873B (en) Configuration modification method and device for container application, computer equipment and storage medium
US10984360B2 (en) Cognitive learning workflow execution
CN110262872B (en) Load balancing application management method and device, computer equipment and storage medium
CN110289983B (en) Load balancing application creation method and device, computer equipment and storage medium
US10719365B2 (en) Cognitive learning workflow execution
CN110297808B (en) File modification method and device for container application, computer equipment and storage medium
US10719795B2 (en) Cognitive learning workflow execution
US10204021B2 (en) Recovery of an infected and quarantined file in a primary storage controller from a secondary storage controller
WO2014190836A1 (en) Upgrade method and device for over-the-air technology
CN110138577B (en) Cluster creation method, first server and readable storage medium
CN105867962A (en) System upgrading method and device
CN109286517B (en) Method, device and storage medium for creating service and electronic equipment
CN111708557A (en) Method, device and storage medium for updating configuration file
CN114629921A (en) Cloud platform and bucket management method of object storage service provided by cloud platform
US20240086173A1 (en) Distributed autonomous patching system
CN113094771B (en) Method, device and storage medium for matching application program to design object
CN110262871B (en) Container instance start-stop method and device for container application, computer equipment and storage medium
US11614954B2 (en) Graphical user interface to specify an intent-based data management plan
CN110290172B (en) Container application cloning method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant