Container image creation method, device, electronic device and storage medium

By obtaining and parsing the container image description file, the unified creation of AI and non-AI container images is realized, which solves the problem of low creation efficiency in the existing technology and improves the efficiency of updating and maintaining container images.

CN118444943BActive Publication Date: 2024-10-01ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410918154.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-10-01
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

Existing technology makes it difficult to efficiently and uniformly create artificial intelligence (AI) container images and ordinary container images, resulting in low production efficiency. Especially because AI container images are updated frequently and require a lot of manual maintenance, it is difficult to keep up with the pace of updates.

Method used

By obtaining the description file of the container image, including operating system version information, dependency information and creation parameter information, and parsing this information to generate commands and operations for creating AI and non-AI container images, the unified creation of AI and non-AI container images is achieved.

Benefits of technology

It improves the efficiency and automation of container image creation, makes the creation process of AI and non-AI container images more modular, and simplifies the update and maintenance process of container images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118444943B_ABST
    Figure CN118444943B_ABST
Patent Text Reader

Abstract

The present application provides a container image creation method, device, electronic device and storage medium, which relates to the technical field of computer operating system, and the method includes: obtaining a description file of the container image; the description file includes operating system version information, dependency information, image type information and creation parameter information of the container image; the container image includes an AI container image and a non-AI container image; the description file is parsed to obtain commands and operations for creating an AI container image and a non-AI container image; according to the commands and operations, an AI container image and a non-AI container image are created. In this embodiment, by obtaining description files of the AI ​​container image and the non-AI container image to create an AI container image and a non-AI container image, the unified creation of the AI ​​container image and the ordinary container image can be achieved, and the efficiency of container creation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer operating systems, and in particular to a container image creation method, device, electronic device, and storage medium. Background Art

[0002] With the development of cloud computing and container technology, it is becoming more and more common to make customized container images. Artificial Intelligence (AI) container images are designed for applications such as artificial intelligence, machine learning, and deep learning. In addition to the basic components of ordinary container images, they also contain other specific tools and libraries. Due to the particularity of AI container images, they usually need to be managed separately from ordinary container image production, resulting in duplication and inefficiency of processes. In addition, AI container image production involves a large number of parameter permutations and combinations (such as basic images, AI frameworks and versions, training and inference types, hardware architectures, programming language versions, chip types, etc.). Making container images involves processes such as container image template maintenance, building, testing, security scanning, publishing, and signing. At the same time, AI frameworks are updated frequently, and manual production of container images requires a lot of effort to update and maintain container images, and it is difficult to keep up with the pace of AI container image updates.

[0003] Therefore, a universally applicable solution for creating AI container images and ordinary container images is needed. Summary of the invention

[0004] The embodiments of the present application provide a container image creation method, device, electronic device, and storage medium to solve the problem of low efficiency caused by the inability to uniformly create AI container images and ordinary container images.

[0005] In a first aspect, an embodiment of the present application provides a method for creating a container image, the method comprising:

[0006] Obtain a description file of the container image; the description file includes operating system version information, dependency information, image type information, and creation parameter information of the container image; the container image includes an artificial intelligence AI container image and a non-AI container image;

[0007] Parse the description file to obtain the commands and operations for creating AI container images and non-AI container images;

[0008] Create AI container images and non-AI container images based on commands and operations.

[0009] In a second aspect, an embodiment of the present application provides a container image creation device, the device comprising:

[0010] An acquisition module is used to obtain a description file of a container image; the description file includes operating system version information, dependency information, image type information, and creation parameter information of the container image; the container image includes an artificial intelligence AI container image and a non-AI container image;

[0011] A parsing module is used to parse the description file to obtain commands and operations for creating AI container images and non-AI container images;

[0012] The creation module is used to create AI container images and non-AI container images based on commands and operations.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the above methods when executing the computer program.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, any of the above methods is implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements any of the above methods.

[0016] Compared with the prior art, this application has the following advantages:

[0017] The present application provides a container image creation method, device, electronic device and storage medium, which obtains a description file of a container image; the description file includes operating system version information, dependency information, image type information and creation parameter information of the container image; the container image includes an AI container image and a non-AI container image; the description file is parsed to obtain commands and operations for creating an AI container image and a non-AI container image; according to the commands and operations, an AI container image and a non-AI container image are created. In this embodiment, by obtaining description files of an AI container image and a non-AI container image, an AI container image and a non-AI container image are created, which can achieve unified creation of an AI container image and a common container image, and improve the efficiency of container creation.

[0018] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments according to the present application and should not be regarded as limiting the scope of the present application.

[0020] Figure 1 A schematic diagram of the system architecture of the container image creation method provided in this application.

[0021] Figure 2 This is a flowchart of a method for creating a container image according to an embodiment of the present application.

[0022] Figure 3 This is a flowchart of a method for creating a container image according to an embodiment of the present application.

[0023] Figure 4 This is a structural block diagram of a container image creation device according to an embodiment of the present application.

[0024] Figure 5 A block diagram of an electronic device used to implement an embodiment of the present application. DETAILED DESCRIPTION

[0025] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the concept or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary in nature and not restrictive.

[0026] To facilitate understanding of the technical solutions of the embodiments of the present application, the following describes the related technologies of the embodiments of the present application. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.

