CN112231055A - Mirror image management method and device - Google Patents

Mirror image management method and device Download PDF

Info

Publication number
CN112231055A
CN112231055A CN202011079928.5A CN202011079928A CN112231055A CN 112231055 A CN112231055 A CN 112231055A CN 202011079928 A CN202011079928 A CN 202011079928A CN 112231055 A CN112231055 A CN 112231055A
Authority
CN
China
Prior art keywords
image
added
mirror
mirror image
repository
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.)
Withdrawn
Application number
CN202011079928.5A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011079928.5A priority Critical patent/CN112231055A/en
Publication of CN112231055A publication Critical patent/CN112231055A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The invention discloses a mirror image management method and a device, wherein the method comprises the following steps: extracting the position of the added mirror image from the mirror image adding request; pulling the added mirror image from the position by using a container service engine, setting a label for the added mirror image and pushing the label to a mirror image warehouse; the metadata and tags of the added image are stored to a database and the added image is marked in the database as available. The invention can effectively manage the mirror image of the virtual machine container and improve the usability and the usability of the container.

Description

Mirror image management method and device
Technical Field
The present invention relates to the field of containers, and more particularly, to a method and an apparatus for managing images.
Background
With the rapid development of the Docker service (application container engine) technology, the application of Docker is more and more extensive. In order to meet the diversified requirements of different Dockers on the operating environment, different types of Docker images need to be deployed for the reasoning platform, and the installation of an operating system or application on a virtual machine through an image file is the basis for realizing the application of virtualized resources.
In the prior art, when a virtual machine needs a certain mirror image, the mirror image is uploaded to the same node as the virtual machine; the need to view the owned image through the command line is difficult to manage effectively and lacks the intuitive effect of visualization.
Aiming at the problem that the mirror image of a virtual machine container in the prior art is difficult to effectively manage, no effective solution is available at present.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method and an apparatus for managing an image, which can effectively manage an image of a virtual machine container, and improve availability and usability of the container.
In view of the above object, a first aspect of embodiments of the present invention provides an image management method, including performing, in response to receiving an add image request from a client, the following steps:
extracting the position of the added mirror image from the mirror image adding request;
pulling the added mirror image from the position by using a container service engine, setting a label for the added mirror image and pushing the label to a mirror image warehouse;
the metadata and tags of the added image are stored to a database and the added image is marked in the database as available.
In some embodiments, the location is at a container terminal station; pulling the added image from the location using the container service engine comprises:
extracting a connection identifier of the container hub station;
connecting to the container hub station based on the connection identification to pull the added mirror image.
In some embodiments, the location is at a client; pulling the added image from the location using the container service engine comprises:
receiving the encapsulation packet added with the mirror image from the client;
the encapsulation package is parsed to extract the added image therefrom.
In some embodiments, pushing the added image to the image repository includes:
constructing a working environment of the mirror image warehouse, and logging in the mirror image warehouse based on the working environment;
determining whether an item to which the added image belongs already exists in the image repository;
uploading the added image under the item to the image repository in response to the item already existing in the image repository;
an item is created in response to the item not existing in the mirror repository, and the added mirror is uploaded under the item of the mirror repository.
In some embodiments, further comprising: the deleted image is marked as unavailable in the database in response to receiving a delete image request from the client.
In some embodiments, further comprising: the data from which the image was deleted is further deleted from the image repository.
In some embodiments, further comprising: and in response to receiving a query mirror request from the client, retrieving the metadata and the tags based on the query condition selected by the client, and feeding back the retrieval result to the client to be visually shown.
A second aspect of an embodiment of the present invention provides an image management apparatus, including:
a processor; and
a memory storing program code executable by the processor, the program code when executed performing the following in response to receiving an add image request from a client:
extracting the position of the added mirror image from the mirror image adding request;
pulling the added mirror image from the position by using a container service engine, setting a label for the added mirror image and pushing the label to a mirror image warehouse;
the metadata and tags of the added image are stored to a database and the added image is marked in the database as available.
In some embodiments, the location is at a container hub station or client;
pulling the added image from the container hub station using the container service engine comprises: extracting a connection identifier of the container hub station; connecting to a container hub station to pull the added mirror based on the connection identification;
pulling the added image from the client using the container service engine comprises: receiving the encapsulation packet added with the mirror image from the client; the encapsulation package is parsed to extract the added image therefrom.
In some embodiments, pushing the added image to the image repository includes:
constructing a working environment of the mirror image warehouse, and logging in the mirror image warehouse based on the working environment;
determining whether an item to which the added image belongs already exists in the image repository;
uploading the added image under the item to the image repository in response to the item already existing in the image repository;
an item is created in response to the item not existing in the mirror repository, and the added mirror is uploaded under the item of the mirror repository.
The invention has the following beneficial technical effects: according to the mirror image management method and device provided by the embodiment of the invention, the position of the added mirror image is extracted from the mirror image adding request; pulling the added mirror image from the position by using a container service engine, setting a label for the added mirror image and pushing the label to a mirror image warehouse; the metadata and the label of the added mirror image are stored in the database, and the available technical scheme of the added mirror image is marked in the database, so that the mirror image of the virtual machine container can be effectively managed, and the availability and the usability of the container are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a mirror management method according to the present invention;
FIG. 2 is a diagram illustrating an overall structure of a mirror management method according to the present invention;
FIG. 3 is a flow chart of the mirror image pulling from the container hub station according to the mirror image management method provided by the present invention;
FIG. 4 is a flowchart of the mirror image management method pulling the mirror image from the client;
fig. 5 is a flowchart of pushing an image to an image repository according to the image management method provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the foregoing, a first aspect of the embodiments of the present invention provides an embodiment of an image management method for effectively managing a virtual machine container. Fig. 1 is a flowchart illustrating a mirror management method according to the present invention.
The image management method, as shown in fig. 1, includes the following steps performed in response to receiving an add image request from a client:
step S101: extracting the position of the added mirror image from the mirror image adding request;
step S103: pulling the added mirror image from the position by using a container service engine, setting a label for the added mirror image and pushing the label to a mirror image warehouse;
step S105: the metadata and tags of the added image are stored to a database and the added image is marked in the database as available.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program to instruct relevant hardware to perform the processes, and the processes can be stored in a computer readable storage medium, and when executed, the processes can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like. Embodiments of the computer program may achieve the same or similar effects as any of the preceding method embodiments to which it corresponds.
In some embodiments, the location is at a container terminal station; pulling the added image from the location using the container service engine comprises:
extracting a connection identifier of the container hub station;
connecting to the container hub station based on the connection identification to pull the added mirror image.
In some embodiments, the location is at a client; pulling the added image from the location using the container service engine comprises:
receiving the encapsulation packet added with the mirror image from the client;
the encapsulation package is parsed to extract the added image therefrom.
In some embodiments, pushing the added image to the image repository includes:
constructing a working environment of the mirror image warehouse, and logging in the mirror image warehouse based on the working environment;
determining whether an item to which the added image belongs already exists in the image repository;
uploading the added image under the item to the image repository in response to the item already existing in the image repository;
an item is created in response to the item not existing in the mirror repository, and the added mirror is uploaded under the item of the mirror repository.
In some embodiments, further comprising: the deleted image is marked as unavailable in the database in response to receiving a delete image request from the client.
In some embodiments, further comprising: the data from which the image was deleted is further deleted from the image repository.
In some embodiments, further comprising: and in response to receiving a query mirror request from the client, retrieving the metadata and the tags based on the query condition selected by the client, and feeding back the retrieval result to the client to be visually shown.
The following further illustrates embodiments of the invention in accordance with the specific example shown in fig. 2.
As shown in fig. 2, the overall framework of mirror image management is that a client may perform operations related to adding, deleting, and querying a mirror image, and a mirror image management server may respond to the corresponding operations, and when the client sends a request for adding a mirror image, the mirror image management may operate a connection docker service (container service engine) and a Harbor warehouse (mirror warehouse), and update the contents of the database; and the request for deleting and inquiring the mirror image performs relative operation on the database, and a corresponding response is made to the client after the request is completed.
Mirror images are added by dockerhub (container terminal) see fig. 3. Downloading the mirror image through a dockerhub website and uploading the mirror image to a harbor warehouse, connecting a mirror image management server to docker service after clicking to add the mirror image through the dockerhub, logging in through the input dockerhub account and the password, and inputting the mirror image to be downloaded and the name to be stored; and the server side pulls the mirror image, marks the mirror image and uploads the mirror image to the mirror image warehouse.
The flow of uploading the image to the harbor repository via a local upload tar package (a compressed encapsulation) is shown in figure 4. After the mirror image is uploaded through the local uploading tar packet, the mirror image management server is connected with the docker service, analyzes the uploaded tar packet file data, acquires the mirror image, marks the mirror image, and uploads the mirror image to the hardor warehouse.
The images uploaded by the dockerhub and tar packets are finally uploaded to a hardor warehouse for unified management, and the specific process of uploading to the hardor is shown in fig. 5: after a server builds a harbor environment, the mirror image uploaded to the harbor can be visually managed; in the uploading process, firstly logging in a harhor, judging whether an item to which an uploading mirror image belongs exists or not, if not, creating the item, and then uploading the mirror image to a harbor warehouse; and after the user logs in through inputting the address of the hardor warehouse at the page end, the uploaded mirror image can be managed.
In addition, when a certain mirror image is determined not to be needed, the mirror image can be deleted through a delete button; in order to facilitate the data recovery, the invention adopts a soft deletion measure, namely the mirror image in the hardor warehouse is not deleted, and the mirror image in the database is placed in an unavailable state.
The mirror images under a plurality of scenes may exist at the same time, a user can query the required mirror images according to conditions such as mirror image types, mirror image names, labels and the like, and the mirror image management server screens relative data in the database according to query conditions selected by the user at the client and feeds the data back to the client for display.
As can be seen from the foregoing embodiments, in the mirror management method provided in the embodiments of the present invention, the position of the added mirror is extracted from the mirror adding request; pulling the added mirror image from the position by using a container service engine, setting a label for the added mirror image and pushing the label to a mirror image warehouse; the metadata and the label of the added mirror image are stored in the database, and the available technical scheme of the added mirror image is marked in the database, so that the mirror image of the virtual machine container can be effectively managed, and the availability and the usability of the container are improved.
It should be particularly noted that, the steps in the embodiments of the mirror image management method can be mutually intersected, replaced, added, or deleted, so that these reasonable permutation and combination transformations should also belong to the scope of the present invention for the mirror image management method, and should not limit the scope of the present invention to the described embodiments.
In view of the foregoing, according to a second aspect of the embodiments of the present invention, an embodiment of an image management apparatus for efficiently managing a virtual machine container is provided. The image management apparatus includes:
a processor; and
a memory storing program code executable by the processor, the program code when executed performing the following in response to receiving an add image request from a client:
extracting the position of the added mirror image from the mirror image adding request;
pulling the added mirror image from the position by using a container service engine, setting a label for the added mirror image and pushing the label to a mirror image warehouse;
the metadata and tags of the added image are stored to a database and the added image is marked in the database as available.
In some embodiments, the location is at a container hub station or client;
pulling the added image from the container hub station using the container service engine comprises: extracting a connection identifier of the container hub station; connecting to a container hub station to pull the added mirror based on the connection identification;
pulling the added image from the client using the container service engine comprises: receiving the encapsulation packet added with the mirror image from the client; the encapsulation package is parsed to extract the added image therefrom.
In some embodiments, pushing the added image to the image repository includes:
constructing a working environment of the mirror image warehouse, and logging in the mirror image warehouse based on the working environment;
determining whether an item to which the added image belongs already exists in the image repository;
uploading the added image under the item to the image repository in response to the item already existing in the image repository;
an item is created in response to the item not existing in the mirror repository, and the added mirror is uploaded under the item of the mirror repository.
As can be seen from the foregoing embodiments, the image management apparatus provided in the embodiments of the present invention extracts the position of the added image from the image adding request; pulling the added mirror image from the position by using a container service engine, setting a label for the added mirror image and pushing the label to a mirror image warehouse; the metadata and the label of the added mirror image are stored in the database, and the available technical scheme of the added mirror image is marked in the database, so that the mirror image of the virtual machine container can be effectively managed, and the availability and the usability of the container are improved.
It should be particularly noted that, the embodiment of the image management apparatus described above employs the embodiment of the image management method to specifically describe the working process of each module, and those skilled in the art can easily think that these modules are applied to other embodiments of the image management method. Of course, since the steps in the embodiment of the image management method may be intersected, replaced, added, or deleted, these reasonable permutations and combinations should also belong to the scope of the present invention, and should not limit the scope of the present invention to the embodiment.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of an embodiment of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. An image management method comprising, in response to receiving an add image request from a client, performing the steps of:
extracting the position of the added mirror image from the mirror image adding request;
using a container service engine to pull the added mirror from the position, setting a label for the added mirror and pushing the mirror to a mirror warehouse;
storing the metadata and the tag of the added image to a database and marking the added image as available in the database.
2. The method of claim 1, wherein the location is at a container terminal station; pulling the added image from the location using a container service engine comprises:
extracting a connection identifier of the container terminal;
connecting to the container hub station to pull the added mirror image based on the connection identification.
3. The method of claim 1, wherein the location is at a client; pulling the added image from the location using a container service engine comprises:
receiving the encapsulation packet added with the mirror image from a client;
parsing the encapsulation packet to extract the added mirror therefrom.
4. The method of claim 1, wherein pushing the added image to an image repository comprises:
building a working environment of the mirror image warehouse, and logging in the mirror image warehouse based on the working environment;
determining whether an item to which the added image belongs already exists in the image repository;
uploading the added image under the item of the image repository in response to the item already existing in the image repository;
creating the item in response to the item not being present in the mirror repository and uploading the added mirror under the item of the mirror repository.
5. The method of claim 1, further comprising: marking the deleted image as unavailable in the database in response to receiving a delete image request from a client.
6. The method of claim 5, further comprising: further deleting the data of the deleted image from the image repository.
7. The method of claim 1, further comprising: and in response to receiving a query mirror request from the client, retrieving the metadata and the tags based on the query condition selected by the client, and feeding back the retrieval result to the client to be visually shown.
8. An image management apparatus, comprising:
a processor; and
a memory storing program code executable by the processor, the program code when executed performing the following in response to receiving an add image request from a client:
extracting the position of the added mirror image from the mirror image adding request;
using a container service engine to pull the added mirror from the position, setting a label for the added mirror and pushing the mirror to a mirror warehouse;
storing the metadata and the tag of the added image to a database and marking the added image as available in the database.
9. The apparatus of claim 8, wherein the location is at a container terminal or client;
pulling the added image from the container hub station using a container services engine comprising: extracting a connection identifier of the container terminal; connecting to the container hub station to pull the added mirror image based on the connection identification;
pulling the added image from the client using a container service engine comprises: receiving the encapsulation packet added with the mirror image from a client; parsing the encapsulation packet to extract the added mirror therefrom.
10. The apparatus of claim 8, wherein pushing the added image to an image repository comprises:
building a working environment of the mirror image warehouse, and logging in the mirror image warehouse based on the working environment;
determining whether an item to which the added image belongs already exists in the image repository;
uploading the added image under the item of the image repository in response to the item already existing in the image repository;
creating the item in response to the item not being present in the mirror repository and uploading the added mirror under the item of the mirror repository.
CN202011079928.5A 2020-10-10 2020-10-10 Mirror image management method and device Withdrawn CN112231055A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011079928.5A CN112231055A (en) 2020-10-10 2020-10-10 Mirror image management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011079928.5A CN112231055A (en) 2020-10-10 2020-10-10 Mirror image management method and device

