CN112084165A - Method and device for managing mirror image warehouse, electronic equipment and readable storage medium - Google Patents

Method and device for managing mirror image warehouse, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112084165A
CN112084165A CN201910507414.6A CN201910507414A CN112084165A CN 112084165 A CN112084165 A CN 112084165A CN 201910507414 A CN201910507414 A CN 201910507414A CN 112084165 A CN112084165 A CN 112084165A
Authority
CN
China
Prior art keywords
mirror
layer
mirror image
uploading
image layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910507414.6A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910507414.6A priority Critical patent/CN112084165A/en
Priority to PCT/CN2020/095522 priority patent/WO2020249036A1/en
Publication of CN112084165A publication Critical patent/CN112084165A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/273Asynchronous replication or reconciliation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for managing a mirror image warehouse, an electronic device and a readable storage medium, wherein the method for managing the mirror image warehouse comprises the following steps: receiving one or more upload mirror layers; storing the uploading mirror layer in the mirror repository in a first storage mode; determining a mirror image layer to be cleaned in one or more original mirror image layers stored in the mirror image warehouse in a second storage mode, wherein the first storage mode is different from the second storage mode; and cleaning the mirror image layer to be cleaned. According to the technical scheme, the newly uploaded mirror image layer and the original mirror image layer are stored in the mirror image warehouse in the first storage mode and the second storage mode respectively, so that the mirror image layer in mirror image uploading operation is separated from the mirror image layer in garbage cleaning operation, garbage cleaning can be executed while the mirror image uploading operation is carried out, concurrency problems are avoided, and the garbage cleaning problem of the mirror image warehouse is solved under the condition that other databases or middleware are not introduced.

Description