[0027] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0028] Figure 1 This is a schematic diagram of the system architecture of the container image creation method provided in this application. Figure 1As shown, first, obtain the description file of the container image. The container image is a lightweight, executable, independent software package that contains the code, runtime environment, libraries, environment variables, and configuration files required to run the application. After the container image is created, it can be run on any system that supports containers without being restricted by the underlying infrastructure. The description file can be in any format. In this embodiment, the YAML (Yet Another Markup Language) (.yml) format is used as an example. YAML is a format for data serialization. The description file includes the operating system version basic description file (such as Figure 1 version-base.yml as shown in ), version dependency description files (such as Figure 1 version.yml) and build parameter description files (such as Figure 1 Specifically, the creation processes of AI container images and non-AI container images (i.e., ordinary container images) are abstracted to obtain the operating system version information required for creating AI container images and non-AI container images, the dependency information required for creating AI container images and non-AI container images, and the creation parameter information required for creating AI container images and non-AI container images. Based on the operating system version information, an operating system version basic description file is generated; based on the dependency information and image type information, a version dependency description file is generated; based on the creation parameter information, a build parameter description file is generated.

[0029] Among them, the operating system version information includes: version name, address, version number, etc. Dependency information includes: operating system version, AI framework and version, programming language version, and CUDA version dependencies. Dependencies refer to a list of other software or libraries required by an application. Different types of container images have different dependencies, and image type information includes AI and non-AI types. The types of AI container images include: training and reasoning; the types of non-AI container images include: application, language, and basic. Creation parameter information includes: image build information configuration, test configuration, release warehouse configuration, etc. The warehouse refers to the central location for storing and managing software packages. Testing refers to the process of verifying whether an application meets expectations. Configuration refers to the parameters and options required when the application is running.

[0030] Secondly, the description file is parsed by the parser. The parser base classes in the parser include: version-base.yml parser processing class, version.yml parser processing class and buildspec.yml parser processing class. Different parser processing classes are used to process different description files accordingly, and the description files are parsed to obtain the variable description rules and variable reference rules in the description files; according to the variable description rules and variable reference rules, the commands for creating AI container images and non-AI container images and the operations corresponding to the commands are obtained.

[0031] Finally, execute commands and operations to create multiple types of AI container images and multiple types of non-AI container images (i.e., ordinary container images) to obtain a container image matrix. The types of AI container images include any one of the training class and the reasoning class; the types of non-AI container images include any one of the application class, the language class, and the basic class.

[0032] In this embodiment, by obtaining the description files of the AI ​​container image and the non-AI container image, an AI container image and a non-AI container image are created, so that the unified creation of the AI ​​container image and the ordinary container image can be achieved, making the container image creation process more modular, automated and repeatable, and improving the efficiency of container creation.

[0033] The present application embodiment provides a container image creation method, and the method in this embodiment can be applied to a computing device, which may include: a server, a user terminal, etc. Figure 2 The flowchart of the container image creation method according to an embodiment of the present application is shown, including:

[0034] Step S201, obtain a description file of the container image; the description file includes the operating system version information, dependency information, image type information and creation parameter information of the container image; the container image includes an artificial intelligence AI container image and a non-AI container image.

[0035] Step S202: Parse the description file to obtain commands and operations for creating an AI container image and a non-AI container image.

[0036] Step S203: Create an AI container image and a non-AI container image according to the command and operation.

[0037] Among them, a container image is a lightweight, executable, independent software package that contains the code, runtime environment, libraries, environment variables, and configuration files required to run the application. After the container image is created, it can be run on any system that supports containers, without being restricted by the underlying infrastructure. The description file can be in any format, for example, YAML format, which is a format for data serialization.

[0038] Among them, the operating system version information includes: version name, address, version number, etc. Dependency information includes: operating system version, AI framework and version, programming language version, and CUDA version dependencies. Dependencies refer to a list of other software or libraries required by an application. Different types of container images have different dependencies, and image type information includes AI type and non-AI type. The types of AI container images include: training class, reasoning class, etc.; the types of non-AI container images include: application class, language class, and basic class, etc. Creation parameter information includes: image build information configuration, test configuration, release warehouse configuration, etc. The warehouse refers to the central location for storing and managing software packages. Testing refers to the process of verifying whether an application meets expectations. Configuration refers to the parameters and options required when the application is running.

[0039] The container image creation method provided in the embodiment of the present application obtains a description file of the container image; the description file includes operating system version information, dependency information, image type information and creation parameter information of the container image; the container image includes an AI container image and a non-AI container image; the description file is parsed to obtain commands and operations for creating an AI container image and a non-AI container image; according to the commands and operations, an AI container image and a non-AI container image are created. In this embodiment, by obtaining description files of an AI container image and a non-AI container image to create an AI container image and a non-AI container image, unified creation of an AI container image and a common container image can be achieved, thereby improving the efficiency of container creation.

[0040] The following introduces the specific implementation process of the above steps through multiple implementation methods:

[0041] In one implementation, a description file of a container image is obtained, including: abstracting the creation processes of an AI container image and a non-AI container image respectively, obtaining operating system version information required for creating an AI container image and a non-AI container image, dependency information required for creating an AI container image and a non-AI container image respectively, and creation parameter information required for creating an AI container image and a non-AI container image respectively; and generating a description file based on the operating system version information, image type information, dependency information, and creation parameter information.

[0042] In practical applications, the creation processes of AI container images and non-AI container images are abstracted separately to determine the information required to create an AI container image and the information required to create a non-AI container image. By comparing, the information required to create both the AI ​​container image and the non-AI container image, as well as the information required to create each of the AI ​​container image and the non-AI container image can be obtained, and the information is used to generate a description file in a preset format. For example, the YAML format is a format for data serialization.

[0043] In one implementation, the description file includes an operating system version base description file, a version dependency description file, and a build parameter description file; based on the operating system version information, image type information, dependency information, and creation parameter information, the description file is generated, including: based on the operating system version information, generating the operating system version base description file; based on the dependency information and image type information, generating the version dependency description file; based on the creation parameter information, generating the build parameter description file.

[0044] In one example, based on the operating system version information, an operating system version base description file version-base.yml is generated. Based on the dependency information and image type information, a version dependency description file version.yml is generated. Based on the creation parameter information, a build parameter description file buildspec.yml is generated.

[0045] Among them, for AI container images, the dependencies between training classes and reasoning classes are different. For non-AI container images, the dependencies between application classes, language classes, and base classes are the same. The version-base.yml file is used to describe the global base operating system (Base Operating System, BaseOS) information and provide the basic operating environment and tools. BaseOS is represented by a tuple, and the tuple format is: [OS name, version, address]. The version.yml file is used to describe the dependency relationship between the application version and the BaseOS version, programming language version, CUDA version, etc. The version dependency in the container image can be recorded by creating a version dependency table, which records components, versions, dependent components, and dependent version ranges.

[0046] The buildspec.yml file is used to describe the configuration information required for the build, including the image repository, test configuration, dockerfile path, etc. Dockerfile is a text format used to describe how to build a docker image. Dockerfile allows variables to be passed to Dockerfile using the -&ARG definition method. For example, the format can be: -&ARG [(variable name 1, variable value), (variable name 2, variable value)], where &ARG is defined as an array format. Each element of the array is a tuple. The tuple contains two elements in the format of (variable name, variable value). The variable name is consistent with the ARG variable name defined in the Dockerfile.

[0047] The automatic field assignment rules of the buildspec.yml file are as follows:

[0048] • &NAME in the file automatically assigns the value of the name field in version.yml. Define name:&NAME.

[0049] • &VERSION in the file automatically assigns the value of the versions field in version.yml. When there are multiple values ​​in versions, &VERSION will take the multiple values ​​in versions in turn. Define versions:&VERSION.

[0050] • The &IMAGE_TYPE in the file is automatically assigned the value of the image_type field in version.yml. When there are multiple values ​​in image_type, &IMAGE_TYPE will take the multiple values ​​in image_type in sequence. Define image_type: &IMAGE_TYPE.

[0051] • &PYTHON_VERSION in the file automatically assigns the value of the python_version field in version.yml. When there are multiple values ​​in python_version, &PYTHON_VERSION will take the multiple values ​​in python_version in turn. Define python_version:&PYTHON_VERSION.

[0052] • &CUDA_VERSION in the file automatically assigns the value of the cuda_version field in version.yml. When there are multiple values ​​in cuda_version, &CUDA_VERSION will take the multiple values ​​in cuda_version in sequence. Define cuda_version:&CUDA_VERSION.

[0053] • The &BASEOS_VERSION in the file automatically assigns the baseos_version field in version.yml. When there are multiple values ​​in baseos_version, &PYTHON_VERSION will take the multiple values ​​in baseos_version in turn. Define baseos_version:&BASEOS_VERSION.

[0054] Description of the fields repository_info, t-one, and images in the buildspec.yml file:

[0055] • repository_info is used to indicate the pushed repository address, and supports dockerhub, acr test, and production configurations.

[0056] • t-one is used to represent the test workspace and template. For example, the format is [workspace name, template name].

[0057] • images is used to indicate the information of building images, including the custom group name, build parameters (can be omitted, the default is true to build, false not to build), device_type indicates the device type required for building, the value is cpu / gpu, arch_type indicates the cpu architecture required for building, the value is x86 / arm.

[0058] In one implementation, the description file is parsed to obtain commands and operations for creating an AI container image and a non-AI container image, including: parsing the description file to obtain variable description rules and variable reference rules in the description file; and obtaining commands and operations for creating an AI container image and a non-AI container image according to the variable description rules and the variable reference rules.

[0059] The description file is parsed by a parser, and the parser base classes in the parser include: version-base.yml parser processing class, version.yml parser processing class and buildspec.yml parser processing class. Different parser processing classes are used to process different description files accordingly.

[0060] By parsing the description file, the variable description rules and variable reference rules in the description file are obtained. The variable description rules include: Symbol description: & indicates variable assignment, example: name:&NAME maven, defines a &NAME variable with a value equal to maven; * indicates variable value, example: names: *NAME, equivalent to names: maven. [] indicates a list, example: versions:&VERSIONS [1.3, 4.5], defines a &VERSIONS array with a value equal to [1.3,4.5]. !join[] indicates string concatenation, which is used for variable assignment. When there is an array variable in [], there will be multiple strings, and the connection method starts from the last array forward. () indicates a tuple, which indicates a group of data and supports access using subscripts. The part beyond the subscript takes the boundary value.

[0061] # Example 1, elements are strings

[0062] tags:&TAG (test_tag, arg1)

[0063] # Example 2, elements are arrays

[0064] tags:&TAG (test_tag, [arg1, arg2, arg3])

[0065] # Example 3, tuple subscript access

[0066] tags:&TAG_DATA *TAG[0]#&TAG_DATA = test_tag

[0067] # Example 4: Tuple subscript exceeds access limit, take boundary value

[0068] tags:&TAG_DATA *TAG[2]#&TAG_DATA = [arg1, arg2, arg3].

[0069] Variable reference rules include: variables must be defined before use; the scope of all variables is global in the current build transaction, that is, from the definition to the end of the file; variables can be reassigned to be overwritten.

[0070] According to the variable description rules and variable reference rules, definition commands, splicing commands, assignment commands, value commands, define array commands, etc. are generated. The operation corresponding to the definition command is to define variables; the operation corresponding to the splicing command is to splice variables; the operation corresponding to the assignment command is to assign values ​​to variables; and the operation corresponding to the define array command is to define a group of data.

[0071] In this embodiment, by parsing the description file, commands and operations for creating a container image can be obtained for subsequent creation of the container image.

[0072] In one implementation, creating an AI container image and a non-AI container image according to commands and operations includes: executing commands and operations to create multiple types of AI container images and multiple types of non-AI container images.

[0073] Execute commands and operations to create AI container images and non-AI container images to obtain a container image matrix, including multiple types of AI container images and non-AI container images. For example, execute definition commands, splicing commands, assignment commands, value commands, array definition commands, etc., to define variables, splice variables, assign variables, define a set of data, and other operations to create multiple container images.

[0074] The types of AI container images include any one of the training class and the reasoning class; the types of non-AI container images include any one of the application class, the language class and the basic class.

[0075] In this embodiment, unified creation of AI container images and non-AI container images can be achieved, and multiple different types of container images can be created at the same time, thereby improving the efficiency of container image creation.

[0076] In one implementation, the container image creation method further includes: obtaining an update request for the container image, determining update information of the container image to be updated, the update information including type information and update content of the container image to be updated;

[0077] Use the update information to update the description file of the container image to be updated.

[0078] In actual applications, by parsing the update request of the container image, the update information can be obtained. The update information can indicate which types of container images to update and which parts of the container image to update, such as application code, application functions, dependent library versions, frameworks, model parameters, training data, etc.

[0079] By updating the description file to update the container image, the container image update process can be simplified. Especially for AI container images, in related technologies, image production involves image template maintenance, construction, testing, security scanning, release, signing and other processes. AI frameworks are updated frequently, and manual production of container images requires a lot of effort to update and maintain the images. In this embodiment, the update of the container image is achieved by updating the description file, which greatly simplifies the update process of the container image.

[0080] The present application embodiment provides a container image creation method, and the method in this embodiment can be applied to a computing device, which may include: a server, a user terminal, etc. Figure 3 The flowchart of the container image creation method according to an embodiment of the present application is shown, including:

[0081] Step S301, abstractly process the creation processes of the AI ​​container image and the non-AI container image respectively, and obtain the operating system version information required for creating the AI ​​container image and the non-AI container image, the dependency information required for creating the AI ​​container image and the non-AI container image respectively, and the creation parameter information required for creating the AI ​​container image and the non-AI container image respectively.

[0082] Among them, operating system version information, such as version name, address, version number, etc. Dependency information, such as operating system version, AI framework and version, programming language version, and CUDA version dependencies. Dependencies refer to a list of other software or libraries required by an application. Creation parameter information, such as image build information configuration, test configuration, release warehouse configuration, etc. The warehouse refers to the central location for storing and managing software packages. Testing refers to the process of verifying whether the application meets expectations. Configuration refers to the parameters and options required for the application to run.

[0083] Step S302: Generate a description file based on the operating system version information, image type information, dependency information and creation parameter information.

[0084] Among them, the description file includes an operating system version basic description file, a version dependency description file and a build parameter description file; based on the operating system version information, the operating system version basic description file is generated; based on the dependency information and image type information, the version dependency description file is generated; based on the creation parameter information, the build parameter description file is generated.

[0085] Step S303: parse the description file to obtain variable description rules and variable reference rules in the description file; obtain commands for creating AI container images and non-AI container images and operations corresponding to the commands according to the variable description rules and variable reference rules.

[0086] The description file is parsed by a parser, and the parser base classes in the parser include: version-base.yml parser processing class, version.yml parser processing class and buildspec.yml parser processing class. Different parser processing classes are used to process different description files accordingly.

[0087] By parsing the description file, the variable description rules and variable reference rules in the description file are obtained. For example, the symbol description of the variable description rule is as follows: & indicates variable assignment, example: name:&NAME maven, defines a &NAME variable with a value equal to maven; * indicates variable value, example: names: *NAME, indicates value, which is equivalent to names:maven. [] indicates a list, example: versions:&VERSIONS [1.3, 4.5], defines a &VERSIONS array with a value equal to [1.3, 4.5]. !join[] indicates string concatenation, which is used for variable assignment. When there is an array variable in [], there will be multiple strings, and the connection method starts from the last array. () indicates a tuple, which indicates a group of data and supports access using the subscript method. The part beyond the subscript takes the boundary value. For example, the variable needs to follow the principle of definition before use; the scope of all variables is global in the current build transaction, that is, from the definition to the end of the file; variables can be reassigned for overwriting.

[0088] Step S304: execute commands and operations to create multiple types of AI container images and multiple types of non-AI container images.

[0089] Execute commands and operations to create AI container images and non-AI container images to obtain a container image matrix, including multiple types of AI container images and non-AI container images.

[0090] The types of AI container images include any one of the training class and the reasoning class; the types of non-AI container images include any one of the application class, the language class and the basic class.

[0091] Step S305: Obtain an update request for the container image, and determine update information of the container image to be updated.

[0092] Step S306: Use the update information to update the description file of the container image to be updated.

[0093] By parsing the update request of the container image, the update information can be obtained. The update information can indicate which types of container images are to be updated and which parts of the container image are to be updated. By updating the container image by updating the description file, the container image update process can be simplified.

[0094] In this embodiment, by obtaining description files of the AI ​​container image and the non-AI container image, an AI container image and a non-AI container image are created, so that the AI ​​container image and the common container image can be uniformly created, thereby improving the efficiency of container creation.

[0095] Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a container image creation device. Figure 4 The structure diagram of a container image creation device according to an embodiment of the present application is shown, and the device includes:

[0096] Acquisition module 401 is used to obtain a description file of a container image; the description file includes operating system version information, dependency information, image type information and creation parameter information of the container image; the container image includes an artificial intelligence AI container image and a non-AI container image.

[0097] The parsing module 402 is used to parse the description file to obtain commands and operations for creating AI container images and non-AI container images.

[0098] The creation module 403 is used to create an AI container image and a non-AI container image according to commands and operations.

[0099] The container image creation device provided in the embodiment of the present application obtains a description file of the container image; the description file includes operating system version information, dependency information, image type information and creation parameter information of the container image; the container image includes an AI container image and a non-AI container image; the description file is parsed to obtain commands and operations for creating an AI container image and a non-AI container image; according to the commands and operations, an AI container image and a non-AI container image are created. In this embodiment, by obtaining description files of an AI container image and a non-AI container image to create an AI container image and a non-AI container image, unified creation of an AI container image and a common container image can be achieved, thereby improving the efficiency of container creation.

[0100] In one implementation, the acquisition module 401 is used to: abstract the creation processes of the AI ​​container image and the non-AI container image respectively, obtain the operating system version information required for creating the AI ​​container image and the non-AI container image, the dependency information required for creating the AI ​​container image and the non-AI container image respectively, and the creation parameter information required for creating the AI ​​container image and the non-AI container image respectively; generate a description file based on the operating system version information, image type information, dependency information and creation parameter information.

[0101] In one implementation, the description file includes an operating system version base description file, a version dependency description file, and a build parameter description file; when the acquisition module 401 generates the description file based on the operating system version information, the image type information, the dependency information, and the creation parameter information, it is used to: generate an operating system version base description file based on the operating system version information; generate a version dependency description file based on the dependency information and the image type information; and generate a build parameter description file based on the creation parameter information.

[0102] In one implementation, the parsing module 402 is used to: parse the description file to obtain the variable description rules and variable reference rules in the description file; and obtain commands and operations for creating AI container images and non-AI container images according to the variable description rules and variable reference rules.

[0103] In one implementation, the creation module 403 is used to: execute commands and operations to create multiple types of AI container images and multiple types of non-AI container images; wherein the type of AI container image includes any one of a training class and a reasoning class; the type of non-AI container image includes any one of an application class, a language class, and a basic class.

[0104] In one implementation, the container image creation device also includes an update module, which is used to: obtain an update request for the container image, determine update information of the container image to be updated, the update information includes type information and update content of the container image to be updated; and use the update information to update the description file of the container image to be updated.

[0105] The functions of each module in the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

[0106] Figure 5 FIG. 1 is a block diagram of an electronic device used to implement an embodiment of the present application. Figure 5As shown, the electronic device includes: a memory 510 and a processor 520. The memory 510 stores a computer program that can be run on the processor 520. When the processor 520 executes the computer program, the method in the above embodiment is implemented. The number of the memory 510 and the processor 520 can be one or more.

[0107] The electronic device also includes:

[0108] The communication interface 530 is used to communicate with external devices and perform data exchange transmission.

[0109] If the memory 510, the processor 520 and the communication interface 530 are implemented independently, the memory 510, the processor 520 and the communication interface 530 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0110] Optionally, in a specific implementation, if the memory 510, the processor 520 and the communication interface 530 are integrated on a chip, the memory 510, the processor 520 and the communication interface 530 can communicate with each other through an internal interface.