Publications (1)

Publication Number Publication Date
CN112231055A true CN112231055A (en) 2021-01-15

Family

ID=74111999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011079928.5A Withdrawn CN112231055A (en) 2020-10-10 2020-10-10 Mirror image management method and device

Country Status (1)

Country Link
CN (1) CN112231055A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988462A (en) * 2021-02-08 2021-06-18 同盾科技有限公司 Container mirror image center and container mirror image center operation method
CN113112023A (en) * 2021-06-15 2021-07-13 苏州浪潮智能科技有限公司 Inference service management method, device, system and medium of inference platform
CN114115812A (en) * 2022-01-28 2022-03-01 南京安元科技有限公司 Cross-version application distribution method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988462A (en) * 2021-02-08 2021-06-18 同盾科技有限公司 Container mirror image center and container mirror image center operation method
CN113112023A (en) * 2021-06-15 2021-07-13 苏州浪潮智能科技有限公司 Inference service management method, device, system and medium of inference platform
CN113112023B (en) * 2021-06-15 2021-08-31 苏州浪潮智能科技有限公司 Inference service management method and device of AIStation inference platform
CN114115812A (en) * 2022-01-28 2022-03-01 南京安元科技有限公司 Cross-version application distribution method
CN114115812B (en) * 2022-01-28 2022-03-29 南京安元科技有限公司 Cross-version application distribution method

