A development platform image generation method, device, equipment and storage medium
By configuring a lazy image switch on the development platform and converting the OCI image to a lazy image, the performance and storage cost issues of the OCI image are resolved, improving container startup speed and optimizing resource efficiency to meet user needs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2024-09-30
- Publication Date
- 2026-07-07
Smart Images

Figure CN119336344B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically to a method, apparatus, device, and storage medium for generating an image of a development platform. Background Technology
[0002] In the development and design of the development platform, the image file used is the OCI (Open Container Initiative) image format. OCI images are a standard method for packaging and distributing container images. Users create development environments and train models using OCI images because, as a standard image, OCI images have good compatibility, are easy to integrate and maintain.
[0003] However, the OCI image currently has some issues, such as performance problems: each layer of the OCI image is stored as a file system rather than in contiguous large blocks, which can lead to performance issues, especially when reading a large number of small files. Furthermore, it results in high local storage costs because identical information between different layers is redundant during transmission and storage. The existence of this redundant information cannot be determined when the content is not being read, thus requiring certain storage resources to store the information and redundant data. Summary of the Invention
[0004] In view of this, the present invention provides a method, apparatus, device and storage medium for generating images of a development platform, so as to solve the performance problems and high storage resource consumption problems of OCI image generation.
[0005] In a first aspect, the present invention provides a method for image acceleration of a development platform, the method comprising:
[0006] Obtain the first development platform, which supports the loading and creation of the first image;
[0007] Configure a lazy image file on the first development platform to generate a second development platform containing a lazy image switch, and display the lazy image switch on the second development platform.
[0008] Receive user click on the lazy mirror switch;
[0009] In response to the operation, the creation of a lazy image file is triggered, the format of the first image is converted into a lazy image according to preset rules, and the lazy image is loaded into the image repository.
[0010] In conjunction with the first aspect, in one possible implementation, a lazy image file is configured on the first development platform to generate a second development platform containing a lazy image switch, including:
[0011] Obtain the installation package of the first development platform, wherein the installation package contains configuration information for at least one functional item of the first development platform;
[0012] Based on the configuration information of at least one functional item in the installation package, a configuration item for a lazy mirror switch is added, and a second development platform containing the lazy mirror switch is generated.
[0013] In conjunction with the first aspect, in another possible implementation, the configuration information for at least one functional item includes the nydus configuration item;
[0014] Based on the configuration information of at least one functional item in the installation package, a lazy mirroring switch configuration item is added, generating a second development platform containing the lazy mirroring switch, including:
[0015] Add a lazy image function to the nydus configuration item and generate a lazy image switch. The lazy image switch is used to trigger the format conversion function of the image file.
[0016] Add the lazy mirroring switch to the first development platform to generate a second development platform that includes the lazy mirroring switch.
[0017] In conjunction with the first aspect, in another possible implementation, the response to the operation, triggering the creation of a lazy image file, and converting the format of the first image to a lazy image according to preset rules, includes:
[0018] When a user clicks the lazy mirroring switch, an interface request for mirroring conversion is sent.
[0019] Read the first image file and obtain its format;
[0020] Determine whether the format of the first image file is OCI format;
[0021] If it is not in OCI format, an error message is returned, indicating that the first image format does not support format conversion;
[0022] If it is in OCI format, the cluster node selection process is triggered, and the current cluster information is displayed, which includes information about at least one cluster node.
[0023] Receive the user's selection operation on at least one cluster node in the current cluster information;
[0024] Based on the user's selection operation, the selected target node is obtained, and a communication link with the target node is established;
[0025] The first image file is downloaded to the target node using the communication link;
[0026] The first image file is converted to a different format on the target node to generate the lazy image.
[0027] In conjunction with the first aspect, in yet another possible implementation, the step of acquiring the selected target node and establishing a communication link with the target node includes:
[0028] Obtain the address of the selected target node;
[0029] Based on the address, an SSH link is established between the target node and the SSH network security protocol.
[0030] In conjunction with the first aspect, in another possible implementation, after converting the format of the first image to a lazy image according to preset rules, the method further includes:
[0031] Based on the format conversion process of the first image, generate logs and progress records;
[0032] The logs and progress records are then sent back to the second development platform.
[0033] In conjunction with the first aspect, in yet another possible implementation, the method further includes:
[0034] During the process of converting the format of the first image to a lazy image, the conversion progress is monitored in real time;
[0035] When the monitoring conversion reaches the threshold, the image acquisition refresh function is triggered;
[0036] The image list will be pulled from the image repository and displayed through the second development platform. The second development platform will simultaneously display the lazy image and the first image.
[0037] Secondly, the present invention provides an image generation device for a development platform, the device comprising:
[0038] The acquisition module is used to acquire the first development platform, which supports the loading and creation of the first image;
[0039] The configuration module is used to configure a lazy image file on the first development platform, generate a second development platform containing a lazy image switch, and display the lazy image switch on the second development platform.
[0040] The receiving module is used to receive the user's click on the lazy mirror switch;
[0041] The processing module is used to respond to the operation by triggering the creation of a lazy image file, converting the format of the first image into a lazy image according to preset rules, and loading the lazy image into the image repository.
[0042] Thirdly, the present invention provides a computer device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the image generation method of the development platform of the first aspect or any corresponding embodiment described above.
[0043] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the image generation method of the development platform of the first aspect or any corresponding embodiment described above.
[0044] Furthermore, the present invention provides a computer program product, including computer instructions for causing a computer to execute the image generation method of the development platform described in the first aspect or any corresponding embodiment.
[0045] The present invention provides a method, apparatus, and device for generating an image of a development platform, which has the following beneficial effects:
[0046] This method converts the first image into a lazy image and utilizes lazy loading technology, which significantly reduces the amount of data that needs to be loaded when the container starts, thereby greatly shortening the container startup time and significantly improving the container startup speed.
[0047] Lazy image technology reduces resource consumption (such as CPU, memory, network bandwidth, etc.) during container startup by loading image content on demand, reduces the load on the master node in the development platform, improves the overall resource utilization efficiency, and reduces operating costs.
[0048] This method provides users with flexible options by configuring a lazy image switch. Users can decide whether to enable the lazy image acceleration function according to their actual needs. The operation process is simplified: by directly displaying the lazy image switch on the development platform and allowing users to trigger the creation and loading of lazy images with simple clicks, this method greatly simplifies the operation process and reduces the learning cost and operational difficulty for users. Attached Figure Description
[0049] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0050] Figure 1 This is a flowchart illustrating a method for generating an image of a development platform according to an embodiment of the present invention.
[0051] Figure 2 This is a flowchart illustrating another method for generating an image of a development platform according to an embodiment of the present invention.
[0052] Figure 3 This is a flowchart illustrating another method for generating an image of a development platform according to an embodiment of the present invention;
[0053] Figure 4 This is a flowchart illustrating another method for generating an image of a development platform according to an embodiment of the present invention;
[0054] Figure 5 This is a structural block diagram of a development platform image generation device according to an embodiment of the present invention;
[0055] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] The technical solutions provided in this invention are applied to the field of computer technology, and particularly to an application scenario based on loading an image from a development platform. This application scenario includes devices such as servers, server clusters, node clusters, clients, and switches.
[0058] Furthermore, the application scenarios of this invention are also applicable to K8s (Kubernetes). K8s is an open-source system for automating the deployment, scaling, and management of containerized applications.
[0059] The technical solution of this invention involves loading image files including lazy images and OCI images. These two image files will be introduced first.
[0060] Lazy images and OCI images are two different container image formats, each with its own advantages and disadvantages. The OCI image format (Open Container Initiative) is a standard method for packaging and distributing container images. Its advantages include standardization, ease of integration, and ease of maintenance. Specifically, OCI is an open standard with multiple implementations and supporters. OCI images can be easily integrated into existing toolchains and platforms. Furthermore, OCI image layers are read-only, making them easy to manage. However, OCI images have disadvantages including performance and security issues. For example, the performance issue stems from the fact that each layer of an OCI image is stored as a file system block, rather than as a contiguous large block, which can lead to performance problems, especially when reading a large number of small files. The security issue arises because the metadata of OCI images is stored in plaintext, potentially leaking sensitive information about the image.
[0061] Lazy image refers to a simplified or automated image processing method, designed to reduce manual user operations and improve the ease of system deployment or recovery. It offers advantages such as high performance, high security, and low storage costs. Specifically, lazy-loaded images use a single-file system-like approach to store data, providing better read performance; furthermore, they employ encryption and verification mechanisms to ensure data security. Lazy-loaded images also utilize advanced data compression and caching mechanisms to reduce storage space usage.
[0062] The disadvantages of lazy-loaded images include: compatibility issues, such as the fact that lazy-loaded images are experimental projects and not as standardized and widely supported as OCI images; fewer available tools and integration projects compared to OCI images; and some performance penalty: lazy-loaded images require an additional caching layer to improve performance, which may result in some performance loss.
[0063] In addition, the technical solution of the present invention also involves the following technical terms, which are explained below.
[0064] Docker is an open-source application container engine that allows developers to package their applications and dependencies into a portable image, which can then be deployed to machines running any popular Linux or Windows operating system, and also enables virtualization.
[0065] Cluster nodes refer to the individual computers or servers that make up a cluster. They are independent entities within the cluster, and each node can run and process tasks independently. Cluster nodes include the master node. In Kubernetes, the master node is the cluster control node. Every Kubernetes cluster needs a master node to manage and control the entire cluster. Essentially, all Kubernetes control commands are sent to it, and it is responsible for the specific execution process. Therefore, some or all of the commands to be executed run on the master node. The master node typically occupies a dedicated server (for example, three servers are recommended for high availability deployments). Because it is the "brain" of the entire cluster, to prevent downtime or unavailability from causing management failures of server applications within the cluster, three or more servers are needed for redundancy backup.
[0066] The development platform currently only supports OCI format image files and does not support lazy loading of image files, thus failing to meet user needs. Furthermore, OCI format images suffer from high storage costs and performance degradation. Converting OCI images to lazy-loaded images consumes significant CPU and storage resources within the AI (Artificial Intelligence) platform. If this resource consumption occurs on the cluster master node, the AI platform will experience operational lag, consequently affecting its stability.
[0067] To address the aforementioned technical problems, this invention provides a method and apparatus for generating images for a development platform. This method optimizes essential components and configurations for cluster nodes in an AI platform, enabling the AI platform to support lazy-loaded image formats and image execution.
[0068] Furthermore, this method is applied to optimize the image management process of the AI platform, ensuring that specific OCI images can be converted into lazy-loaded images. At the same time, it also allows customers to choose cluster nodes to avoid the performance loss of CPU and memory on the AI platform during the conversion of OCI image format to lazy-loaded images, thus ensuring the performance and stability of the AI platform.
[0069] The technical solutions provided by the embodiments of the present invention will be described in detail below.
[0070] According to an embodiment of the present invention, an embodiment of a method for generating an image of a development platform is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0071] This embodiment provides a method for generating an image of a development platform, which can be used for the aforementioned client or cluster nodes, such as the master node. Figure 1 This is a flowchart of a development platform image generation method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes:
[0072] Step S101: Obtain the first development platform, which supports the loading and creation of the first image.
[0073] The first development platform can be an AI platform. Furthermore, this development platform can provide training scenarios for deep learning development, comprehensively integrating AI computing resources, training data resources, and AI development tools. In addition, it constructs an agile and efficient integrated AI development platform for AI research and development, providing high-performance computing power support and improving model development efficiency through agile and standardized development processes. In this embodiment, the development platform is used to provide high-performance AI computing resources, more specifically, to provide cluster node resources.
[0074] Optionally, the first image is an OCI image (such as a PyTorch image).
[0075] One implementation of this step involves acquiring a first development platform during image management and maintenance. This first development platform supports loading OCI images, meaning the AI platform can receive and recognize OCI format image files and then load them into the platform's container environment, ensuring that the file system and configuration information in the image are correctly applied to the container. The development platform's support for creating OCI images indicates that the AI platform provides the tools and processes for building OCI images. Developers can use these tools, along with Dockerfiles or other build scripts, to package their applications and dependencies into OCI format images. These images can then be uploaded to a container image repository for other users to download and use.
[0076] Step S102: Configure the lazy image file on the first development platform, generate a second development platform containing the lazy image switch, and display the lazy image switch on the second development platform.
[0077] Lazy images (or simply lazy images) refer to images used to delay the loading of certain parts or components of a container image until they are actually needed. Lazy images can be used to optimize resource usage and reduce startup time, especially when the container image is large or contains infrequently used components.
[0078] In this step, based on the first development platform, the essential components and configurations of the AI platform's cluster nodes are upgraded to support lazy-loaded images. This includes upgrading the essential components for lazy-loaded image loading in the AI platform's cluster nodes; modifying the global configuration items in the installation package to add a lazy-loaded image switch; and establishing a unified Docker directory for storing lazy-loaded images within the cluster.
[0079] To identify whether the AI platform supports lazy loading images, a configuration item for a lazy loading image switch has been added to the global configuration file of the AI platform's installation package, such as LAZY_LOAD=1.
[0080] After configuring the lazy image file, a lazy image switch is generated, adding a switch (or checkbox, button, or other control) to the development platform's user interface (UI) or management interface, allowing users to enable or disable the lazy image feature. This switch provides users with flexibility, allowing them to decide whether to load the lazy image based on their needs and preferences.
[0081] Step S103: Receive the user's click on the lazy mirror switch.
[0082] The client detects in real time whether the user clicks the lazy mirror switch.
[0083] Step S104: In response to the operation, trigger the creation of a lazy image file, convert the format of the first image to a lazy image according to preset rules, and load the lazy image into the image repository.
[0084] Specifically, when a user click is received, a lazy image file creation process is triggered and executed. In this process, the format of the first image file is converted into a lazy image file according to preset rules. The preset rules include converting the first image file into a second image file. In this embodiment, the first image file is an OCI image file, and the second image file is a lazy image file.
[0085] Preset rules may be based on various factors such as specific image attributes (e.g., size, component type), user preferences, and performance considerations. Furthermore, the conversion process may involve analyzing the image content to determine which parts can be lazily loaded, and then modifying the image structure or adding necessary metadata to implement the lazy loading functionality.
[0086] After creating the lazy image, upload (pull) the newly generated image to the image repository. An image repository is a centralized location for storing and managing container images, accessible and usable by multiple users or systems. The loading process typically involves uploading the lazy image file to the repository's server and recording relevant information (such as image name, version, tags, etc.) in the repository's database.
[0087] The image generation method provided in this embodiment has the following beneficial effects:
[0088] 1. This method converts the first image into a lazy image and utilizes lazy loading technology, which significantly reduces the amount of data that needs to be loaded when the container starts, thereby greatly shortening the container startup time and significantly improving the container startup speed.
[0089] 2. Lazy image technology reduces resource consumption (such as CPU, memory, network bandwidth, etc.) during container startup by loading image content on demand, which reduces the load on the master node in the development platform, improves the overall resource utilization efficiency, and reduces operating costs.
[0090] 3. This method provides users with flexible options by configuring a lazy image switch. Users can decide whether to enable the lazy image acceleration function according to their actual needs. Simplified operation process: By directly displaying the lazy image switch on the development platform and allowing users to trigger the creation and loading of lazy images with simple clicks, this method greatly simplifies the operation process and reduces the learning cost and operational difficulty for users.
[0091] In one possible implementation of this embodiment, such as Figure 2 As shown, in step S102 above: configuring a lazy image file on the development platform to generate a development platform containing a lazy image switch, specifically includes:
[0092] Step S102-1: Obtain the installation package of the first development platform, which contains configuration information for at least one functional item of the first development platform.
[0093] Step S102-2: Based on the configuration information of at least one functional item in the installation package, add a configuration item for a lazy mirror switch to generate a second development platform containing the lazy mirror switch.
[0094] Furthermore, the configuration information for the at least one functional item includes nydus configuration items. Specifically, nydus can be configured as an image acceleration framework. When nydus is used as an image acceleration framework, its configuration mainly focuses on image storage, caching, and network communication. For example, some key configuration information includes:
[0095] Storage configuration: data_dir: Specifies the data storage directory for storing image data. cache_size: Sets the cache size to optimize image loading speed.
[0096] Network communication configuration: listen_address: Specifies the listening address and port of the nydus service so that the container runtime or other components can communicate with it.
[0097] Mode Selection: nydus configuration supports multiple operating modes, such as FUSE mode, VirtioFS mode, and EROFS mode. Users can choose the appropriate operating mode according to their specific needs.
[0098] Configuration file: For image acceleration frameworks, nydus typically requires a configuration file (such as nydusd-config.json) to specify the above configuration options. Users need to edit the configuration file according to their actual needs to meet specific deployment requirements.
[0099] Step S102-2 above: Based on the configuration information of at least one functional item in the installation package, add a configuration item for a lazy mirror switch to generate a second development platform containing the lazy mirror switch, specifically including:
[0100] Add a lazy image function to the nydus configuration items and generate a lazy image switch. The lazy image switch is used to trigger the format conversion function of the image file. Add the lazy image switch to the first development platform to generate a second development platform containing the lazy image switch.
[0101] In this embodiment, by adding a lazy image function to the nydus configuration item, a new lazy image is added to the original development platform, so that the new development platform can support both OCI images and lazy images.
[0102] In another possible implementation, the development platform of this embodiment also supports the creation of lazy-loaded images.
[0103] In the image management and maintenance process of the development platform, OCI has added a "Convert to lazy-loaded image" button / switch to all images. Customers can trigger lazy image creation by clicking the button / switch. After the customer clicks the button / switch, the development platform sends an interface request for image conversion.
[0104] Specifically, such as Figure 3 As shown, the above steps S103 and S104 specifically include:
[0105] Step S301: Upgrade cluster node components.
[0106] This step can be performed by either the server or the client. The cluster node can be a component of the cluster node in the aforementioned Kubernetes cluster, or it can be other cluster components; this embodiment does not impose any restrictions on this.
[0107] Step S302: Determine whether the lazy mirror switch is turned on.
[0108] Specifically, after steps S101 and S102 above, if the nydus configuration item is configured and a lazy mirroring function switch is added, the system will enable the lazy mirroring switch, for example, by lighting up the icon of the lazy mirroring switch on the UI interface. Alternatively, displaying the icon on the UI interface indicates that the lazy mirroring switch is enabled.
[0109] If enabled, proceed to step S303; if not enabled, proceed with the existing image management process.
[0110] Step S303: If the lazy mirroring switch is enabled, the format conversion process will be triggered.
[0111] When the system detects that a user has clicked the lazy image switch, it sends an interface request for image conversion. The system reads the first image file and obtains its format.
[0112] Step S304: Determine whether the format of the first image file is OCI format.
[0113] If yes, proceed to step S305; if not OCI format, return an error message indicating that the first image format does not support format conversion.
[0114] It should be understood that this embodiment uses the first image format, namely the OCI format, as an example. Other formats are also possible, and this embodiment does not limit them.
[0115] Step S305: If it is in OCI format, the cluster node selection process is triggered, and the current cluster information is displayed, which includes information about at least one cluster node.
[0116] If the image format is an OCI image, the next event is triggered: selecting a cluster node. This selection can be made by the user or automatically by the system according to a predefined procedure. In this embodiment, it is assumed that the user makes the selection; the specific process is described in step S306 below.
[0117] Step S306: Receive the user's selection operation of at least one cluster node in the current cluster information.
[0118] Customers can see the total amount and usage of CPU and memory in the non-master nodes of the current cluster in the UI interface. Users can select a node with relatively sufficient resources from these non-master nodes to perform the format conversion.
[0119] Step S307: Based on the user's selection operation, obtain the selected target node and establish a communication link with the target node.
[0120] Specifically, obtaining the selected target node and establishing a communication link with the target node includes: obtaining the address of the selected target node; establishing an SSH link with the target node according to the address and in accordance with the SSH network security protocol.
[0121] SSH (Secure Shell) is an encrypted network protocol used to securely access remote computers in insecure networks. It connects to a selected Node. This embodiment does not provide specific details on the encryption and decryption process using SSH keys or the establishment of an SSH link.
[0122] In this step, an SSH link is used to connect to the selected target node, where a format conversion script is executed.
[0123] Step S308: Download the first image file to the target node using the communication link.
[0124] Specifically, the first image format (OCI image) is downloaded to the target node, preparing for the format conversion process.
[0125] Step S309: Convert the format of the first image file on the target node to generate a lazy image.
[0126] For example, perform format conversion on the target node to generate a lazy-loaded image, and name the lazy-loaded image using a combination of "source image name + -lazy".
[0127] Step S310: Upload (pull) the lazy image to the image repository.
[0128] Optionally, after step S307 above, the method further includes: generating logs and progress records according to the format conversion process of the first image; and sending the logs and progress records back to the second development platform.
[0129] Step S311: Determine whether the format conversion is complete.
[0130] Step S312: If so, the second development platform will re-pull the image from the image repository.
[0131] In this embodiment, during the image conversion process, when using the second development platform to convert lazy-loaded images, customers can independently select cluster nodes to handle the CPU and memory consumption during the format conversion process. This distributes the CPU and memory resource usage of the cluster master node, reducing the resource consumption on the master node, and ensuring the stability of the development platform's operation.
[0132] Furthermore, in another possible implementation, such as Figure 4As shown, after step S104 above, the method further includes:
[0133] Step S105: During the process of converting the format of the first image to a lazy image, monitor the conversion progress in real time.
[0134] Step S106: When the monitoring conversion reaches the threshold, the image acquisition refresh function is triggered.
[0135] For example, when the threshold is 100%, or greater than or equal to 95%, the refresh function is triggered.
[0136] Step S107: Pull the image list from the image repository and display the image list through the second development platform. At this time, the second development platform displays both the lazy image and the first image.
[0137] In one example, on the AI platform, once the image conversion progress reaches 100%, the image retrieval refresh function is triggered. The AI platform will then pull the image list from the image repository again and display it on the AI platform. Furthermore, after the OCI image imageA undergoes format conversion, a new lazy-loaded image imageA-lazy will be generated. At this point, both the OCI image imageA and the lazy-loaded image imageA-lazy exist simultaneously on the AI platform.
[0138] The method provided in this embodiment is based on the current development platform's image management. When the platform uses lazy-loaded images for image acceleration, users can create development environments using OCI images and lazy-loaded images converted from OCI images. This adds lazy image creation and uploading functions to the development platform, improves the platform's compatibility, and meets user needs.
[0139] Furthermore, comparing startup time, by comparing the difference in pod creation and startup times between the OCI image and the lazy-loaded image, it can be seen that the lazy-loaded image significantly reduces pod startup time. In addition, the overall speedup is improved by 96%, indicating that the lazy-loaded image reduces startup time by approximately 96% compared to the OCI image. Startup speed improvement: pod startup speed is 26.9 times faster than when using the OCI image.
[0140] Furthermore, when the platform uses the pytorch / yuan_base image to deploy the yuan-2b inference service on cluster nodes with NVIDIA-V100-16G and NFS shared storage model files, the pod startup time of the replica is reduced from 556 seconds to 30 seconds, resulting in an overall speedup improvement of 94%.
[0141] Regarding product support, since lazy-loaded images are an experimental project, they are not as standardized and widely supported as OCI, resulting in relatively poor compatibility. Therefore, this embodiment of the invention converts OCI images into lazy images, which are compatible with both lazy-loaded and OCI images. This allows users to choose between using either lazy-loaded or OCI images based on their actual needs, ensuring the integrity and ease of use of the overall functionality.
[0142] This embodiment also provides a development platform image generation apparatus, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0143] This embodiment provides a device for generating an image of a development platform, such as... Figure 5 As shown, the device includes: an acquisition module 510, a configuration module 520, a receiving module 530, and a processing module 540. In addition, the device may also include other modules such as a storage unit, and this embodiment does not limit this.
[0144] The acquisition module 510 is used to acquire the first development platform, which supports the loading and creation of the first image.
[0145] The configuration module 520 is used to configure a lazy image file on the first development platform, generate a second development platform containing a lazy image switch, and display the lazy image switch on the second development platform.
[0146] The receiving module 530 is used to receive the user's operation of clicking the lazy mirror switch.
[0147] The processing module 540 is used to respond to the operation by triggering the creation of a lazy image file, converting the format of the first image into a lazy image according to preset rules, and loading the lazy image into the image repository.
[0148] In some optional implementations, the configuration module 520 is specifically used to obtain the installation package of the first development platform, add a lazy mirroring switch configuration item according to the configuration information of at least one functional item in the installation package, and generate a second development platform containing the lazy mirroring switch. The installation package contains configuration information for at least one functional item of the first development platform.
[0149] In some optional implementations, the configuration information for at least one of the above-mentioned functional items includes a nydus configuration item. Specifically, the configuration module 520 is further configured to add a lazy image function to the nydus configuration item, generate a lazy image switch, which is used to trigger the format conversion function of the image file; add the lazy image switch to the first development platform, and generate a second development platform containing the lazy image switch.
[0150] Optionally, in some other alternative implementations, the processing module 540 is specifically configured to send an interface request for image conversion when it detects that a user has clicked the lazy image switch; read the first image file and obtain the format of the first image file.
[0151] Determine whether the format of the first image file is OCI format; if it is not OCI format, return an error message, which indicates that the first image format does not support format conversion; if it is OCI format, trigger the cluster node selection process and display the current cluster information, which includes relevant information of at least one cluster node.
[0152] The receiving module 530 is also configured to receive the user's selection operation on at least one cluster node in the current cluster information.
[0153] The processing module 540 is further configured to: obtain the selected target node according to the user's selection operation; establish a communication link with the target node; download the first image file to the target node using the communication link; and perform format conversion on the first image file on the target node to generate a lazy image.
[0154] Optionally, in some other implementations, the acquisition module 510 is also configured to acquire the address of the selected target node.
[0155] Processing module 540 is used to establish an SSH link with the target node based on the address and in accordance with the SSH network security protocol.
[0156] Optionally, in some other implementations, the processing module 540 is further configured to generate logs and progress records based on the format conversion process of the first image; and to send the logs and progress records back to the second development platform.
[0157] Optionally, in some further embodiments, the above-described apparatus also includes a monitoring module, which monitors... Figure 5 Not shown in the image.
[0158] The monitoring module is used to monitor the conversion progress in real time during the process of converting the format of the first image to a lazy image; when the monitored conversion reaches a threshold, the image acquisition refresh function is triggered.
[0159] The processing module 540 is also used to pull a list of images from the image repository and display the list of images through the second development platform, which simultaneously displays lazy images and first images.
[0160] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0161] In this embodiment, the development platform image generation device is presented in the form of functional units. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0162] This invention also provides a computer device having the above-described features. Figure 5 The image generation device shown.
[0163] Please see Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processor can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces).
[0164] In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory units, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.
[0165] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0166] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to execute a method for generating an image of the development platform shown in the above embodiments.
[0167] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device.
[0168] In some alternative implementations, memory 20 may include memory remotely located relative to processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0169] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0170] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0171] The input device 30 can receive input digital or character information, and generate key signal inputs related to user settings and function control of the computer device, such as touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc.
[0172] The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED), and a haptic feedback device (e.g., a vibration motor). The display device includes, but is not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0173] In addition, the computer device includes at least one communication interface for communicating with other devices or communication networks.
[0174] This invention also provides a computer-readable storage medium in which the methods described in this invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and to be stored on a local storage medium after being downloaded via a network, so that the methods described herein can be stored on such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.
[0175] The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; furthermore, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the image generation method of the development platform shown in the above embodiments is implemented.
[0176] This invention provides a computer program product, which includes computer instructions for causing a computer to execute the image generation method of the development platform according to any embodiment of this invention.
[0177] The above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a platform image, characterized in that, The method includes: Obtain the first development platform, which supports the loading and creation of the first image; Configure a lazy image file on the first development platform to generate a second development platform containing a lazy image switch, and display the lazy image switch on the second development platform. The step of configuring a lazy image file on the first development platform to generate a second development platform containing a lazy image switch includes: obtaining an installation package of the first development platform, wherein the installation package contains configuration information for at least one functional item of the first development platform; adding a configuration item for a lazy image switch according to the configuration information of the at least one functional item in the installation package, and generating a second development platform containing the lazy image switch. The configuration information of the at least one functional item includes a nydus configuration item; the step of adding a lazy image switch configuration item based on the configuration information of the at least one functional item in the installation package, and generating a second development platform containing the lazy image switch, includes: adding a lazy image function to the nydus configuration item, generating a lazy image switch, the lazy image switch being used to trigger the format conversion function of the image file; adding the lazy image switch to the first development platform, and generating a second development platform containing the lazy image switch; Receive user click on the lazy mirror switch; In response to the operation, the creation of a lazy image file is triggered, the format of the first image is converted into a lazy image according to preset rules, and the lazy image is loaded into the image repository.
2. The method according to claim 1, characterized in that, The response to the operation triggers the creation of a lazy image file, converting the format of the first image to a lazy image according to preset rules, including: When a user clicks the lazy mirroring switch, an interface request for mirroring conversion is sent. Read the first image file and obtain its format; Determine whether the format of the first image file is OCI format; If it is not in OCI format, an error message is returned, indicating that the first image format does not support format conversion; If it is in OCI format, the cluster node selection process is triggered, and the current cluster information is displayed, which includes information about at least one cluster node. Receive the user's selection operation on at least one cluster node in the current cluster information; Based on the user's selection operation, the selected target node is obtained, and a communication link with the target node is established; The first image file is downloaded to the target node using the communication link; The first image file is converted to a different format on the target node to generate the lazy image.
3. The method according to claim 2, characterized in that, The step of acquiring the selected target node and establishing a communication link with the target node includes: Obtain the address of the selected target node; Based on the address, an SSH link is established between the target node and the SSH network security protocol.
4. The method according to claim 1, characterized in that, After converting the format of the first image to a lazy image according to preset rules, the process further includes: Based on the format conversion process of the first image, generate logs and progress records; The logs and progress records are then sent back to the second development platform.
5. The method according to claim 4, characterized in that, The method further includes: During the process of converting the format of the first image to a lazy image, the conversion progress is monitored in real time; When the monitoring conversion reaches the threshold, the image acquisition refresh function is triggered; The image list will be pulled from the image repository and displayed through the second development platform. The second development platform will simultaneously display the lazy image and the first image.
6. A device for generating an image of a development platform, characterized in that, The device includes: The acquisition module is used to acquire the first development platform, which supports the loading and creation of the first image; The configuration module is used to configure a lazy image file on the first development platform, generate a second development platform containing a lazy image switch, and display the lazy image switch on the second development platform. The configuration module configures a lazy image file on the first development platform to generate a second development platform containing a lazy image switch, including: obtaining an installation package of the first development platform, the installation package containing configuration information for at least one function item of the first development platform; adding a configuration item for a lazy image switch according to the configuration information of the at least one function item in the installation package, and generating a second development platform containing the lazy image switch. The configuration information of the at least one functional item includes a nydus configuration item; the configuration module adds a lazy image switch configuration item according to the configuration information of the at least one functional item in the installation package, and generates a second development platform containing the lazy image switch, including: adding a lazy image function to the nydus configuration item, generating a lazy image switch, the lazy image switch being used to trigger the format conversion function of the image file; adding the lazy image switch to the first development platform, and generating a second development platform containing the lazy image switch; The receiving module is used to receive the user's click on the lazy mirror switch; The processing module is used to respond to the operation by triggering the creation of a lazy image file, converting the format of the first image into a lazy image according to preset rules, and loading the lazy image into the image repository.
7. A computer device, characterized in that, include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other; The memory stores computer instructions, and the processor executes the computer instructions to perform the image generation method of the development platform according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions; The computer instructions are used to cause the computer to execute the image generation method of the development platform according to any one of claims 1 to 5.