[0111] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present application when the program is executed by a processor.

[0112] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method provided in the embodiment of the present application is implemented.

[0113] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.

[0114] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.

[0115] It should be understood that the above processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced RISC Machines (ARM) architecture.

[0116] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting description, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).

[0117] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.

[0118] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0119] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0120] Any process or method described in the flow chart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.

[0121] The logic and / or steps described in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.

[0122] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0123] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.

[0124] The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope recorded in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for creating a container image, characterized in that: The method comprises: Obtain a description file of the container image; the description file includes operating system version information, dependency information, image type information and creation parameter information of the container image; the container image includes an artificial intelligence AI container image and a non-AI container image; the description file includes an operating system version basic description file, a version dependency description file and a build parameter description file; Parsing the description file, using different parser processing classes to process different description files accordingly, and obtaining commands and operations for creating the AI ​​container image and the non-AI container image; Creating the AI ​​container image and the non-AI container image according to the command and the operation; Get the description file of the container image, including: Based on the operating system version information, generate the operating system version basic description file; Based on the dependency information and the image type information, generating the version dependency description file; Based on the creation parameter information, the construction parameter description file is generated.

2. The method according to claim 1, characterized in that The operating system version information, the dependency information and the creation parameter information are obtained according to the following steps: The creation processes of the AI ​​container image and the non-AI container image are abstractly processed respectively to obtain operating system version information required for creating the AI ​​container image and the non-AI container image, dependency information required for creating the AI ​​container image and the non-AI container image respectively, and creation parameter information required for creating the AI ​​container image and the non-AI container image respectively.