Similar Documents

Publication Publication Date Title
CN112231055A (en) Mirror image management method and device
US10938634B1 (en) System and method for centralized analytics for edge devices with enrichment pushdown
CN111416736B (en) Configuration management method and device of network equipment, computing equipment and storage medium
CN101098248B (en) Method and system for implementing universal network management based on configuration describing document
KR100453824B1 (en) XML based network management system and method for configuration management of heterogeneous network devices
CN101123568B (en) An instant communication system and transmission method of self-defined information
WO2006003256A1 (en) Device management system
US20170270157A1 (en) TCP/IP Network Automation and Orchestration Tools
CN109391673A (en) A kind of method, system and the terminal device of management update file
CN101854343A (en) Method for providing node information, and method and device for acquiring node information
CN102520994A (en) Method and system for steaming loading virtual files
CN111352676B (en) Help information pushing method, help system and readable storage medium
CN101170540A (en) A XML document management method, client and server
CN107968798A (en) A kind of network management resources label acquisition method, cache synchronization method, apparatus and system
CN101344886A (en) Apparatus, method and system for providing content of media server
CN116048517A (en) API (application program interface) generating method, system and device based on B/S (browser/Server) architecture application system
CN110928547A (en) Public file extraction method, device, terminal and storage medium
US20050028079A1 (en) Image distribution in data processing systems
CN112000618B (en) File change management method, device, equipment and storage medium for cluster nodes
CN102387026B (en) Management method and device for user data in system based on universal relation link model
CN112650712A (en) Document resource integration method and device, storage medium and electronic device
CN109634931B (en) Log uploading method and device
CN102385514A (en) Method, equipment and system for conducting management operation on software in centralized way
CN101610176B (en) Configuration information management method, alarm management method and alarm management system of purchased parts
US8762837B1 (en) System and methodology for the storage and manipulation of documents

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20210115

WW01 Invention patent application withdrawn after publication