Application mirror image caching method and device, equipment and storage medium
By generating application image cache tasks and cache pods after the end-of-day application is released, and application images are pre-pulled and cached in advance, the problems of container deployment rate and success rate are solved, and the impact of mirror warehouse failure on container deployment is reduced.
Patent Information
- Application Number
- CN202411432404.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-14
AI Technical Summary
In container deployment for end-of-day applications, how to speed up container deployment and avoid the risk of mirror warehouse failure affecting container deployment.
When the application release process of the end-of-day application is detected, the application image cache task is generated based on the application image address and platform deployment resource type generated by the application release process, create a mirror cache pod in the preset OCP cluster, and pre-cache pods through the mirror cache pod Pull and cache target application images to reduce the impact of mirror repository exceptions during deployment.
By pre-pulling and caching application images in advance, the efficiency of container deployment is improved and the impact of mirror warehouse failures on container deployment is reduced, ensuring the success and rate of container deployment.
Smart Images

Figure CN119311374A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of container deployment technology, and in particular to an application image caching method, device, equipment and storage medium. Background Art
[0002] Container technology is an efficient and lightweight application deployment solution, which is widely used in various business scenarios to process business logic. How to improve the container deployment rate is a problem that needs to be solved. Most solutions usually start from the bottom layer of the cluster and speed up the scheduling and deployment of containers by tuning the relevant parameters of the cluster. Day-end applications are a type of business unique to the banking industry. They usually need to be scheduled at a specific time every day and execute the day-end application logic by deploying containers.
[0003] Since the execution of end-of-day tasks often has a sequential dependency relationship and is required to be completed before a specified time range, there are certain requirements for the rate of container deployment; in addition, most end-of-day applications involve relatively important business logic, and the failure of end-of-day tasks cannot be allowed to fail due to container deployment failure. In short, there are certain requirements for the deployment rate and success rate of the containers used to run end-of-day applications. Therefore, how to speed up container deployment while avoiding the impact of image repository failures on container deployment is a problem. Summary of the invention
[0004] The main purpose of this application is to provide an application image caching method, device, equipment and storage medium, aiming to solve the technical problem of how to speed up container deployment while avoiding the impact of image repository failure on container deployment.
[0005] To achieve the above object, the present application proposes an application image caching method, the method comprising:
[0006] When the application publishing process of the end-of-day application is detected to be completed, an application image cache task is generated according to the application image address generated by the application publishing process and the platform deployment resource type;
[0007] Create an image cache Pod on the node corresponding to the application image cache task in the preset OCP cluster;
[0008] The step of caching the target application image corresponding to the application image caching task according to the image caching Pod comprises:
[0009] The image path to be cached is set in the YAML file corresponding to the image cache Pod, where the YAML file is a file describing the container configuration of the image cache Pod;
[0010] The target application image corresponding to the application image cache task is cached according to the image cache Pod and the YAML file.
[0011] In one embodiment, after the step of caching the target application image corresponding to the application image cache task according to the image cache Pod and the YAML file, the step further includes:
[0012] Querying the container event corresponding to the image cache Pod in the preset OCP cluster;
[0013] If there is a pulled event in the container event, the cache status of the application image cache task corresponding to the image cache Pod is marked as a success status.
[0014] In one embodiment, if there is a pulled event in the container event, after the step of marking the cache status of the application image cache task corresponding to the image cache Pod as a success status, it also includes:
[0015] Determine whether the cache status identifier corresponding to the application image cache task is a success status;
[0016] If it is a success state, the image cache Pod corresponding to the application image cache task is deleted.
[0017] In one embodiment, if the status is successful, the step of deleting the image cache Pod corresponding to the application image cache task includes:
[0018] Setting a delete attribute tag in the YAML file;
[0019] If the status is successful, the Pods whose values of the deletion attribute labels in the YAML file are preset values are deleted in batches.
[0020] In one embodiment, if the state is successful, after the step of deleting the image cache Pod corresponding to the application image cache task, the process further includes:
[0021] When the time point of executing the business logic of the end-of-day application is reached, determining the target deployment node according to the resource scheduling algorithm;
[0022] The target container is deployed on the target deployment node according to the target application image through the preset OCP cluster, so that the end-of-day application executes business logic on the target container.
[0023] In one embodiment, when the application publishing process of the end-of-day application is detected to be completed, the step of generating an application image cache task according to the application image address and platform deployment resource type generated by the application publishing process includes:
[0024] Monitor the number and time points of executing the application release process, and determine the peak time period for image pulling based on the number and time points;
[0025] Determine the cache task execution time period according to the peak time period of image pulling and the peak time period of end-of-day application operation;
[0026] When it is detected that the application publishing process of the end-of-day application is completed and it is in the cache task execution time period, an application image cache task is generated according to the application image address generated by the application publishing process and the platform deployment resource type.
[0027] In addition, to achieve the above-mentioned purpose, the present application also proposes an application image caching device, the application image caching device comprising:
[0028] An image cache task generation module is used to generate an application image cache task according to the application image address and platform deployment resource type generated by the application release process when detecting that the application release process of the end-of-day application is completed;
[0029] An image cache Pod creation module is used to create an image cache Pod on a node corresponding to the application image cache task in a preset OCP cluster;
[0030] The target application image cache module is used to cache the target application image corresponding to the application image cache task according to the image cache Pod.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes an application image caching device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the application image caching method described above.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the application image caching method described above are implemented.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the application image caching method described above are implemented.
[0034] The present application provides an application image caching method, which generates an application image caching task according to the application image address and platform deployment resource type generated by the application release process when the application release process of the end-of-day application is detected to be completed; creates an image cache Pod on the node corresponding to the application image caching task in the preset OCP cluster; and caches the target application image corresponding to the application image caching task according to the image cache Pod. Since the present application generates a corresponding number of image cache tasks in combination with deployment resources after the application is released, and executes the image cache tasks, an image cache Pod that occupies fewer resources and does not actually execute business logic is created on each node of the cluster, and the application image is pre-pulled in advance and cached locally, so as to achieve the purpose of image caching, thereby speeding up container deployment and reducing the risk of abnormalities in the image warehouse affecting container deployment during deployment. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A flowchart of the first embodiment of the image caching method for the present application is provided;
[0038] Figure 2 A flowchart of the second embodiment of the image caching method for the present application is provided;
[0039] Figure 3 A flowchart of the third embodiment of the image caching method for the present application is provided;
[0040] Figure 4 This is a schematic diagram of the module structure of the image caching device used in the embodiment of the present application;
[0041] Figure 5 A schematic diagram of the device structure of the hardware operating environment involved in applying the image caching method in the embodiment of the present application.
[0042] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0044] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0045] The main solution of the embodiment of the present application is: when it is detected that the application release process of the end-of-day application is completed, an application image cache task is generated according to the application image address and platform deployment resource type generated by the application release process; an image cache Pod is created on the node corresponding to the application image cache task in the preset OCP cluster; and the target application image corresponding to the application image cache task is cached according to the image cache Pod.
[0046] Since the execution of end-of-day tasks often has a sequential dependency relationship and is required to be completed before a specified time range, there are certain requirements for the rate of container deployment; in addition, most end-of-day applications involve relatively important business logic, and the failure of end-of-day tasks cannot be allowed to fail due to container deployment failure. In short, there are certain requirements for the deployment rate and success rate of the containers used to run end-of-day applications. Therefore, how to speed up container deployment while avoiding the impact of image repository failures on container deployment is a problem.
[0047] The present application provides a solution, by generating an application image cache task according to the application image address and platform deployment resource type generated by the application release process when the application release process of the end-of-day application is detected to be completed; creating an image cache Pod on the node corresponding to the application image cache task in the preset OCP cluster; caching the target application image corresponding to the application image cache task according to the image cache Pod. Since the present application generates a corresponding number of image cache tasks in combination with deployment resources after the application is released, and executes the image cache tasks, an image cache Pod that occupies fewer resources and does not actually execute business logic is created on each node of the cluster, and the application image is pre-pulled in advance and cached locally, so as to achieve the purpose of image caching, thereby speeding up container deployment and reducing the risk of abnormalities in the image warehouse affecting container deployment during deployment.
[0048] It should be noted that the execution subject of the method of this embodiment can be a computing service device with application image caching, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc.; it can also be an application image caching device with the same or similar functions. This embodiment and the following embodiments will be described by taking the application image caching device as an example.
[0049] Based on this, the embodiment of the present application provides an application image caching method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the image caching method used in this application.
[0050] In this embodiment, the application image caching method includes steps S10 to S30:
[0051] Step S10, when it is detected that the application publishing process of the end-of-day application is completed, an application image cache task is generated according to the application image address generated by the application publishing process and the platform deployment resource type.
[0052] It is understandable that the end-of-day application is an application program that contains business execution logic. It is a business type unique to the banking industry. It usually needs to be scheduled at a specific time every day to execute the end-of-day application logic by deploying containers. The end-of-day task is a task collection that contains basic information such as the task execution time, execution timeout, and the type and number of resources required for execution. Tasks may have a sequential execution dependency. When the application is updated, the user obtains a new application image on the platform through application packaging, execution pipeline, application release and other functions, and stores it in the image warehouse. The application image is essentially a layered packaged operating system, operating environment, application and other content.
[0053] It should be noted that in order to increase the speed of container image deployment, this embodiment pre-pulls and caches the application image before the end-of-day application actually runs to execute the business logic. When the end-of-day application actually runs to execute the business logic, the local application image can be directly used without having to pull it from the image warehouse at this time, thereby improving the efficiency of container deployment. Therefore, after the end-of-day application executes the application release process, this embodiment generates multiple image cache tasks based on the output application image address and the platform deployment resource type. That is, there are as many image cache tasks as there are node resources that match the deployment resource type set for the application, and each image cache task indicates that the specified application image needs to be pre-pulled on the node.
[0054] Step S20: Create an image cache Pod on a node corresponding to the application image cache task in a preset OCP cluster.
[0055] It should be noted that the image pre-pulling method proposed in this embodiment is to create an image cache Pod that uses only a small amount of CPU and memory resources on the corresponding node. After the image cache Pod is scheduled to the designated node and the kubelet completes pulling the application image to be cached from the image repository, the Pod completes its mission.
[0056] It is understandable that OCP, the abbreviation of Openshift Container Platform, is a container deployment platform based on Kubernetes with additional enterprise-level features. The containers required for the end-of-day application operation are deployed on the OCP cluster. Before initiating Pod creation, the platform will first select deployment resources based on the required resource types (deployment region, deployment business type labels, etc.) set by the task, and select which cluster or cluster node to deploy this time. After confirmation, a Pod creation request can be initiated to the cluster or cluster node.
[0057] Step S30: caching the target application image corresponding to the application image caching task according to the image caching Pod.
[0058] It should be understood that the image cache Pod can be scheduled to a specified node (i.e., the node corresponding to the application image cache task), and the kubelet completes the pulling of the application image that needs to be cached from the image repository. The Pod creation process in Kube rnetes involves the interaction of multiple underlying components, which generally includes: writing a YAML file that describes the container configuration and resource requirements in the Pod (i.e., a declarative description of the Pod), submitting a Pod creation request through the Kubernetes API Server, authenticating and receiving the request by the API Server, etcd storage and status updates, Scheduler scheduling, kubelet creation and operation, etc. After the application publishing function is completed, the application image address will be generated, and the kubelet will pull the specified application image from the corresponding image repository based on the application image address.
[0059] In a feasible implementation, step S30 may include steps S301 to S302:
[0060] Step S301, setting the image path to be cached in the YAML file corresponding to the image cache Pod, wherein the YAML file is a file describing the container configuration of the image cache Pod.
[0061] It is understandable that when creating an image cache Pod that uses only a few CPU and memory resources on the corresponding node, a simple run command (for example, ls command) can be set in the spec.containers[].command item in the YAML file that describes the image cache Pod container configuration without actually starting the application to execute business logic.
[0062] Step S302: Cache the target application image corresponding to the application image cache task according to the image cache Pod and the YAML file.
[0063] It is understandable that the target application image corresponding to the application image cache task can be pulled down through the image cache Pod and cached locally. After the image cache Pod executes a simple run command in a very short time, the container exits normally.
[0064] In this implementation, the image path to be cached is set in the YAML file describing the container configuration of the image cache Pod corresponding to the image cache Pod, and the target application image corresponding to the application image cache task is cached according to the image cache Pod and the image path to be cached in the YAML file, so that the application image can be pulled and cached in a shorter time without actually starting the application to execute the business logic.
[0065] This embodiment provides an application image caching method, which generates an application image caching task according to the application image address and platform deployment resource type generated by the application release process when the application release process of the end-of-day application is detected to be completed; creates an image cache Pod on the node corresponding to the application image caching task in the preset OCP cluster; and caches the target application image corresponding to the application image caching task according to the image cache Pod. Since this application generates a corresponding number of image cache tasks in combination with deployment resources after the application is released, and executes the image cache tasks, an image cache Pod that occupies less resources and does not actually execute business logic is created on each node of the cluster, and the application image is pre-pulled in advance and cached locally, so as to achieve the purpose of image caching, thereby speeding up container deployment and reducing the risk of abnormalities in the image warehouse affecting container deployment during deployment.
[0066] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 After step S30, the application image caching method further includes steps S40 to S50:
[0067] Step S40, querying the container event corresponding to the image cache Pod in the preset OCP cluster.
[0068] It should be understood that after the application image is pre-pulled and cached through the image cache Pod, the container event of the image cache Pod created by each image cache task can be queried in the above-mentioned preset OCP cluster to determine whether the application image corresponding to each image cache task has been pulled.
[0069] Step S50: If there is a pulled event in the container event, the cache status of the application image cache task corresponding to the image cache Pod is marked as a success status.
[0070] It is understandable that if the container event includes a Pulled event, it means that the pulling of the container image has been completed, and the status of the image cache task can be marked as a successful status, thereby identifying the status of the image pulling.
[0071] In a feasible implementation manner, after step S50, steps S60 to S70 may also be included:
[0072] Step S60, determining whether the cache status identifier corresponding to the application image cache task is in a success state.
[0073] It should be emphasized that although the image cache Pod occupies less CPU and memory resources, it is still necessary to delete the image cache Pod in time after detecting the success of caching, so as not to occupy resources for a long time and affect normal scheduling and deployment. Whether the caching is successful can be determined by judging whether the cache status flag corresponding to the application image cache task is in the success state.
[0074] Step S70: If the status is successful, the image cache Pod corresponding to the application image cache task is deleted.
[0075] It is understandable that for image cache tasks with a successful status, the corresponding image cache Pod needs to be deleted in time to avoid occupying resources for a long time and affecting normal container deployment.
[0076] In this implementation, it is determined whether the cache status identifier corresponding to the application image cache task is a success state; if it is a success state, the image cache Pod corresponding to the application image cache task is deleted, so that the image cache Pod can be cleared in time to avoid long-term resource occupation affecting normal scheduling and deployment.
[0077] In a feasible implementation, step S70 may include steps S701 to S702:
[0078] Step S701, setting a delete attribute tag in the YAML file.
[0079] It is worth noting that in order to quickly delete the image cache Pods that have completed their tasks, you can perform batch deletion. You can set the deletion attribute label under metadata.label s in the YAML file that describes the image cache Pod container configuration.
[0080] Step S702: If the status is successful, the Pods whose values of the deletion attribute tags in the YAML file are preset values are deleted in batches.
[0081] It is understandable that when deleting the image cache Pod, the labelSelector feature can be used to batch delete the Pods whose deletion attribute labels in the YAML file have the preset value, thereby ensuring that the image cache Pods are cleaned up in a timely manner.
[0082] In this implementation manner, by setting a deletion attribute tag in the YAML file, if the status is successful, the Pods whose values of the deletion attribute tags in the YAML file are preset values are deleted in batches, thereby ensuring that the image cache Pods are cleaned up in time.
[0083] In a feasible implementation manner, after step S70, steps S80 to S90 may also be included:
[0084] Step S80, when the time point for executing the business logic of the end-of-day application is reached, the target deployment node is determined according to the resource scheduling algorithm.
[0085] Step S90: deploying a target container on the target deployment node according to the target application image through the preset OCP cluster, so that the end-of-day application executes business logic on the target container.
[0086] It should be understood that the main execution process of the image cache task includes: image cache task generation, creation of image cache Pod cache image, application image cache result query, image cache Pod cleanup, etc. In this way, each end-of-day application image is pre-pulled on each node that meets the deployment resource type set by it. When the time point when the end-of-day application should actually start executing the business logic is reached, the resource scheduling algorithm is selected according to the process, and the target deployment node is determined according to the resource scheduling algorithm. Then, the target container is deployed on the target deployment node according to the target application image through the preset OCP cluster.
[0087] It is understandable that no matter which node the end-of-day application is ultimately scheduled to execute on, the locally cached application image can be used when creating the container, without having to pull it from the image repository, thereby speeding up container deployment. In addition, another beneficial effect of pre-pulling images in advance is to prevent network congestion or other failures in the image repository from causing image pulling failures when the end-of-day application really needs to be scheduled for execution, thereby affecting the execution of the end-of-day application. Therefore, the image pre-pulling scheme proposed in this embodiment can not only speed up container deployment, but also prevent container deployment failures caused by image repository failures during end-of-day container deployment.
[0088] In this embodiment, the container event corresponding to the image cache Pod is queried in the preset OCP cluster; if there is a pulled event in the container event, the cache status of the application image cache task corresponding to the image cache Pod is marked as a successful status, and the image cache Pod corresponding to the application image cache task in the successful status is deleted, so that the image cache Pod that has completed the task can be cleared in time to avoid occupying memory and resources.
[0089] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Figure 3 , step S10, the application image caching method further includes steps S101 to S103:
[0090] Step S101 , monitoring the number of times and time points of executing the application publishing process, and determining a peak time period for image pulling according to the number of times and the time points.
[0091] It is understandable that since the image cache task needs to create an image cache Pod in the cluster, and the normal scheduled execution of the end-of-day application also needs to create a Pod in the cluster, although the image cache Pod only applies for a small amount of CPU and memory resources, there is still a risk of occupying the resources required for the normal scheduling and deployment of the end-of-day application Pod. Therefore, this embodiment recommends setting a reasonable time period for executing the image cache task based on the actual business scenario.
[0092] It should be understood that the peak time period for image pulling can be determined based on the number and time points of monitoring the number of times and time points of executing the application release process in combination with historical experience. For example, it is monitored that 19:00-22:00 in the evening is the peak time period for application releases, and the number of releases is large and concentrated, which means that there will be more requests to pull images from the image repository during this period, so this time period can be determined as the peak time period for image pulling.
[0093] Step S102, determining a cache task execution time period according to the peak time period of image pulling and the peak time period of end-of-day application running.
[0094] It should be noted that in addition to determining the peak time period for image pulling, you can also monitor the peak time period for end-of-day application operation. For example, monitoring that 21:00 pm to 02:00 am the next day is the peak time period for end-of-day application operation means that there is a high demand for cluster resources during this period. Therefore, after determining the peak time period for image pulling and the peak time period for end-of-day application operation, you can comprehensively determine the cache task execution time period. The cache task execution time period should avoid the peak time period for image pulling and the peak time period for end-of-day application operation, so as to ensure the success rate of application image pulling. For example, you can select any time period between 04:00 and 18:00 every day to perform the image cache task.
[0095] Step S103, when it is detected that the application publishing process of the end-of-day application is completed and it is in the cache task execution time period, an application image cache task is generated according to the application image address generated by the application publishing process and the platform deployment resource type.
[0096] In this embodiment, the peak time period for image pulling is determined by monitoring the number of times and time points of executing the application publishing process; the cache task execution time period is determined according to the peak time period for image pulling and the peak time period for end-of-day application operation; when it is detected that the application publishing process of the end-of-day application is completed and is in the cache task execution time period, an application image cache task is generated according to the application image address generated by the application publishing process and the platform deployment resource type, thereby avoiding the peak time period for end-of-day application publishing and operation, reducing the resources required by the end-of-day application Pod occupied by the image cache Pod, and improving the efficiency of the image cache.
[0097] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the mirror caching method applied in the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0098] This application also provides an application image caching device, please refer to Figure 4 , the application image caching device comprises:
[0099] The image cache task generation module 10 is used to generate an application image cache task according to the application image address and platform deployment resource type generated by the application release process when detecting that the application release process of the end-of-day application is completed;
[0100] The image cache Pod creation module 20 is used to create an image cache Pod on the node corresponding to the application image cache task in the preset OCP cluster;
[0101] The target application image caching module 30 is used to cache the target application image corresponding to the application image caching task according to the image caching Pod.
[0102] The application image caching device provided by the present application adopts the application image caching method in the above embodiment to solve the technical problem. Compared with the prior art, the beneficial effects of the application image caching device provided by the present application are the same as the beneficial effects of the application image caching method provided by the above embodiment, and other technical features in the application image caching device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0103] The present application provides an application image caching device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the application image caching method in the above-mentioned embodiment 1.
[0104] Reference below Figure 5 , which shows a schematic diagram of the structure of an application image caching device suitable for implementing an embodiment of the present application. The application image caching device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The application image cache device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0105] like Figure 5As shown, the application image cache device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Me mory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the application image cache device are also stored in RAM1004. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the application image cache device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an application image cache device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.
[0106] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0107] The application image caching device provided by the present application adopts the application image caching method in the above embodiment, which can solve the technical problem of application image caching. Compared with the prior art, the beneficial effects of the application image caching device provided by the present application are the same as the beneficial effects of the application image caching method provided by the above embodiment, and other technical features in the application image caching device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0108] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0110] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the application image caching method in the above-mentioned embodiment.
[0111] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0112] The computer-readable storage medium may be included in the application image cache device; or may exist independently without being assembled into the application image cache device.
[0113] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the application image cache device, the application image cache device: generates an application image cache task according to the application image address and platform deployment resource type generated by the application release process when detecting that the application release process of the end-of-day application is completed; creates an image cache Pod on the node corresponding to the application image cache task in the preset OCP cluster; and caches the target application image corresponding to the application image cache task according to the image cache Pod.
[0114] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0116] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0117] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned application image caching method, and can solve technical problems. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the application image caching method provided in the above-mentioned embodiment, and will not be repeated here.
[0118] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned application image caching method when executed by a processor.
[0119] The computer program product provided by the present application can solve the technical problem. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the application image caching method provided by the above embodiment, which will not be described in detail here.
[0120] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An application image caching method, characterized in that: The method includes: When the application publishing process of the end-of-day application is detected to be completed, an application image cache task is generated according to the application image address generated by the application publishing process and the platform deployment resource type; Create an image cache Pod on the node corresponding to the application image cache task in the preset OCP cluster; The target application image corresponding to the application image cache task is cached according to the image cache Pod.
2. The method according to claim 1, characterized in that The step of caching the target application image corresponding to the application image cache task according to the image cache Pod includes: The image path to be cached is set in the YAML file corresponding to the image cache Pod, where the YAML file is a file describing the container configuration of the image cache Pod; The target application image corresponding to the application image cache task is cached according to the image cache Pod and the YAML file.
3. The method according to claim 2, characterized in that After the step of caching the target application image corresponding to the application image cache task according to the image cache Pod and the YAML file, the method further includes: Querying the container event corresponding to the image cache Pod in the preset OCP cluster; If there is a pulled event in the container event, the cache status of the application image cache task corresponding to the image cache Pod is marked as a success status.
4. The method according to claim 3, characterized in that After the step of marking the cache status of the application image cache task corresponding to the image cache Pod as a success status if there is a pulled event in the container event, the method further includes: Determine whether the cache status identifier corresponding to the application image cache task is a success status; If it is a success state, the image cache Pod corresponding to the application image cache task is deleted.
5. The method according to claim 4, characterized in that If the status is successful, the step of deleting the image cache Pod corresponding to the application image cache task includes: Setting a delete attribute tag in the YAML file; If the status is successful, the Pods whose values of the deletion attribute labels in the YAML file are preset values are deleted in batches.
6. The method according to claim 4, characterized in that If the state is successful, after the step of deleting the image cache Pod corresponding to the application image cache task, the method further includes: When the time point of executing the business logic of the end-of-day application is reached, determining the target deployment node according to the resource scheduling algorithm; The target container is deployed on the target deployment node according to the target application image through the preset OCP cluster, so that the end-of-day application executes business logic on the target container.
7. The method according to claim 1, characterized in that The step of generating an application image cache task according to the application image address and platform deployment resource type generated by the application release process when the application release process of the end-of-day application is detected to be completed includes: Monitor the number and time points of executing the application release process, and determine the peak time period for image pulling based on the number and time points; Determine the cache task execution time period according to the peak time period of image pulling and the peak time period of end-of-day application operation; When it is detected that the application publishing process of the end-of-day application is completed and it is in the cache task execution time period, an application image cache task is generated according to the application image address generated by the application publishing process and the platform deployment resource type.
8. An application image caching device, characterized in that: The application image caching device comprises: An image cache task generation module is used to generate an application image cache task according to the application image address and platform deployment resource type generated by the application release process when detecting that the application release process of the end-of-day application is completed; An image cache Pod creation module is used to create an image cache Pod on a node corresponding to the application image cache task in a preset OCP cluster; The target application image cache module is used to cache the target application image corresponding to the application image cache task according to the image cache Pod.
9. An application image caching device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the application image caching method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the application image caching method according to any one of claims 1 to 7 are implemented.