3. The method according to claim 1, characterized in that: The parsing of the description file to obtain commands and operations for creating the AI ​​container image and the non-AI container image includes: Parsing the description file to obtain variable description rules and variable reference rules in the description file; According to the variable description rule and the variable reference rule, commands and operations for creating the AI ​​container image and the non-AI container image are obtained.

4. The method according to any one of claims 1 to 3, characterized in that: The creating the AI ​​container image and the non-AI container image according to the command and the operation includes: Execute the command and the operation to create multiple types of AI container images and multiple types of non-AI container images; The type of the AI ​​container image includes any one of a training class and a reasoning class; the type of the non-AI container image includes any one of an application class, a language class, and a basic class.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtain an update request for a container image, and determine update information of the container image to be updated, where the update information includes type information and update content of the container image to be updated; The description file of the container image to be updated is updated using the update information.

6. A container image creation device, characterized in that: The device comprises: An acquisition module is used to acquire a description file of a container image; the description file includes operating system version information, dependency information, image type information, and creation parameter information of the container image; the container image includes an artificial intelligence AI container image and a non-AI container image; the description file includes an operating system version basic description file, a version dependency description file, and a build parameter description file; A parsing module, used to parse the description file, use different parser processing classes to process different description files accordingly, and obtain commands and operations for creating the AI ​​container image and the non-AI container image; A creation module, used to create the AI ​​container image and the non-AI container image according to the command and the operation; The acquisition module is used to: generate an operating system version basic description file based on the operating system version information; generate a version dependency description file based on the dependency information and image type information; and generate a build parameter description file based on the creation parameter information.

7. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a computer program stored in the memory, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

9. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.