Application Migration Method, Device, Equipment, Readable Storage Medium and Program Product
Create custom resources through custom controllers, and automate model transformation and mirror adaptation, solving the inefficiency and stability of migrating AI inference applications across heterogeneous resource pools, achieving efficient application migration and business continuity.
Patent Information
- Application Number
- CN202510592757.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-05-09
AI Technical Summary
Migrating AI inference applications across heterogeneous resource pools relies on manual operations, resulting in inefficiency, error-prone and affecting business continuity and stability.
Use custom controllers to create custom resources, including file conversion, image conversion and application migration resources, automate model transformation, image adaptation and data migration, and drive CRD-defined tasks through K8s Operator to achieve efficient migration of inference applications between different environments.
It realizes automated migration across heterogeneous resource pools, reduces manual dependencies, and ensures business continuity and stability.
Smart Images

Figure CN120104289B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and particularly to an application migration method, device, equipment, readable storage medium and program product. Background Art
[0002] At present, with the booming development of artificial intelligence (AI) technology and cloud native technology, more and more AI inference applications are moving towards cloud native deployment. This trend has significantly improved the operating efficiency, resource utilization and management flexibility of AI inference applications. However, during the upgrade of the container resource pool, it is often inevitable to replace the hardware of the computing nodes. Different models of computing devices have differences in architecture, computing power, video memory, etc., which makes the migration of AI inference applications across heterogeneous (using different models of computing devices) container resource pools a complex and challenging task.
[0003] Currently, the migration of AI inference applications across heterogeneous resource pools still relies on manual migration. This migration method requires operation and maintenance personnel to manually complete a series of cumbersome operations including shutting down the application program, backing up data, redeploying in the new environment, and configuring parameters. The entire migration process not only consumes a large amount of human and time costs, but also has extremely low efficiency. In addition, during the manual operation process, errors such as data loss and application failure to start normally due to configuration errors are very likely to occur due to negligence or operation mistakes. These problems seriously affect the continuity and stability of the business.
[0004] In summary, how to solve the problem of migrating inference applications across heterogeneous resource pools is a technical problem that needs to be urgently solved by those skilled in the art. Summary of the Invention
[0005] This application provides an application migration method, device, equipment, readable storage medium and program product to at least solve the problem of migrating inference applications across heterogeneous resource pools in related technologies.
[0006] This application provides an application migration method, including: creating custom resources corresponding to the inference application by using a custom controller; the custom resources include file conversion resources, image conversion resources and application program migration resources; using the file conversion resources to perform format conversion on the original model file of the inference application to obtain a target model file in an open file format; using the image conversion resources to perform environment conversion on the application image of the inference application to obtain a target application image adapted to the target environment; using the application program migration resources to migrate the target model file, the target application image, the metadata of the inference application and the business data of the inference application to the target resource pool corresponding to the target environment.
[0007] The present application also provides an application migration device, including: a task management module, configured to create custom resources corresponding to an inference application by using a custom controller; the custom resources include file conversion resources, image conversion resources, and application program migration resources; a model transformation module, configured to use the file conversion resources to perform format conversion on the original model file of the inference application to obtain a target model file in an open file format; an image transformation module, configured to use the image conversion resources to perform environment conversion on the application image of the inference application to obtain a target application image adapted to a target environment; an application migration module, configured to use the application program migration resources to migrate the target model file, the target application image, the metadata of the inference application, and the service data of the inference application to a target resource pool corresponding to the target environment.
[0008] The present application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any one of the above application migration methods when executing the computer program.
[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored, and wherein the computer program implements the steps of any one of the above application migration methods when being executed by a processor.
[0010] The present application also provides a computer program product, including a computer program, and the computer program implements the steps of any one of the above application migration methods when being executed by a processor.
[0011] In this application, since the custom controller (K8s Operator) can implement functions such as lifecycle management, configuration management, and upgrade management of specific applications or services through CustomResource Definitions (CRDs) and Controllers. Specifically, the custom controller can monitor changes in custom resources and automatically adjust the status of related resources to meet expectations. For example, when a certain custom resource reaches a specific condition, it automatically triggers the creation or update of other resources. For the migration of inference applications, it mainly includes the migration of metadata, business data, model files, and application images. Before migrating the original model file, it needs to be transformed into an open file format; before the application image, it needs to be adapted to the target environment. Therefore, in this application, through the custom controller, custom resources corresponding to the inference application can be created; the custom resources include file conversion resources, image conversion resources, and application migration resources. Then, based on the file conversion resources, the format of the original model file of the inference application can be converted to obtain the target model file in the open file format; based on the image conversion resources, the application image of the inference application can be adapted to the environment to obtain the target application image adapted to the target environment; based on the application migration resources, the target model file, the target application image, the metadata of the inference application, and the business data of the inference application can be migrated to the target resource pool corresponding to the target environment. That is to say, the entire process can drive the tasks defined by the CRD through the custom controller, automatically complete model transformation, image adaptation, data migration, and application deployment, so as to ensure the efficient migration of the inference application between different environments. Therefore, this application can solve the technical problem of migrating inference applications across heterogeneous resource pools, achieve getting rid of the dependence on manual labor for cross-heterogeneous resource pool migration, and can ensure the continuity and stability of the business. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0013] Figure 1 It is a flowchart of the implementation of an application migration method in an embodiment of the present application;
[0014] Figure 2 It is a specific flowchart of the implementation of an application migration method in an embodiment of the present application;
[0015] Figure 3 It is a schematic diagram of an application migration device in an embodiment of the present application;
[0016] Figure 4 This is a schematic structural diagram of an electronic device in an embodiment of the present application;
[0017] Figure 5 This is a specific structural diagram of an electronic device in an embodiment of the present application. Detailed implementation manners
[0018] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0019] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0020] To enable those skilled in the art of this technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0021] In the present application, in order to realize the automatic cross-heterogeneous resource pool migration and inference application, a custom controller is mainly used to drive relevant tools to execute relevant tasks.
[0022] Among them, the custom controller can specifically be a K8s Operator. k8s-operator: An extension mechanism based on Kubernetes for automatically managing and operating complex applications and stateful services in a Kubernetes cluster. The Operator realizes functions such as life cycle management, configuration management, and upgrade management of a specific application or service through Custom Resource Definitions (CRDs) and a Controller. Kubernetes (K8s, where 8 replaces the 8 characters between the first letter K and the last letter s in Kubernetes, corresponding to the abbreviation of Kubernetes) is an open-source tool for managing containerized applications on multiple hosts in a cloud platform and is a container orchestration tool with advantages such as high availability and elastic scalability.
[0023] For custom resource-driven tasks, you can specifically refer to the relevant solutions for the supervision and management of custom resources by custom controllers. The following briefly explains the process of how a custom controller drives tasks: First, define custom resources: Use the Kubernetes resource definition language (YAML) or other relevant frameworks to define custom resources. For example, in Kubernetes, you can create a custom resource type by defining a CustomResourceDefinition (CRD), clarifying the architecture of the resource, the meaning of fields, etc. For example, define a custom resource named "TaskResource" that contains fields such as task name, description, and execution parameters.
[0024] Then, create an instance of the custom resource: Create a specific resource instance according to the defined custom resource type. Taking Kubernetes as an example, you can create an instance by writing a YAML file and using the kubectl apply -f command. For example, create a specific task instance, specify the task name as the data processing task, the description as cleaning and analyzing a certain batch of data, and set the corresponding execution parameters.
[0025] Write the controller: The controller is a component used to monitor and manage custom resources. Taking Kubernetes as an example, you can use a controller framework (such as Kubebuilder or Operator SDK) to write the controller code. The controller continuously monitors the status changes of custom resources. When it discovers that a new task instance is created or the status of an existing task instance changes, the controller will perform corresponding operations according to the preset logic. For example, start a specific task container according to the parameters in the task instance.
[0026] Associate the task execution component: Associate the controller with the actual task execution component. For example, in a containerized environment, the controller can call a container orchestration tool (such as Docker, Kubernetes) to create and start a container containing the task code according to the task definition in the custom resource, so that the task can be executed in the container.
[0027] Finally, monitor and feedback: During the task execution process, continuously monitor the status and execution results of the task. You can add functions such as log output and status reporting in the task execution component to feedback the running situation of the task to the controller, and the controller then updates the status of the custom resource according to the feedback information for subsequent management and decision-making.
[0028] Please refer to Figure 1 , Figure 1It is a flowchart of the implementation of an application migration method in an embodiment of the present application. The method includes: S101. Using a custom controller, create custom resources corresponding to the inference application.
[0029] Among them, the custom resources include file conversion resources, image conversion resources, and application migration resources.
[0030] Among them, the inference application can specifically be an AI inference application, which can specifically be an application related to the knowledge and inference algorithms corresponding to specific different scenarios such as medical diagnosis, financial risk assessment, intelligent customer service, industrial fault diagnosis and prediction, smart home control, and intelligent transportation. Among them, the inference application corresponding to medical diagnosis: By analyzing data such as the patient's symptoms, medical records, and examination results, and applying medical knowledge and inference algorithms, it helps doctors make more accurate diagnoses; the inference application corresponding to financial risk assessment: Based on legally obtained data such as the customer's personal information, financial status, and credit record, using risk assessment models and inference methods, it assesses the customer's credit risk, fraud risk, etc., to help financial institutions make decisions; the inference application corresponding to intelligent customer service: Based on natural language processing technology, it understands the user's questions and extracts relevant answers from the existing knowledge base through knowledge inference to provide accurate services and support for users; the inference application corresponding to industrial fault diagnosis and prediction: It monitors and analyzes the operation data of industrial equipment in real time, applies fault diagnosis models and inference algorithms, discovers potential equipment faults in a timely manner, and predicts the time when the equipment faults occur, so as to take corresponding maintenance measures to reduce equipment downtime and production losses; the inference application corresponding to smart home control: According to data such as the user's habits and environmental sensors, it automatically adjusts the operation status of home devices through inference technology to achieve intelligent home control; the inference application corresponding to intelligent transportation: By analyzing traffic flow data, road conditions information, vehicle sensor data, etc., it performs traffic flow prediction, road condition analysis, intelligent signal control, etc. through inference algorithms to improve traffic efficiency and reduce congestion and traffic accidents.
[0031] When it is necessary to migrate the inference application across heterogeneous resource pools, a custom controller can be used to create custom resources corresponding to the inference application.
[0032] In a specific implementation manner of the present application, before executing step S101, it further includes: monitoring the device status of the resource pool where the inference application runs; in the case of detecting a faulty device and the faulty device affects the operation of the inference application, shutting down the inference application; backing up the metadata, business data, original model files, and application images of the inference application; after the backup is completed, obtaining the configuration information of the destination resource pool; correspondingly, using the custom controller and combining the configuration information of the destination resource to create custom resources corresponding to the inference application.
[0033] In this way, by monitoring the device status of the resource pool where the inference application runs, faulty devices affecting the operation of the inference application can be detected in a timely manner, so that the inference application can be shut down in time and the relevant data content can be backed up in time. Backing up the data can reduce the probability of data loss during the period from the data migration process to the business restart. After the backup is completed, the configuration information of the destination resource pool can be obtained. In this way, based on the configuration information of the destination resource pool, the custom resources adapted to be migrated to the destination resource pool can be defined, thereby reducing the probability of migration failure and shortening the business interruption time as much as possible.
[0034] Since migrating an inference application requires migrating its metadata, business data, original model files, and application images. Moreover, for the original model files, format conversion needs to be performed first before migration, and for the application images, they need to be modified to adapt to the target environment. Therefore, in this embodiment, the custom resources include file conversion resources, image conversion resources, and application migration resources. Among them, the file conversion resources are used to drive file conversion tasks, the image conversion resources are used to drive image conversion tasks, and the application migration resources are used to drive application migration tasks.
[0035] That is to say, as Figure 2 shown, in this embodiment, after creating the custom resources using the custom controller, the tasks defined by the CRD can be driven subsequently, and the model modification, image adaptation, data migration, and application deployment can be automatically completed, thereby ensuring the efficient migration of the inference application between different environments.
[0036] In a specific implementation manner of this application, using the custom controller, the custom resources corresponding to the inference application are created, including: defining file conversion resources according to the model conversion resource type corresponding to the custom controller; obtaining the format information of the original model file before and after migration; and configuring the file conversion resources using the format information.
[0037] For ease of description, the above steps will be combined and described below.
[0038] By defining a CRD (Custom Resource Definition) of the OnnxConversion (model conversion resource) type, that is, defining a file conversion resource (such as my-onnx-conversion).
[0039] After defining the file conversion resources, they need to be configured. The configuration content includes but is not limited to the format information of the original model file before and after migration.
[0040] Specifically, the source model path (sourceModel.fileLocation), model format (such as PyTorch), target model save path (targetModel.fileLocation), ONNX operator set version (opsetVersion), and input shape (inputShape) can be configured. Thus, based on this file conversion resource, the task of transforming the original model file from the original format (such as PyTorch) to the ONNX (open file) format can be triggered.
[0041] Among them, the ONNX format is an open file format designed for machine learning, used to store trained models, enabling convenient model interaction and sharing between different deep learning frameworks. It provides a unified standard representation for models trained by different frameworks and solves the problem of model compatibility between different frameworks.
[0042] For example: The model file transformation task can be based on the file conversion resource (an OnnxConversion named my-onnx-conversion) defined by the following definition code: apiVersion: example.com / v1; kind:OnnxConversion; metadata: name: my-onnx-conversion; namespace: default; spec:sourceModel:fileLocation: " / path / to / source / model.pth"; format: "pytorch"; targetModel:fileLocation: " / path / to / target / model.onnx"; conversionOptions:opsetVersion: 13; inputShape: [1, 3, 224, 224].
[0043] The configuration instructions for the above definition are as follows.
[0044] Among them, the metadata part (metadata) includes: name: the name specified for this ONNX conversion task, which is my-onnx-conversion here and can be modified according to the actual situation.
[0045] namespace: specifies the namespace to which this custom resource belongs, which is set to default here.
[0046] The specification part (spec) includes: source model information (sourceModel).
[0047] fileLocation: The specific path of the original model file. In the example, it is / path / to / source / model.pth, which needs to be replaced with the actual source model file path.
[0048] format: The format of the original model file. Here, it is specified as pytorch. If using a model in other formats, it should be modified accordingly, such as tensorflow, caffe, etc.
[0049] Target model information (targetModel), including: fileLocation: The path where the converted ONNX model will be saved. In the example, it is / path / to / target / model.onnx, which should be changed to the actual desired save path.
[0050] Conversion options (conversionOptions), including: opsetVersion: Specify the version of the ONNX operator set. Here, it is set to 13 and can be adjusted according to requirements.
[0051] inputShape: The input shape of the model. Here, it is [1, 3, 224, 224], representing an input with a batch size of 1, 3 channels, and a height and width of 224 each. It should be modified according to the actual input requirements of the model.
[0052] In a specific implementation manner of this application, a custom resource corresponding to the inference application is created using a custom controller, including: converting the resource type according to the processor corresponding to the custom controller to define the image conversion resource; obtaining the environment information of the application image; and configuring the image conversion resource using the environment information.
[0053] For ease of description, the above steps will be combined and described below.
[0054] Through the custom controller, define the image conversion resource to create an ONNX transformation task for the application image, thereby realizing the transformation of the application image in the target environment. Specifically, through the MufsyGPUConversion (processor conversion resource type), define a CRD, that is, define an image conversion resource (such as my-mufsy-gpu-conversion).
[0055] Then, configure the environmental information for the image conversion resource. The environmental information includes, but is not limited to, the source image location (sourceImage.location), format (docker), target image storage location (targetImage.location), GPU type (NVIDIA, etc.), and target architecture (x86_64). Start the transformation of the application image to make it compatible with the target GPU and architecture.
[0056] For example: The application image transformation task can be based on the image conversion resource defined by the following definition code (a MufsyGPUConversion named my-mufsy-gpu-conversion): Application image ONNX transformation task: apiVersion: example.com / v1; kind: MufsyGPUConversion; metadata: name: my-mufsy-gpu-conversion; namespace: default; spec: sourceImage: location: "docker.io / myrepo / source-image:latest"; format: "docker"; targetImage: location: "docker.io / myrepo / target-image:converted"; format: "docker"; conversionOptions: gpuType: "NVIDIA"; targetArch: "x86_64".
[0057] The configuration instructions for the above definition are as follows: The metadata section (metadata) includes: name: The name specified for this cross-GPU conversion task, which is my-mufsy-gpu-conversion here and can be modified as needed.
[0058] namespace: Specifies the namespace to which this custom resource belongs, which is set to default here.
[0059] The specification section (spec) includes: Source image information (sourceImage), including: location: The location of the source image. Here, an image on Docker Hub is used as an example, and it should be replaced with the actual source image address when in use.
[0060] format: The format of the source image, which is docker here. If other formats, such as singularity, are used, it needs to be modified accordingly.
[0061] Target image information (targetImage), including: location: the location where the converted image is to be saved, also using the Docker Hub address example, which can be adjusted according to requirements.
[0062] format: the expected format of the target image, which is set to docker here.
[0063] Conversion options (conversionOptions), including: gpuType: specify the GPU type that the converted image is to be adapted to. Here, NVIDIA is selected, and it can also be set to AMD or Intel according to the actual situation.
[0064] targetArch: the target architecture, which is set to x86_64 here and can be modified to other architectures according to actual needs.
[0065] In a specific implementation manner of the present application, a custom resource corresponding to the inference application is created by using a custom controller, including: defining the application migration resource according to the application migration resource type corresponding to the custom controller; obtaining the application basic information, image mapping relationship, and model file mapping relationship of the inference application; and configuring the application migration resource by using the application basic information, image mapping relationship, and model file mapping relationship.
[0066] For ease of description, the above steps will be combined and described below.
[0067] Using a custom controller, by defining the application migration resource type, an inference application migration task is created. Specifically, by defining a CRD of the ApplicationMigration (application migration resource type) type, such as defining an application migration resource called my-app-migration. And configure the application migration resource, and configure it by using information including but not limited to the application basic information, image mapping relationship, and model file mapping relationship. For example, the application name (appName), version (appVersion), as well as the volume data (volumeData), image mapping (imageMapping), and model file mapping (modelMapping) relationships can be configured to overall plan the migration task.
[0068] Example: For the inference application migration task, the application migration resources can be defined based on the following defined code (an ApplicationMigration named my - app - migration): apiVersion: example.com / v1; kind: ApplicationMigration; metadata: name: my - app - migration; namespace: default; spec: metadataInfo: appName: "my - awesome - app"; appVersion: "1.2.3"; volumeData: - sourceVolume: " / data / source - volume - 1"; targetVolume: " / data / target - volume - 1"; - sourceVolume: " / data / source - volume - 2"; targetVolume: " / data / target - volume - 2"; imageMapping: - sourceImage: "dockerhub.io / source - image:1.0"; targetImage: "dockerhub.io / target - image:1.0 - migrated"; - sourceImage: "dockerhub.io / source - image - alt:1.0"; targetImage: "dockerhub.io / target - image - alt:1.0 - migrated"; modelMapping: - sourceModelFile: " / models / source - model - 1.pth"; targetModelFile: " / models / target - model - 1.pth"; - sourceModelFile: " / models / source - model - 2.pth"; targetModelFile: " / models / target - model - 2.pth".
[0069] The configuration description for the above definition is as follows.
[0070] The metadata part, including: name: the name of the custom resource, here it is my - app -migration, which can be named according to the actual migration task.
[0071] namespace: specifies the namespace to which the resource belongs, here the default namespace is used.
[0072] The spec part, including: metadataInfo, metadata information, including: appName: the name of the application to be migrated, here it is my - awesome - app.
[0073] appVersion: the version number of the application, e.g., 1.2.3.
[0074] volumeData, an array, and each element represents the corresponding relationship of a volume data migration.
[0075] sourceVolume: the path or identifier of the source volume.
[0076] targetVolume: the path or identifier of the target volume.
[0077] imageMapping: an array, and each element represents the corresponding relationship between the source image and the target image.
[0078] sourceImage: the address of the source container image.
[0079] targetImage: the address of the target container image after migration.
[0080] modelMapping: an array, and each element represents the corresponding relationship between the original model file and the target model file.
[0081] sourceModelFile: the path of the original model file.
[0082] targetModelFile: the save path of the target model file.
[0083] S102. Use the file conversion resource to convert the format of the original model file of the inference application to obtain the target model file in an open file format.
[0084] Since the CRD can trigger tasks, in this embodiment, by using file conversion resources, the format conversion of the original model file of the inference application can be achieved, so as to obtain the target model file in an open file format. Specifically, it can be a custom controller that triggers a resource file conversion task based on the file conversion resources, thereby invoking a tool that can perform format conversion on the original model file to complete the file format conversion of the model file and finally obtain the target model file in an open file format.
[0085] In a specific implementation manner of this application, using file conversion resources to perform format conversion on the original model file of the inference application to obtain a target model file in an open file format includes: using file conversion resources to drive a file conversion task; where performing the file conversion task includes: obtaining the original model file from the source resource pool of the inference application; performing format conversion on the file format of the original model file to obtain the target model file in an open file format.
[0086] For ease of description, the above steps will be combined and described below.
[0087] The original model file of the inference application can be stored in the source resource pool. When it needs to be transformed, the original model file is first obtained from the source resource pool. Then, the file format of the original model file is converted to obtain the target model file in an open file format.
[0088] For example: After the original model file transformation task is triggered, an onnx transformation task is issued, and the system invokes relevant tools to perform model format conversion, and finally generates an ONNX model file.
[0089] S103. Using mirror conversion resources, perform environment conversion on the application mirror of the inference application to obtain a target application mirror adapted to the target environment.
[0090] Among them, the target environment can specifically be the architecture of the computing device at the target resource pool.
[0091] In this embodiment, mirror conversion resources can be used to transform the application mirror, so as to obtain a target application mirror adapted to the target environment.
[0092] In a specific implementation manner of this application, using mirror conversion resources to perform environment conversion on the application mirror of the inference application to obtain a target application mirror adapted to the target environment includes: using file conversion resources to drive a mirror transformation task; performing the mirror transformation task includes: obtaining the application mirror from the source image repository of the inference application; performing environment conversion on the application mirror to obtain a target application mirror adapted to the target environment.
[0093] For ease of description, the above steps will be combined and described below.
[0094] In this embodiment, based on the file conversion resources, the mirror transformation task can be driven. That is, the file conversion resources can drive the application mirror transformation tool to obtain the application mirror from the source mirror repository of the inference application. Then, the environment of the application mirror is transformed, and finally the target application mirror adapted to the target environment is obtained.
[0095] For example: after triggering the application mirror transformation task, issue the mirror transformation task, use the mirror migration tool to obtain the source mirror, perform the transformation, and generate the target application mirror adapted to the target environment.
[0096] After steps S102 and S103 are completed, step S104 can be executed. Steps S102 and S103 can be executed in any order, such as in parallel, or step S103 can be executed first and then step S102.
[0097] S104. Use the application migration resources to migrate the target model file, the target application mirror, the metadata of the inference application, and the business data of the inference application to the target resource pool corresponding to the target environment.
[0098] After the transformation of the original model file and the application mirror is completed, the target model file, the application mirror, the metadata, and the business data corresponding to the inference application can be migrated to the target resource pool corresponding to the target environment.
[0099] Specifically, during the migration process, different tools can be used for migration according to the differences of the migration objects. That is, the application migration resources can drive different tools to migrate the migration objects.
[0100] In a specific implementation manner of the present application, using the application migration resources to migrate the target model file, the target application mirror, the metadata of the inference application, and the business data of the inference application to the target resource pool corresponding to the target environment includes: using the application migration resources to drive the upload task, the migration task, and the pull task; among them, executing the upload task includes: uploading the target model file to the source model repository;
[0101] Uploading the target application mirror to the source mirror repository; uploading the metadata and the business data to the source object storage repository; executing the migration task includes: migrating the target model file from the source model repository to the destination model repository; migrating the target application mirror from the source mirror repository to the destination mirror repository; migrating the metadata and the business data from the source object storage repository to the destination object storage repository; executing the pull task includes: pulling the target application mirror from the destination mirror repository; pulling the target model file from the destination model repository; pulling the metadata and the business data from the object storage repository.
[0102] For ease of description, the above steps will be combined and described below.
[0103] In this embodiment, different migration modules can be set up to perform migrations of different objects. By issuing a migration task through the application migration resource, different migration modules can be driven to execute migrations. Specifically, the model file migration module, the image migration module, the application metadata migration module, and the application business data migration module are driven to execute migrations.
[0104] Among them, the model file migration module obtains the transformed target model file, and the image migration module obtains the transformed image. The application metadata migration module migrates metadata, and the application business data migration module migrates business data.
[0105] Specifically, regarding data storage and upload, it includes: uploading the transformed target model file to the model repository and storing it in the source model repository; uploading the transformed application image to the image repository and storing it in the source image repository.
[0106] Uploading metadata to the object storage and storing it in the Minio object storage; uploading business data to the object storage and also storing it in Minio to achieve centralized data storage.
[0107] Then, for data migration and destination resource pool processing, first, copy the transformed application image to the destination image repository and migrate it from the source image repository to the destination image repository; copy the transformed target model file to the destination model repository and migrate it from the source model repository to the destination model repository.
[0108] On the side of the destination resource pool, pulling and applying, including: pulling images and models: pulling the image file from the destination image repository and processing it by the image migration module; pulling the target model file from the destination model repository and processing it by the model file migration device; data and business restoration: pulling business data and metadata from the Minio object storage and respectively performing data restoration by the application business data migration module and the application metadata migration module. Finally, all migration components complete the automatic deployment and migration of the AI inference application in the destination resource pool through the migration task execution device, realizing the seamless operation of the application in the new environment.
[0109] Among them, migrating metadata and business data from the source object storage repository to the destination object storage repository includes: using a cross-engine version migration tool to migrate business data from the source object storage repository to the destination object storage repository; using a backup tool to back up metadata from the source object storage repository to the destination object storage repository.
[0110] Among them, migrating the target model file from the source model repository to the destination model repository includes: using a backup tool to back up the target model file from the source model repository to the destination model repository.
[0111] Among them, migrating the target application image from the source image repository to the destination image repository includes: using an image synchronization tool to synchronize the target application image from the source image repository to the destination image repository.
[0112] The task migration execution module completes the rapid and automatic migration of AI inference applications across heterogeneous resource pools through the combination and coordination of various tools. Define migration tasks, model file ONNX format transformation tasks, and application image transformation tasks through k8s-operator respectively.
[0113] Application metadata is migrated through the existing velero tool (backup tool); application business data is migrated using the existing restic tool (cross-engine version migration tool); the image migration module migrates images through the imageSync tool (image synchronization tool); the model file migration module also uses the existing restic tool for migration.
[0114] Among them, Velero is an open-source Kubernetes backup and restore tool that provides the function of automatically migrating across Kubernetes versions.
[0115] Restic is an open-source backup tool that can encrypt data and store it in various backend storage media.
[0116] The model file ONNX transformation module automatically converts models built by frameworks such as PyTorch and TensorFlow into a unified ONNX format by constructing model format conversion tasks to adapt to domestic GPUs (Graphic Processing Units).
[0117] The application image transformation and migration module automatically makes the AI inference application adapt to the ONNX format image by constructing model application transformation tasks. This step requires the GPU manufacturer to provide relevant tools, such as Musify from Moore Threads.
[0118] Among them, Musify is a GPU (compute node) migration tool from Moore Threads. It can quickly migrate the original CUDA (Compute Unified Device Architecture) code to the MUSA (Moore Threads' MUSA unified system architecture) platform, realizing automatic code conversion, allowing developers to use the code originally written based on CUDA on the MUSA architecture of Moore Threads, greatly reducing the difficulty and workload of code transplantation.
[0119] That is, the entire process drives the tasks defined by the CRD through the K8s Operator to automatically complete model transformation, image adaptation, data migration, and application deployment, ensuring the efficient migration of AI inference applications between different environments.
[0120] In a specific implementation manner of the present application, after migrating the target model file, the target application image, the metadata of the inference application, and the business data of the inference application to the target resource pool corresponding to the target environment by using the application to migrate resources, it further includes: running the inference application in the target resource pool by using the target application image, the target model file, the metadata, and the business data. That is to say, after completing the migration of the inference application, the inference application can be directly run in the target resource pool, which can ensure the continuity and stability of the service.
[0121] In the present application, since the custom controller (K8s Operator) can implement functions such as lifecycle management, configuration management, and upgrade management of specific applications or services through custom resource definitions (CustomResource Definitions, CRDs) and controllers (Controller). Specifically, the custom controller can monitor the changes of custom resources and automatically adjust the relevant resource states to meet the expectations. For example, when a certain custom resource reaches a specific condition, it automatically triggers the creation or update of other resources. For the migration of inference applications, it mainly includes the migration of metadata, business data, model files, and application images. Before migrating the original model file, it needs to be transformed into an open file format; before the application image, it needs to be adapted to the target environment. Therefore, in the present application, a custom resource corresponding to the inference application can be created through the custom controller; the custom resources include file conversion resources, image conversion resources, and application migration resources. Then, based on the file conversion resources, the format of the original model file of the inference application can be converted to obtain the target model file in an open file format; based on the image conversion resources, the application image of the inference application can be adapted to the environment to obtain the target application image adapted to the target environment; based on the application migration resources, the target model file, the target application image, the metadata of the inference application, and the business data of the inference application can be migrated to the target resource pool corresponding to the target environment. That is to say, the entire process can drive the tasks defined by the CRD through the custom controller to automatically complete model transformation, image adaptation, data migration, and application deployment, thereby ensuring the efficient migration of inference applications between different environments. Therefore, the present application can solve the technical problem of migrating inference applications across heterogeneous resource pools, achieve getting rid of the dependence on manual labor for cross-heterogeneous resource pool migration, and can ensure the continuity and stability of the service.
[0122] In a specific implementation manner of the present application, the following steps are performed in the K8s operator: obtain the custom resource name, namespace, and specification fields; based on the custom resource name, namespace, and specification fields, process the metadata information, volume data migration (such as calling the storage API, etc.), image migration (such as calling the container image service API, etc.), and target model file migration (such as file copy operation, etc.) in sequence; update the resource status.
[0123] That is to say, in practical applications, based on the K8s operator drive to implement the migration of the inference application, the custom resource can be directly obtained for management, thereby triggering the relevant content migration.
[0124] Through the description of the above implementation manners, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner.
[0125] The embodiment of the present application also provides an application migration device, and this application migration device can be referred to each other with the application migration method in the above text.
[0126] Please refer to Figure 3 , this application migration device includes: a task management module 301, which is used to create a custom resource corresponding to the inference application by using a custom controller; the custom resource includes a file conversion resource, an image conversion resource, and an application program migration resource; a model transformation module 302, which is used to use the file conversion resource to perform format conversion on the original model file of the inference application to obtain a target model file in an open file format; an image transformation module 303, which is used to use the image conversion resource to perform environment conversion on the application image of the inference application to obtain a target application image adapted to the target environment; an application migration module 304, which is used to use the application program migration resource to migrate the target model file, the target application image, the metadata of the inference application, and the business data of the inference application to the target resource pool corresponding to the target environment.
[0127] In a specific implementation manner of the present application, the task management module is specifically used to define the file conversion resource according to the model conversion resource type corresponding to the custom controller; obtain the format information before and after the migration of the original model file; and configure the file conversion resource by using the format information.
[0128] In a specific implementation manner of the present application, the task management module is specifically used to define the image conversion resource according to the processor conversion resource type corresponding to the custom controller; obtain the environment information of the application image; and configure the image conversion resource by using the environment information.
[0129] In a specific implementation manner of the present application, the task management module is specifically configured to migrate resource types according to the application corresponding to the custom controller, define the application migration resources; obtain the application basic information, image mapping relationship, and model file mapping relationship of the inference application; and configure the application migration resources by using the application basic information, image mapping relationship, and model file mapping relationship.
[0130] In a specific implementation manner of the present application, the model transformation module is specifically configured to drive the file conversion task by using the file conversion resources; where performing the file conversion task includes: obtaining the original model file from the source resource pool of the inference application; and converting the file format of the original model file to obtain the target model file in an open file format.
[0131] In a specific implementation manner of the present application, the image transformation module is specifically configured to drive the image transformation task by using the file conversion resources; performing the image transformation task includes: obtaining the application image from the source image repository of the inference application; and performing an environment conversion on the application image to obtain the target application image adapted to the target environment.
[0132] In a specific implementation manner of the present application, the application migration module is specifically configured to drive the upload task, migration task, and pull task by using the application migration resources; where performing the upload task includes: uploading the target model file to the source model repository; uploading the target application image to the source image repository; uploading the metadata and business data to the source object storage repository; performing the migration task includes: migrating the target model file from the source model repository to the destination model repository; migrating the target application image from the source image repository to the destination image repository; migrating the metadata and business data from the source object storage repository to the destination object storage repository; performing the pull task includes: pulling the target application image from the destination image repository; pulling the target model file from the destination model repository; pulling the metadata and business data from the object storage repository.
[0133] In a specific implementation manner of the present application, the application migration module is specifically configured to migrate the business data from the source object storage repository to the destination object storage repository by using the cross-engine version migration tool; and back up the metadata from the source object storage repository to the destination object storage repository by using the backup tool.
[0134] In a specific implementation manner of the present application, the application migration module is specifically configured to back up the target model file from the source model repository to the destination model repository by using the backup tool.
[0135] In a specific implementation manner of the present application, the application migration module is specifically configured to synchronize the target application image from the source image repository to the destination image repository by using the image synchronization tool.
[0136] In a specific embodiment of the present application, it further includes: a service operation module, which is configured to, after migrating the target model file, the target application image, the metadata of the inference application, and the service data of the inference application to the target resource pool corresponding to the target environment by using the application migration resources, run the inference application in the target resource pool by using the target application image, the target model file, the metadata, and the service data.
[0137] For the description of the features in the corresponding embodiment of the application migration device, reference can be made to the relevant description in the corresponding embodiment of the application migration method, which will not be elaborated here one by one.
[0138] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above application migration method embodiments.
[0139] See Figure 4 As shown, the electronic device includes:
[0140] A memory 332, which is used to store a computer program;
[0141] A processor 322, which is used to implement the steps of the application migration method in the above method embodiment when executing the computer program.
[0142] Specifically, please refer to Figure 5 , Figure 5 which is a schematic structural diagram of an electronic device provided in this embodiment. The electronic device may vary greatly due to configuration or performance differences, and may include one or more processors (central processing units, CPUs) (for example, one or more processors) and a memory 332. The memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 may be short-term storage or persistent storage. The program stored in the memory 332 may include one or more modules (not marked in the figure), and each module may include a series of instruction operations on the data processing device. Further, the processor 322 may be configured to communicate with the memory 332 and execute a series of instruction operations in the memory 332 on the electronic device.
[0143] The electronic device may further include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.
[0144] The steps in the above-described application migration method can be implemented by the structure of the electronic device.
[0145] Embodiments of the present application further provide a computer-readable storage medium storing a computer program, where the computer program is configured to execute the steps in any of the above-described embodiments of the application migration method when running.
[0146] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), external hard drives, magnetic disks, or optical discs that can store computer programs.
[0147] Embodiments of the present application further provide a computer program product. The above computer program product includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the application migration method.
[0148] Embodiments of the present application further provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the application migration method.
[0149] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.
[0150] The above has introduced in detail an application migration method, apparatus, device, readable storage medium, and program product provided by the present application. Specific examples are used herein to elaborate on the principles and implementation manners of the present application. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.
Claims
1. An application migration method, characterized in that, Including: Using a custom controller to create custom resources corresponding to the inference application; the custom resources include file conversion resources, image conversion resources, and application migration resources; Using the file conversion resources to perform format conversion on the original model file of the inference application to obtain a target model file in an open file format; Using the image conversion resources to perform environment conversion on the application image of the inference application to obtain a target application image adapted to the target environment; Using the application migration resources to migrate the target model file, the target application image, the metadata of the inference application, and the business data of the inference application to the target resource pool corresponding to the target environment; Among them, using a custom controller to create custom resources corresponding to the inference application includes: Defining file conversion resources according to the model conversion resource type corresponding to the custom controller; Obtaining the format information of the original model file before and after migration; Configuring the file conversion resources using the format information; Among them, using a custom controller to create custom resources corresponding to the inference application includes: Defining image conversion resources according to the processor conversion resource type corresponding to the custom controller; Obtaining the environment information of the application image; Configuring the image conversion resources using the environment information; Among them, using a custom controller to create custom resources corresponding to the inference application includes: Defining application migration resources according to the application migration resource type corresponding to the custom controller; Obtaining the application basic information, image mapping relationship, and model file mapping relationship of the inference application; Configuring the application migration resources using the application basic information, the image mapping relationship, and the model file mapping relationship.
2. The method according to claim 1, characterized in that, Using the file conversion resources to perform format conversion on the original model file of the inference application to obtain a target model file in an open file format, including: Using the file conversion resources to drive a file conversion task; Among them, executing the file conversion task includes: Obtaining the original model file from the source resource pool of the inference application; Converting the file format of the original model file to obtain a target model file in an open file format.
3. The method according to claim 1, wherein Using the image conversion resources to perform environment conversion on the application image of the inference application to obtain a target application image adapted to the target environment, including: Using the file conversion resources to drive an image transformation task; Executing the image transformation task includes: Obtaining the application image from the source image repository of the inference application; Performing environment conversion on the application image to obtain a target application image adapted to the target environment.
4. The method according to claim 1, wherein Using the application migration resources to migrate the target model file, the target application image, the metadata of the inference application, and the business data of the inference application to the target resource pool corresponding to the target environment, including: Using the application migration resources to drive an upload task, a migration task, and a pull task; Among them, executing the upload task includes: Uploading the target model file to the source model repository; Upload the target application image to the source image repository; Upload the metadata and the business data to the source object storage repository; Execute the migration task, including: Migrate the target model file from the source model repository to the destination model repository; Migrate the target application image from the source image repository to the destination image repository; Migrate the metadata and the business data from the source object storage repository to the destination object storage repository; Execute the pull task, including: Pull the target application image from the destination image repository; Pull the target model file from the destination model repository; Pull the metadata and the business data from the object storage repository.
5. The method according to claim 4, wherein Migrate the metadata and the business data from the source object storage repository to the destination object storage repository, including: Use a cross-engine version migration tool to migrate the business data from the source object storage repository to the destination object storage repository; Use a backup tool to back up the metadata from the source object storage repository to the destination object storage repository.
6. The method according to claim 4, wherein Migrate the target model file from the source model repository to the destination model repository, including: Use a backup tool to back up the target model file from the source model repository to the destination model repository.
7. The method according to claim 4, characterized in that Migrate the target application image from the source image repository to the destination image repository, including: Use an image synchronization tool to synchronize the target application image from the source image repository to the destination image repository.
8. The method according to any one of claims 1 to 7, characterized in that, After migrating the target model file, the target application image, the metadata of the inference application, and the business data of the inference application to the target resource pool corresponding to the target environment by using the application migration resources, it further includes: Run the inference application in the target resource pool by using the target application image, the target model file, the metadata, and the business data.
9. An application migration device, characterized in that, It includes: A task management module for creating custom resources corresponding to the inference application by using a custom controller; the custom resources include file conversion resources, image conversion resources, and application migration resources; A model transformation module for performing format conversion on the original model file of the inference application by using the file conversion resources to obtain a target model file in an open file format; An image transformation module for performing environment conversion on the application image of the inference application by using the image conversion resources to obtain a target application image adapted to the target environment; An application migration module for migrating the target model file, the target application image, the metadata of the inference application, and the business data of the inference application to the target resource pool corresponding to the target environment by using the application migration resources; Among them, the task management module is specifically used to define file conversion resources according to the model conversion resource type corresponding to the custom controller; obtain the format information before and after the migration of the original model file; and configure the file conversion resources by using the format information. Convert the resource type according to the processor corresponding to the custom controller, and define the image conversion resource; obtain the environment information of the application image; configure the image conversion resource by using the environment information; Define the application migration resource according to the application migration resource type corresponding to the custom controller; obtain the application basic information, image mapping relationship and model file mapping relationship of the inference application; configure the application migration resource by using the application basic information, the image mapping relationship and the model file mapping relationship.
10. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for implementing the steps of the application migration method according to any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the application migration method according to any one of claims 1 to 8 when executed by a processor.
12. A computer program product, comprising a computer program, characterized in that, The computer program implements the steps of the application migration method according to any one of claims 1 to 8 when executed by a processor.
Citation Information
Patent Citations
Application program migration method and device, equipment and storage medium
CN118708321A
Model conversion method, related device and medium
CN119440621A