Method and device for managing mirror image warehouse, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of computer application technologies, and in particular, to a method and an apparatus for managing a mirror repository, an electronic device, and a readable storage medium.
Background
In the Docker system, images (images) are stored through an image repository, and a client may download images from the image repository or upload images to the image repository. Registry is an open source Docker mirror storage and management center. When the client performs the Docker instantiation operation, the client can download the required images from the image warehouse and store the images locally. Correspondingly, when the mirror image is modified at the client side and a new mirror image is obtained, the new mirror image can be uploaded to the mirror image warehouse. A mirror may include multiple mirror layers with dependencies between adjacent mirror layers. The Docker system uses mirror element information to describe dependencies between mirror layers.
In the process of the invention, the inventor finds that the existing mirror image warehouse service has difficulty in cleaning the garbage mirror image layer, mainly because the existing garbage cleaning scheme needs to put the whole service into a read-only state, and during the period, all the mirror image uploading operation is prevented. However, in an actual use environment, the system cannot be left in a read-only state for a long time, and therefore, the existing garbage disposal scheme cannot meet the actual requirement.
Disclosure of Invention
In order to solve the problems in the related art, embodiments of the present disclosure provide a method and apparatus for managing a mirror repository, an electronic device, and a readable storage medium.
In a first aspect, an embodiment of the present disclosure provides a method for managing a mirror repository.
Specifically, the method for managing the mirror repository includes:
receiving one or more upload mirror layers;
storing the uploading mirror layer in the mirror repository in a first storage mode;
determining a mirror image layer to be cleaned in one or more original mirror image layers stored in the mirror image warehouse in a second storage mode, wherein the first storage mode is different from the second storage mode;
and cleaning the mirror image layer to be cleaned.
With reference to the first aspect, in a first implementation manner of the first aspect, the original mirror layer includes a mirror layer stored in the mirror repository before and/or after the upload mirror layer is received.
With reference to the first aspect, in a second implementation manner of the first aspect, the storing the upload mirror layer in the mirror repository in the first storage manner includes:
storing the uploading mirror image layer in a storage directory different from the storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode different from that of the original mirror image layer; and/or
Storing the upload mirror layer in association with the cleaning-prohibited identification information.
With reference to the first aspect, the present disclosure provides in a third implementation form of the first aspect, the determining and/or the cleaning operation is performed concurrently with the receiving and/or the storing operation.
With reference to the first aspect, in a fourth implementation manner of the first aspect, the present disclosure further includes:
and after the mirror image layer to be cleaned is cleaned, storing the uploading mirror image layer in the second storage mode.
With reference to the fourth implementation manner of the first aspect, in a fifth implementation manner of the first aspect, the storing the upload mirror layer in the second storage manner includes:
storing the uploading mirror image layer in a storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode which is the same as that of the original mirror image layer; and/or
And removing the association between the uploading mirror image layer and the identification information forbidden to be cleaned.
With reference to the first aspect, in a sixth implementation manner of the first aspect, the present disclosure further includes:
during the determining and/or the cleaning operation, providing a downloading service of the uploading mirror layer based on the uploading mirror layer stored in the first storage mode; and/or
After the to-be-cleaned mirror image layer is cleaned, the uploading mirror image layer is stored in the second storage mode, and a downloading service of the uploading mirror image layer is provided based on the uploading mirror image layer stored in the second storage mode.
With reference to the first aspect, in a seventh implementation manner of the first aspect, the present disclosure further includes: and under the condition that the received mirror image layer and any original mirror image layer belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a second storage mode as the original mirror image layer.
With reference to the first aspect, in an eighth implementation manner of the first aspect, in a case that a received mirror layer does not belong to the same mirror as any of the original mirror layers, the received mirror layer is stored in the mirror warehouse as the upload mirror layer in a first storage manner.
With reference to the first aspect, in a ninth implementation manner of the first aspect, the determining and/or cleaning operation is started after the mirror element information of the original mirror layer is uploaded.
With reference to the first aspect, in a tenth implementation manner of the first aspect, the present disclosure does not have a reference relationship between the upload mirror layer stored in the first storage manner and the original mirror layer stored in the second storage manner.
With reference to the first aspect, in an eleventh implementation manner of the first aspect, the storing the upload mirror layer in the mirror repository in the first storage manner includes storing the upload mirror layer in a temporary mirror layer directory in the mirror repository.
With reference to the eleventh implementation manner of the first aspect, in a twelfth implementation manner of the first aspect, the present disclosure further includes, when processing the downloading of the upload mirror layer:
when the uploading mirror image layer exists in the temporary mirror image layer directory, a downloading link of the uploading mirror image layer in the temporary mirror image layer directory is preferentially provided;
and when the uploading mirror image layer does not exist in the temporary mirror image layer directory, providing a download link for storing the uploading mirror image layer in the storage directory of the one or more original mirror image layers.
With reference to the fourth implementation manner of the first aspect, in a thirteenth implementation manner of the first aspect, after the mirror image layer to be cleaned is cleaned, the storing the upload mirror image layer in the second storage manner includes adding the upload mirror image layer stored in the temporary mirror image layer directory to a storage directory in which the one or more original mirror image layers are stored.
In a second aspect, an apparatus for managing a mirror repository is provided in embodiments of the present disclosure.
Specifically, the apparatus for managing an image repository includes:
a receiving module configured to receive one or more upload mirror layers;
a first storage module configured to store the upload mirror layer in the mirror repository in a first storage manner;
the determining module is configured to determine a mirror layer to be cleaned in one or more original mirror layers stored in the mirror repository in a second storage manner, wherein the first storage manner is different from the second storage manner;
a cleaning module configured to clean the mirror layer to be cleaned.
With reference to the second aspect, in a first implementation manner of the second aspect, the original mirror layer includes a mirror layer stored in the mirror repository before and/or after the upload mirror layer is received.
With reference to the second aspect, in a second implementation manner of the second aspect, the storing the upload mirror layer in the mirror repository in the first storage manner includes:
storing the uploading mirror image layer in a storage directory different from the storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode different from that of the original mirror image layer; and/or
Storing the upload mirror layer in association with the cleaning-prohibited identification information.
With reference to the second aspect, the present disclosure provides in a third implementation form of the second aspect, the determining and/or the cleaning operation is performed concurrently with the receiving and/or the storing operation.
With reference to the second aspect, in a fourth implementation manner of the second aspect, the present disclosure further includes a second storage module configured to:
and after the mirror image layer to be cleaned is cleaned, storing the uploading mirror image layer in the second storage mode.
With reference to the fourth implementation manner of the second aspect, in a fifth implementation manner of the second aspect, the storing the upload mirror layer in the second storage manner includes:
storing the uploading mirror image layer in a storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode which is the same as that of the original mirror image layer; and/or
And removing the association between the uploading mirror image layer and the identification information forbidden to be cleaned.
With reference to the second aspect, in a sixth implementation manner of the second aspect, the present disclosure further includes a downloading module configured to:
during the determining and/or the cleaning operation, providing a downloading service of the uploading mirror layer based on the uploading mirror layer stored in the first storage mode; and/or
After the to-be-cleaned mirror image layer is cleaned, the uploading mirror image layer is stored in the second storage mode, and a downloading service of the uploading mirror image layer is provided based on the uploading mirror image layer stored in the second storage mode.
With reference to the second aspect, in a seventh implementation manner of the second aspect, the present disclosure further includes a third storage module configured to: and under the condition that the received mirror image layer and any original mirror image layer belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a second storage mode as the original mirror image layer.
With reference to the second aspect, in an eighth implementation manner of the second aspect, the storing the upload mirror layer in the mirror repository in the first storage manner includes: and under the condition that the received mirror image layer and any original mirror image layer do not belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a first storage mode as the uploading mirror image layer.
With reference to the second aspect, in a ninth implementation manner of the second aspect, the determining and/or cleaning operation is started after the mirror element information of the original mirror layer is uploaded.
With reference to the second aspect, in a tenth implementation manner of the second aspect, the present disclosure does not have a reference relationship between the upload mirror layer stored in the first storage manner and the original mirror layer stored in the second storage manner.
With reference to the second aspect, in an eleventh implementation manner of the second aspect, the storing the upload mirror layer in the mirror repository in the first storage manner includes storing the upload mirror layer in a temporary mirror layer directory included in the mirror repository.
With reference to the eleventh implementation manner of the second aspect, in a twelfth implementation manner of the second aspect, the present disclosure further includes a second downloading module configured to, when processing the downloading of the upload mirror layer:
when the uploading mirror image layer exists in the temporary mirror image layer directory, a downloading link of the uploading mirror image layer in the temporary mirror image layer directory is preferentially provided;
and when the uploading mirror image layer does not exist in the temporary mirror image layer directory, providing a download link for storing the uploading mirror image layer in the storage directory of the one or more original mirror image layers.
With reference to the fourth implementation manner of the second aspect, in a thirteenth implementation manner of the second aspect, after the mirror layer to be cleaned is cleaned, the storing the upload mirror layer in the second storage manner includes adding the upload mirror layer stored in the temporary mirror layer directory to a storage directory storing the one or more original mirror layers.
In a third aspect, the disclosed embodiments provide an electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the following method steps:
receiving one or more upload mirror layers;
storing the uploading mirror layer in the mirror repository in a first storage mode;
determining a mirror image layer to be cleaned in one or more original mirror image layers stored in the mirror image warehouse in a second storage mode, wherein the first storage mode is different from the second storage mode;
and cleaning the mirror image layer to be cleaned.
With reference to the third aspect, in a first implementation manner of the third aspect, the original mirror layer includes a mirror layer stored in the mirror repository before and/or after the upload mirror layer is received.
With reference to the third aspect, in a second implementation manner of the third aspect, the storing the upload mirror layer in the mirror repository in the first storage manner includes:
storing the uploading mirror image layer in a storage directory different from the storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode different from that of the original mirror image layer; and/or
Storing the upload mirror layer in association with the cleaning-prohibited identification information.
With reference to the third aspect, the present disclosure provides in a third implementation of the third aspect, the determining and/or the cleaning operation is performed concurrently with the receiving and/or the storing operation.
With reference to the third aspect, in a fourth implementation manner of the third aspect, the one or more computer instructions are further executed by the processor to implement the following method steps:
and after the mirror image layer to be cleaned is cleaned, storing the uploading mirror image layer in the second storage mode.
With reference to the fourth implementation manner of the third aspect, in a fifth implementation manner of the third aspect, the storing the upload mirror layer in the second storage manner includes:
storing the uploading mirror image layer in a storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode which is the same as that of the original mirror image layer; and/or
And removing the association between the uploading mirror image layer and the identification information forbidden to be cleaned.
With reference to the third aspect, in a sixth implementation manner of the third aspect, the one or more computer instructions are further executed by the processor to implement the following method steps:
during the determining and/or the cleaning operation, providing a downloading service of the uploading mirror layer based on the uploading mirror layer stored in the first storage mode; and/or
After the to-be-cleaned mirror image layer is cleaned, the uploading mirror image layer is stored in the second storage mode, and a downloading service of the uploading mirror image layer is provided based on the uploading mirror image layer stored in the second storage mode.
With reference to the third aspect, in a seventh implementation manner of the third aspect, the one or more computer instructions are further executed by the processor to implement the following method steps: and under the condition that the received mirror image layer and any original mirror image layer belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a second storage mode as the original mirror image layer.
With reference to the third aspect, in an eighth implementation manner of the third aspect, the storing the upload mirror layer in the mirror repository in the first storage manner includes: and under the condition that the received mirror image layer and any original mirror image layer do not belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a first storage mode as the uploading mirror image layer.
With reference to the third aspect, in a ninth implementation manner of the third aspect, the determining and/or cleaning operation is started after the mirror element information of the original mirror layer is uploaded.
With reference to the third aspect, in a tenth implementation manner of the third aspect, the present disclosure is a method according to claim 1, wherein there is no reference relationship between the upload mirror layer stored in the first storage manner and the original mirror layer stored in the second storage manner.
With reference to the third aspect, in an eleventh implementation manner of the third aspect, the storing the upload mirror layer in the mirror repository in the first storage manner includes storing the upload mirror layer in a temporary mirror layer directory in the mirror repository.
With reference to the eleventh implementation manner of the third aspect, in a twelfth implementation manner of the third aspect, the one or more computer instructions are further executed by the processor to implement the following method steps, when processing the downloading of the upload mirror layer:
when the uploading mirror image layer exists in the temporary mirror image layer directory, a downloading link of the uploading mirror image layer in the temporary mirror image layer directory is preferentially provided;
and when the uploading mirror image layer does not exist in the temporary mirror image layer directory, providing a download link for storing the uploading mirror image layer in the storage directory of the one or more original mirror image layers.
With reference to the fourth implementation manner of the third aspect, in a thirteenth implementation manner of the third aspect, after the to-be-cleaned mirror layer is cleaned, the storing the upload mirror layer in the second storage manner includes adding the upload mirror layer stored in the temporary mirror layer directory to a storage directory in which the one or more original mirror layers are stored.
In a fourth aspect, an embodiment of the present disclosure provides a readable storage medium having stored thereon computer instructions, which when executed by a processor, implement the method according to any one of the first aspect, the first implementation manner to the thirteenth implementation manner of the first aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the technical scheme provided by the embodiment of the disclosure, the new uploading mirror layer and the original mirror layer are stored in the mirror warehouse in the first storage mode and the second storage mode respectively, so that the mirror layer in the mirror uploading operation is separated from the mirror layer in the garbage cleaning operation, the garbage cleaning can be executed while the mirror uploading operation is carried out, the occurrence of concurrency problems is avoided, and the garbage cleaning problem of the mirror warehouse is solved under the condition that other databases or middleware are not introduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Other labels, objects and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments when taken in conjunction with the accompanying drawings. In the drawings:
FIG. 1 illustrates a flow diagram of a method of managing a mirror repository, according to an embodiment of the present disclosure;
FIG. 2 shows a schematic diagram of a method of managing a mirror repository, according to an embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of a download service providing an upload mirror layer during the determining and/or the scrubbing operations;
FIG. 4 shows a schematic diagram of a download service providing an upload mirror layer after cleaning the to-be-cleaned mirror layer;
fig. 5 illustrates a block diagram of an apparatus for managing a mirror repository according to an embodiment of the present disclosure;
FIG. 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 7 shows a schematic structural diagram of a computer system suitable for implementing a method of managing an image repository according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. Also, for the sake of clarity, parts not relevant to the description of the exemplary embodiments are omitted in the drawings.
In the present disclosure, it is to be understood that terms such as "including" or "having," etc., are intended to indicate the presence of the disclosed features, numbers, steps, behaviors, components, parts, or combinations thereof, and are not intended to preclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or combinations thereof may be present or added.
It should be further noted that the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
As described above, the mirror image includes a plurality of mirror image layers. The mirror repository stores at least mirror layers and mirror information describing dependencies between the mirror layers. When the mirror image warehouse is cleaned up, the mirror image layer to be deleted is determined according to the mirror image information, for example, which mirror image layers stored in the mirror image warehouse are not depended on are found out, and then the mirror image layer which is not depended on is deleted, so that the purpose of cleaning up the mirror image garbage is achieved.
However, the inventor finds that, because the mirror layer and the mirror metadata are uploaded separately during mirror uploading, some mirror layers may be uploaded earlier than the corresponding mirror metadata, so that garbage cleaning during the mirror uploading process may have a concurrence problem. For example, after uploading certain mirror layers of a mirror is complete, and before uploading corresponding mirror information, those mirror layers may not be described by any mirror information as being relied upon by other mirror layers. At this point, a garbage-cleaning operation is performed, and if it is just scanned that the mirror layers are not relied upon, the mirror layers are cleaned, resulting in the mirror being unusable.
Fig. 1 illustrates a flow diagram of a method of managing an image repository, according to an embodiment of the present disclosure. As shown in fig. 1, the method for managing the mirror repository includes the following steps S101-S104:
in step S101, receiving one or more upload mirror layers;
in step S102, storing the upload mirror layer in the mirror repository in a first storage manner;
in step S103, determining a mirror layer to be cleaned in one or more original mirror layers stored in the mirror repository in a second storage manner, where the first storage manner is different from the second storage manner;
in step S104, the mirror layer to be cleaned is cleaned.
Fig. 2 shows a schematic diagram of a method of managing a mirror repository according to an embodiment of the present disclosure.
As shown in fig. 1 and 2, the mirror warehouse receives one or more uploaded mirror layers, stores the uploaded mirror layers in the mirror warehouse in a first storage manner, stores an original mirror layer in the mirror warehouse in a second storage manner, and the first storage manner is different from the second storage manner, so that the uploaded mirror layer and the original mirror layer are distinguished by different storage manners. Therefore, the cleaning operation can be executed aiming at the original mirror image layer, and the cleaning operation is not executed on the uploading mirror image layer, so that the situation that the uploading mirror image layer is mistakenly deleted due to the fact that the mirror image information of the uploading mirror image layer is not uploaded or is not uploaded is avoided.
Specifically, when determining and/or cleaning the original mirror layer, the mirror layer to be cleaned may be determined first, for example, according to the mirror element information of the original mirror layer, find out which original mirror layers are not relied on, and determine the original mirror layer that is not relied on as the mirror layer to be cleaned. Then, the mirror image layer to be cleaned is cleaned, for example, the mirror image layer to be cleaned is directly deleted, or the mirror image layer to be cleaned is placed in other storage spaces, so that the storage space originally occupied by the mirror image layer to be cleaned is released.
According to an embodiment of the present disclosure, the legacy mirror layer comprises a mirror layer stored in the mirror repository before and/or after the upload mirror layer is received. For example, it may be preset that a mirror layer of a new mirror received after a certain point in time is stored as an upload mirror layer in the first manner, and a mirror layer received by a mirror warehouse before the certain point in time is stored as an original mirror layer in the second manner. If at this point in time some mirror layers of the image have already begun uploading but have not yet completed uploading, the remaining mirror layers of the image may be stored as the original mirror layers in a second manner.
In other words, after the time point, in the case that the received mirror layer belongs to the same mirror image as any original mirror layer, the received mirror layer is stored in the mirror repository as the original mirror layer in a second storage manner; and under the condition that the received mirror image layer and any original mirror image layer do not belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a first storage mode as the uploading mirror image layer. In this way, the mirror image being uploaded is not disrupted by switching from the second storage mode to the first storage mode. For example, the mirror image M includes mirror image layers M1, M2, M3, M4, M5 and M6, where M1, M2, M3, M4 and M5 have been stored in the mirror image repository in the second storage manner, and since the mirror image layer M6 also belongs to the mirror image M, if the mirror image layer M6 is received after the above-mentioned point in time, the mirror image layer M6 is also stored in the mirror image repository in the second storage manner. On the other hand, for example, if the mirror layer Z1 received after the above-mentioned point in time does not belong to the same mirror as any of the original mirror layers, i.e., the mirror layer Z1 belongs to a new mirror, the mirror layer Z1 is stored in the mirror repository as the upload mirror layer in the first storage manner.
According to the embodiment of the disclosure, there is no dependency relationship between the upload mirror layer stored in the first storage manner and the original mirror layer stored in the second storage manner.
According to the embodiment of the disclosure, when a plurality of mirror image layers of a mirror image are uploaded, all mirror image layers included in the mirror image can be uploaded to a mirror image warehouse, or only mirror image layers not included in the mirror image warehouse can be uploaded, but existing mirror image layers in the mirror image warehouse are not uploaded, so that communication, processing and storage resources are saved. For example, some images may include base software image layers such as an operating system and a database, and when a plurality of image layers of the image are uploaded, the base software image layers may not be uploaded, and only image layers that do not exist in an image repository may be uploaded. For example, if the upload mirror includes a mirror layer of the Linux operating system and the mirror warehouse already stores a mirror layer of the same Linux operating system, then, in order to save the communication resource and the storage space of the mirror warehouse, the mirror layer of the Linux operating system may not be uploaded, and only other mirror layers that do not exist in the upload mirror warehouse may be used.
Thus, when uploading multiple mirror layers of a mirror, it may be determined whether one or more mirror layers exist in the mirror store, and if so, these mirror layers are not repeatedly uploaded. If the uploading mirror image layer is allowed to depend on the original mirror image layer in the mirror image warehouse, when the mirror image layer to be cleaned is determined, the meta-information of the uploading mirror image layer is not uploaded, and the depended original mirror image layer is deleted. In this embodiment, the uploading mirror layer and the original mirror layer are prohibited from having a dependency relationship, that is, the original mirror layer does not have a parent layer and/or a sub-layer of the uploading mirror layer, which can avoid the situation that the uploaded mirror cannot be used normally due to deletion of the original mirror layer that is depended on by the uploading mirror layer.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the mirror repository in the first storage manner includes:
storing the uploading mirror image layer in a storage directory different from the storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode different from that of the original mirror image layer; and/or
Storing the upload mirror layer in association with the cleaning-prohibited identification information.
For example, if a mirror layer in the original mirror layer is stored in the first mirror layer directory, the upload mirror layer may be stored in the second mirror layer directory, so that the upload mirror layer and the original mirror layer may be stored in two different storage manners, and meanwhile, only the determination and/or cleaning operation is performed in the first mirror layer directory, but not in the second mirror layer directory.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the mirror repository in the first storage manner includes storing the upload mirror layer in a temporary mirror layer directory in the mirror repository.
For example, the original mirror layer may be stored under the original mirror layer directory, the upload mirror layer may be stored under a temporary mirror layer directory different from the original mirror layer directory, and since the original mirror layer directory and the temporary mirror layer directory are two different directories, it is possible to implement isolation between the upload mirror layer and the original mirror layer by storing the upload mirror layer and the original mirror layer under two different directories, respectively. When determining and/or cleaning operation is carried out on the mirror layer in the original mirror layer directory, a new mirror image is not added to the original mirror layer directory any more, namely the original mirror layer directory is in a read-only state at the moment, the determining and/or cleaning operation is carried out only under the storage directory of the original mirror layer, and the determining and/or cleaning operation is not carried out under the temporary mirror layer directory. Therefore, the mirror image layer is allowed to be uploaded continuously while the determining and/or cleaning operation is executed, and the concurrence problem that the mirror image information cannot be uploaded timely when the uploading and cleaning operation is carried out simultaneously so that the uploading mirror image layer is deleted mistakenly is avoided.
Alternatively, if the mirror layer in the original mirror layer is named in the first naming manner, the upload mirror layer may be named in the second naming manner, for example, if the mirror layer in the original mirror layer is named in the manner of ID (70618b6e8070), then the upload mirror layer may be named in the manner of new-ID (new-80618b6e8070), so that the mirror layer including the character "new" in the naming is not processed when the determination and/or cleaning operation is performed. It should be understood that the embodiments of the present invention are only illustrated by using the mirror layer with the designation of the mirror layer, but the present invention is not limited thereto.
Alternatively, when the image warehouse receives the upload image layer, the upload image layer may be stored in association with the cleaning-prohibited identification information, in which case the determination and/or cleaning operation is not performed on the image layer with the cleaning-prohibited identification information.
According to an embodiment of the present disclosure, the determining and/or cleaning operation is started after uploading the mirror element information of the original mirror layer.
In this embodiment, the determination and/or cleaning operation on the original mirror image layer is only started when it is ensured that the original mirror image layer and the corresponding mirror image information are already stored in the mirror image warehouse, and at this time, the original mirror image layer will be in a read-only state and will not be relied on by new mirror image information. Therefore, the mirror image layer depended on by the original mirror image layer can be found out according to the mirror image element information of all the original mirror image layers, so that the mirror image layer to be cleaned is determined, and the condition that the mirror image layer depended on by the original mirror image layer is mistakenly deleted is avoided.
According to the embodiment of the disclosure, after the mirror image layer to be cleaned is cleaned, the uploading mirror image layer is stored in the second storage mode.
After the garbage cleaning work of the mirror image layer is finished, the uploading mirror image layer can be merged into the original mirror image layer, namely, the uploading mirror image layer is stored in a second storage mode the same as that of the original mirror image layer.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the second storage manner includes:
storing the uploading mirror image layer in a storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode which is the same as that of the original mirror image layer; and/or
And removing the association between the uploading mirror image layer and the identification information forbidden to be cleaned.
For example, the mirror layer in the original mirror layer is stored in the first mirror layer directory, after the mirror layer to be cleaned is cleaned, the upload mirror layer stored in the second mirror layer directory may be copied to the first mirror layer directory, and after a preset time period, the upload mirror layer stored in the second mirror layer directory is deleted, or the second mirror layer directory and the upload mirror layer therein are deleted, where the preset time period may be set according to actual needs, for example, after the effective time of the download service provided based on the second mirror layer directory expires, the upload mirror layer in the second mirror layer directory may be deleted, or the second mirror layer directory and the upload mirror layer therein may be deleted.
Or, the mirror image layer in the original mirror image layer adopts the first naming mode, and then after the mirror image layer to be cleaned is cleaned, the naming mode of the uploaded mirror image layer can be changed into the first naming mode. For example, the original mirror layer is named by using the identification ID, the uploading mirror layer is named by using the new-ID, and then the naming mode of the uploading mirror layer is changed to use the identification ID, for example, "new-80618 b6e 8070" is renamed to "80618 b6e 8070".
Or, when the mirror warehouse stores the uploading mirror layer and the cleaning-forbidden identification information in a correlated manner, after cleaning the to-be-cleaned mirror layer, the correlation between the uploading mirror layer and the cleaning-forbidden identification information may be removed.
According to an embodiment of the present disclosure, after the mirror layer to be cleaned is cleaned, the uploading mirror layer is stored in the second storage manner, including adding the uploading mirror layer stored in the temporary mirror layer directory to a storage directory storing the one or more original mirror layers.
For example, after cleaning a mirror layer to be cleaned under an original mirror layer directory, an upload mirror layer stored in a temporary mirror layer directory may be added to the original mirror layer directory. After a preset time period, the upload mirror layer stored in the temporary mirror layer directory may be deleted, or the temporary mirror layer directory and the upload mirror layer therein may be deleted, where the preset time period may be set according to actual needs, for example, the upload mirror layer in the temporary mirror layer directory may be deleted or the temporary mirror layer directory and the upload mirror layer therein may be deleted after the effective time of the download service provided based on the temporary mirror layer directory expires.
According to an embodiment of the present disclosure, the determining and/or the cleaning operation may be performed concurrently with the receiving and/or the storing operation.
In this embodiment, since the object of the determining and/or cleaning operation execution is the original mirror layer stored in the mirror repository in the second storage manner, and the object of the receiving and/or storing operation execution is the upload mirror layer, and the execution objects of the two are different, the receiving and/or storing operation and the determining and/or cleaning operation may be executed concurrently. Therefore, when the mirror image warehouse is subjected to garbage cleaning, mirror image uploading can still be normally received.
The image warehouse can provide an image uploading service and an image downloading service. According to the embodiment of the disclosure, when the mirror image is downloaded, the client sends the message for inquiring the mirror image to the mirror image warehouse, and the message at least comprises the identification of the specified mirror image to be downloaded. The mirror repository returns information specifying the mirror according to the identity of the mirror, including, for example, the size of the mirror, the mirror hierarchy, and the identity of each mirror layer. And the client inquires which mirror layers do not exist in the mirror layers which are stored locally according to the identification of each mirror layer returned by the mirror repository. If some image layers exist locally, the existing image layers are not required to be downloaded, but the image layers which do not exist locally at the client side are downloaded from the image warehouse, and the downloading process of the images is finished.
According to the embodiment of the disclosure, during the determining and/or the cleaning operation, a downloading service of the uploading mirror layer is provided based on the uploading mirror layer stored in the first storage mode.
Fig. 3 shows a schematic diagram of a download service providing an upload mirror layer during said determining and/or said cleaning operation.
As shown in fig. 3, when the mirror repository performs the determining and/or cleaning operation on the original mirror layer, the original mirror layer will be in a read-only state and will not receive the new upload mirror layer, and therefore, the upload mirror layer will be stored in the mirror repository in the first storage manner. At this time, since the upload mirror layer is stored in the mirror repository in the first storage manner, the mirror repository provides a download service of the upload mirror layer based on the upload mirror layer stored in the first storage manner. For example, the mirror repository may provide a download link 10.175.10.100:8080/layername1/b750fe792670 for an uploaded mirror layer stored in the first storage manner, where 10.175.10.100:8080 represents the address where the mirror layer is stored in the mirror repository in the first storage manner, layername1 is the name of the mirror layer that needs to be downloaded, and layername1 is followed by b750fe792670 is the identification of the mirror layer.
According to the embodiment of the disclosure, after the to-be-cleaned mirror image layer is cleaned, the uploading mirror image layer is stored in the second storage mode, and based on the uploading mirror image layer stored in the second storage mode, a downloading service of the uploading mirror image layer is provided.
Fig. 4 shows a schematic diagram of a download service providing an upload mirror layer after cleaning the to-be-cleaned mirror layer.
As shown in fig. 4, after the mirror warehouse cleans the mirror layer to be cleaned, the uploading mirror layer is stored in the mirror warehouse in the second storage manner. At this time, since the upload mirror layer is stored in the mirror repository in the second storage manner, the mirror repository provides a download service of the upload mirror layer based on the upload mirror layer stored in the second storage manner, that is, the mirror repository provides the mirror information according to the identifier of the upload mirror layer, and the provided mirror information is derived from the upload mirror layer stored in the second storage manner. For example, the mirror repository may provide a download link 10.175.10.100: 9090/layeroname 2/f750fe792670 for the uploaded mirror layer stored in the second storage manner, where 10.175.10.100:9090 represents the address of the mirror layer stored in the mirror repository in the second storage manner, layeroname 2 is the name of the mirror layer that needs to be downloaded, and f750fe792670 immediately following the layer name2 is the identification of the mirror layer.
According to the embodiment of the present disclosure, the method further includes, when processing the downloading of the upload mirror layer:
when the uploading mirror image layer exists in the temporary mirror image layer directory, a downloading link of the uploading mirror image layer in the temporary mirror image layer directory is preferentially provided;
and when the uploading mirror image layer does not exist in the temporary mirror image layer directory, providing a download link for storing the uploading mirror image layer in the storage directory of the one or more original mirror image layers.
For example, the original mirror layer may be stored in an original mirror layer directory, the upload mirror layer may be stored in a temporary mirror layer directory different from the original mirror layer directory, when downloading the upload mirror layer N, it is first determined whether the upload mirror layer N exists in the temporary mirror layer directory, and if the upload mirror layer N exists in the temporary mirror layer directory, a download link of the upload mirror layer N in the temporary mirror layer directory is preferentially provided; and if the uploading mirror image layer N does not exist in the temporary mirror image layer directory, providing a downloading link of the uploading mirror image layer N in the original mirror image layer directory. For example, the name of the upload mirror layer N is layername, the identifier of the upload mirror layer N is f850fe792670, when the download of the upload mirror layer N is to be processed, firstly, whether the upload mirror layer N exists in the temporary mirror layer directory is inquired, and if the upload mirror layer N exists in the temporary mirror layer directory, a download link 10.275.10.100 of the upload mirror layer N under the temporary mirror layer directory is provided, wherein the download link is 9090/layername/f850fe 792670; if the identifier f850fe792670 of the uploading mirror layer N does not exist in the temporary mirror layer directory, a download link 20.275.20.200:9090/layername/f850fe792670 of the uploading mirror layer N under the original mirror layer directory is provided.
Fig. 5 illustrates a block diagram of an apparatus 500 for managing a mirror repository according to an embodiment of the present disclosure. The apparatus may be implemented as part or all of an electronic device through software, hardware, or a combination of both. As shown in fig. 5, the apparatus 500 for managing an image repository includes a receiving module 510, a first storing module 520, a determining module 530, and a cleaning module 540.
The receiving module 510 is configured to receive one or more upload mirror layers;
the first storage module 520 is configured to store the upload mirror layer in the mirror repository in a first storage manner;
the determining module 530 is configured to determine a mirror layer to be cleaned of one or more original mirror layers stored in the mirror repository in a second storage manner, where the first storage manner is different from the second storage manner;
the cleaning module 540 is configured as a cleaning module configured to clean the mirror layer to be cleaned.
According to an embodiment of the present disclosure, the legacy mirror layer comprises a mirror layer stored in the mirror repository before and/or after the upload mirror layer is received.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the mirror repository in the first storage manner includes:
storing the uploading mirror image layer in a storage directory different from the storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode different from that of the original mirror image layer; and/or
Storing the upload mirror layer in association with the cleaning-prohibited identification information.
According to an embodiment of the present disclosure, the determining and/or the cleaning operation is performed concurrently with the receiving and/or the storing operation.
According to an embodiment of the present disclosure, the apparatus 500 may further include a second storage module 550 configured to:
and after the mirror image layer to be cleaned is cleaned, storing the uploading mirror image layer in the second storage mode.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the second storage manner includes:
storing the uploading mirror image layer in a storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode which is the same as that of the original mirror image layer; and/or
And removing the association between the uploading mirror image layer and the identification information forbidden to be cleaned.
According to an embodiment of the present disclosure, the apparatus 500 may further include a first downloading module 560 configured to:
during the determining and/or the cleaning operation, providing a downloading service of the uploading mirror layer based on the uploading mirror layer stored in the first storage mode; and/or
After the to-be-cleaned mirror image layer is cleaned, the uploading mirror image layer is stored in the second storage mode, and a downloading service of the uploading mirror image layer is provided based on the uploading mirror image layer stored in the second storage mode.
According to an embodiment of the present disclosure, the apparatus 500 may further include a third storage module 570 configured to: and under the condition that the received mirror image layer and any original mirror image layer belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a second storage mode as the original mirror image layer.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the mirror repository in the first storage manner includes: and under the condition that the received mirror image layer and any original mirror image layer do not belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a first storage mode as the uploading mirror image layer.
According to an embodiment of the present disclosure, the determining and/or cleaning operation is started after uploading the mirror element information of the original mirror layer.
According to the embodiment of the disclosure, there is no reference relationship between the upload mirror layer stored in the first storage manner and the original mirror layer stored in the second storage manner.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the mirror repository in the first storage manner includes storing the upload mirror layer in a temporary mirror layer directory in the mirror repository.
According to an embodiment of the present disclosure, the apparatus 500 may further include a second download module 580 configured to, when processing the download of the upload mirror layer:
when the uploading mirror image layer exists in the temporary mirror image layer directory, a downloading link of the uploading mirror image layer in the temporary mirror image layer directory is preferentially provided;
and when the uploading mirror image layer does not exist in the temporary mirror image layer directory, providing a download link for storing the uploading mirror image layer in the storage directory of the one or more original mirror image layers.
According to an embodiment of the present disclosure, after the mirror layer to be cleaned is cleaned, the uploading mirror layer is stored in the second storage manner, including adding the uploading mirror layer stored in the temporary mirror layer directory to a storage directory storing the one or more original mirror layers.
The present disclosure also discloses an electronic device, and fig. 6 shows a block diagram of the electronic device according to an embodiment of the present disclosure.
As shown in fig. 6, the electronic device 600 includes a memory 601 and a processor 602; wherein the content of the first and second substances,
the memory 601 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 602 to implement the following method steps:
receiving one or more upload mirror layers;
storing the uploading mirror layer in the mirror repository in a first storage mode;
determining a mirror image layer to be cleaned in one or more original mirror image layers stored in the mirror image warehouse in a second storage mode, wherein the first storage mode is different from the second storage mode;
and cleaning the mirror image layer to be cleaned.
According to an embodiment of the present disclosure, the legacy mirror layer comprises a mirror layer stored in the mirror repository before and/or after the upload mirror layer is received.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the mirror repository in the first storage manner includes:
storing the uploading mirror image layer in a storage directory different from the storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode different from that of the original mirror image layer; and/or
Storing the upload mirror layer in association with the cleaning-prohibited identification information.
According to an embodiment of the present disclosure, the determining and/or the cleaning operation is performed concurrently with the receiving and/or the storing operation.
The one or more computer instructions are further executable by the processor 602 to implement the following method steps, in accordance with an embodiment of the present disclosure:
and after the mirror image layer to be cleaned is cleaned, storing the uploading mirror image layer in the second storage mode.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the second storage manner includes:
storing the uploading mirror image layer in a storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode which is the same as that of the original mirror image layer; and/or
And removing the association between the uploading mirror image layer and the identification information forbidden to be cleaned.
The one or more computer instructions are further executable by the processor 602 to implement the following method steps, in accordance with an embodiment of the present disclosure:
during the determining and/or the cleaning operation, providing a downloading service of the uploading mirror layer based on the uploading mirror layer stored in the first storage mode; and/or
After the to-be-cleaned mirror image layer is cleaned, the uploading mirror image layer is stored in the second storage mode, and a downloading service of the uploading mirror image layer is provided based on the uploading mirror image layer stored in the second storage mode.
The one or more computer instructions are further executable by the processor 602 to implement the following method steps, in accordance with an embodiment of the present disclosure: and under the condition that the received mirror image layer and any original mirror image layer belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a second storage mode as the original mirror image layer.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the mirror repository in the first storage manner includes: and under the condition that the received mirror image layer and any original mirror image layer do not belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a first storage mode as the uploading mirror image layer.
According to an embodiment of the present disclosure, the determining and/or cleaning operation is started after uploading the mirror element information of the original mirror layer.
According to the embodiment of the disclosure, there is no reference relationship between the upload mirror layer stored in the first storage manner and the original mirror layer stored in the second storage manner.
According to an embodiment of the present disclosure, the storing the upload mirror layer in the mirror repository in the first storage manner includes storing the upload mirror layer in a temporary mirror layer directory in the mirror repository.
According to an embodiment of the present disclosure, the one or more computer instructions are further executable by the processor to perform method steps, when processing the downloading of the upload mirror layer:
when the uploading mirror image layer exists in the temporary mirror image layer directory, a downloading link of the uploading mirror image layer in the temporary mirror image layer directory is preferentially provided;
and when the uploading mirror image layer does not exist in the temporary mirror image layer directory, providing a download link for storing the uploading mirror image layer in the storage directory of the one or more original mirror image layers.
According to an embodiment of the present disclosure, after the mirror layer to be cleaned is cleaned, the uploading mirror layer is stored in the second storage manner, including adding the uploading mirror layer stored in the temporary mirror layer directory to a storage directory storing the one or more original mirror layers.
Fig. 7 shows a schematic block diagram of a computer system suitable for implementing a food recommendation method according to an embodiment of the present disclosure.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can execute various processes in the above-described embodiments according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the system 700 are also stored. The CPU701, the ROM702, and the RAM703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, the above described methods may be implemented as computer software programs according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the above-described object class determination method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present disclosure may be implemented by software or by programmable hardware. The units or modules described may also be provided in a processor, and the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
As another aspect, the present disclosure also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus in the above-described embodiments; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (23)

1. A method of managing a mirror repository, the method comprising:
receiving one or more upload mirror layers;
storing the uploading mirror layer in the mirror repository in a first storage mode;
determining a mirror image layer to be cleaned in one or more original mirror image layers stored in the mirror image warehouse in a second storage mode, wherein the first storage mode is different from the second storage mode;
and cleaning the mirror image layer to be cleaned.
2. The method of claim 1, wherein:
the legacy mirror layer includes a mirror layer stored in the mirror repository before and/or after the upload mirror layer is received.
3. The method of claim 1, wherein storing the uploaded mirrored layer in a mirror store in a first storage mode comprises:
storing the uploading mirror image layer in a storage directory different from the storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode different from that of the original mirror image layer; and/or
Storing the upload mirror layer in association with the cleaning-prohibited identification information.
4. The method according to claim 1, characterized in that said determining and/or said cleaning operation is performed concurrently with said receiving and/or said storing operation.
5. The method of claim 1, further comprising:
and after the mirror image layer to be cleaned is cleaned, storing the uploading mirror image layer in the second storage mode.
6. The method of claim 5, wherein storing the upload mirror layer in the second storage mode comprises:
storing the uploading mirror image layer in a storage directory of the original mirror image layer; and/or
Naming the uploading mirror image layer in a naming mode which is the same as that of the original mirror image layer; and/or
And removing the association between the uploading mirror image layer and the identification information forbidden to be cleaned.
7. The method of claim 1, further comprising:
during the determining and/or the cleaning operation, providing a downloading service of the uploading mirror layer based on the uploading mirror layer stored in the first storage mode; and/or
After the to-be-cleaned mirror image layer is cleaned, the uploading mirror image layer is stored in the second storage mode, and a downloading service of the uploading mirror image layer is provided based on the uploading mirror image layer stored in the second storage mode.
8. The method of claim 1, further comprising: and under the condition that the received mirror image layer and any original mirror image layer belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a second storage mode as the original mirror image layer.
9. The method of claim 1, wherein storing the uploaded mirror layer in the mirror repository in the first storage mode comprises: and under the condition that the received mirror image layer and any original mirror image layer do not belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a first storage mode as the uploading mirror image layer.
10. Method according to claim 1, characterized in that said determining and/or cleaning operation is started after uploading the mirror element information of said original mirror layer.
11. The method of claim 1, wherein there is no reference relationship between the uploaded mirror layer stored in the first storage manner and the original mirror layer stored in the second storage manner.
12. The method of claim 1, wherein storing the upload mirror layer in the mirror repository in the first storage mode comprises storing the upload mirror layer in a temporary mirror layer directory in the mirror repository.
13. The method of claim 12, further comprising, while processing the download of the upload mirror layer:
when the uploading mirror image layer exists in the temporary mirror image layer directory, a downloading link of the uploading mirror image layer in the temporary mirror image layer directory is preferentially provided;
and when the uploading mirror image layer does not exist in the temporary mirror image layer directory, providing a download link for storing the uploading mirror image layer in the storage directory of the one or more original mirror image layers.
14. The method of claim 5, wherein storing the uploaded mirror layer in the second storage mode after cleaning the mirror layer to be cleaned comprises adding the uploaded mirror layer stored in the temporary mirror layer directory to a storage directory storing the one or more legacy mirror layers.
15. An apparatus for managing a mirror warehouse, the apparatus comprising:
a receiving module configured to receive one or more upload mirror layers;
a first storage module configured to store the upload mirror layer in the mirror repository in a first storage manner;
the determining module is configured to determine a mirror layer to be cleaned in one or more original mirror layers stored in the mirror repository in a second storage manner, wherein the first storage manner is different from the second storage manner;
a cleaning module configured to clean the mirror layer to be cleaned.
16. The apparatus of claim 15, further comprising a second storage module configured to:
and after the mirror image layer to be cleaned is cleaned, storing the uploading mirror image layer in the second storage mode.
17. The apparatus of claim 15, further comprising a first download module configured to:
during the determining and/or the cleaning operation, providing a downloading service of the uploading mirror layer based on the uploading mirror layer stored in the first storage mode; and/or
After the to-be-cleaned mirror image layer is cleaned, the uploading mirror image layer is stored in the second storage mode, and a downloading service of the uploading mirror image layer is provided based on the uploading mirror image layer stored in the second storage mode.
18. The apparatus of claim 15, further comprising a third storage module configured to: and under the condition that the received mirror image layer and any original mirror image layer belong to the same mirror image, storing the received mirror image layer in the mirror image warehouse in a second storage mode as the original mirror image layer.
19. The apparatus of claim 15, wherein the storing the upload mirror layer in the mirror repository in the first storage mode comprises storing the upload mirror layer in a temporary mirror layer directory in the mirror repository.
20. The apparatus of claim 19, further comprising a second download module configured to, while processing the download of the upload mirror layer:
when the uploading mirror image layer exists in the temporary mirror image layer directory, a downloading link of the uploading mirror image layer in the temporary mirror image layer directory is preferentially provided;
and when the uploading mirror image layer does not exist in the temporary mirror image layer directory, providing a download link for storing the uploading mirror image layer in the storage directory of the one or more original mirror image layers.
21. The apparatus of claim 15, wherein storing the uploaded mirror layer in the second storage mode after cleaning the mirror layer to be cleaned comprises adding the uploaded mirror layer stored in the temporary mirror layer directory to a storage directory storing the one or more legacy mirror layers.
22. An electronic device comprising a memory and a processor; wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions are to be executed by the processor to implement the method steps according to any of claims 1-14.
23. A readable storage medium having stored thereon computer instructions, characterized in that the computer instructions, when executed by a processor, carry out the method steps of any of claims 1-14.
CN201910507414.6A 2019-06-12 2019-06-12 Method and device for managing mirror image warehouse, electronic equipment and readable storage medium Pending CN112084165A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910507414.6A CN112084165A (en) 2019-06-12 2019-06-12 Method and device for managing mirror image warehouse, electronic equipment and readable storage medium
PCT/CN2020/095522 WO2020249036A1 (en) 2019-06-12 2020-06-11 Method and apparatus for managing image repository, and electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910507414.6A CN112084165A (en) 2019-06-12 2019-06-12 Method and device for managing mirror image warehouse, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112084165A true CN112084165A (en) 2020-12-15

Family

ID=73733570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910507414.6A Pending CN112084165A (en) 2019-06-12 2019-06-12 Method and device for managing mirror image warehouse, electronic equipment and readable storage medium

Country Status (2)

Country Link
CN (1) CN112084165A (en)
WO (1) WO2020249036A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112714163A (en) * 2020-12-22 2021-04-27 北京百度网讯科技有限公司 Data transmission method, data transmission device, electronic equipment, medium and computer program product

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527467A (en) * 2020-12-23 2021-03-19 同盾控股有限公司 Storage structure, query method, deletion method, device, equipment and medium of container mirror image

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9390102B2 (en) * 2008-09-29 2016-07-12 Oracle International Corporation Client application program interface for network-attached storage system
CN101706817B (en) * 2009-12-01 2012-07-04 中兴通讯股份有限公司 Distributed file system and garbage data cleaning method thereof
CN107066296B (en) * 2017-03-31 2020-09-25 北京奇艺世纪科技有限公司 Method and device for cleaning mirror image in cluster node
CN107105054B (en) * 2017-05-17 2019-12-24 苏州浪潮智能科技有限公司 Mirror image garbage cleaning system and method for docker mirror image warehouse

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112714163A (en) * 2020-12-22 2021-04-27 北京百度网讯科技有限公司 Data transmission method, data transmission device, electronic equipment, medium and computer program product
CN112714163B (en) * 2020-12-22 2022-06-10 北京百度网讯科技有限公司 Data transmission method, device, electronic equipment and medium

Also Published As

Publication number Publication date
WO2020249036A1 (en) 2020-12-17

Similar Documents

Publication Publication Date Title
US11061657B2 (en) Systems and methods for managing distributed applications
US7287068B1 (en) System and method for updating devices that execute an operating system or application program directly from nonvolatile storage
WO2018204201A1 (en) Backup and restore framework for distributed computing systems
US20090100158A1 (en) Backup and Recovery System for Multiple Device Environment
CN1725182A (en) Apparatus and method for updating I/O capability of a logically-partitioned computer system
US20090177856A1 (en) Method and apparatus for automated backup process
US20220188088A1 (en) Repository including exclusion list
CN111897558A (en) Kubernets upgrading method and device for container cluster management system
CN112084165A (en) Method and device for managing mirror image warehouse, electronic equipment and readable storage medium
US11449350B2 (en) Systems and methods for automatically updating compute resources
US20040220940A1 (en) System and method for decoupling object identification for the purpose of object switching in database systems
CN110968478A (en) Log collection method, server and computer storage medium
CN111625498B (en) Data migration method, system, electronic equipment and storage medium
JPH1021061A (en) Automatic version-up system for client software
CN110134489A (en) Using moving method and device, system, storage medium, using upper cloud tool
CN114996337A (en) Multi-cluster database management system and method
CN106326777A (en) System mirror image document signature method and system, client and server
US20100057787A1 (en) Method, system, and computer program product for cloning of distributed and stateful systems
EP4162649B1 (en) Stable references for network function life cycle management automation
CN113377724A (en) Cache space management method, device and storage medium
JP5574905B2 (en) Module distribution system
CN111258605A (en) Universal upgrading method and device for channel client, computer equipment and storage medium
Munoz et al. Globdata: A platform for supporting multiple consistency modes
US20030018683A1 (en) Method, system and program for deleting work flow item
US20240061667A1 (en) Incremental Image Import Process for Supporting Multiple Upstream Image Repositories

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