Resource mounting method and data system
By acquiring and utilizing namespace mapping information to directly mount computing resources to containers, the problems of insufficient mounting speed and intrusiveness in existing technologies are solved, achieving efficient resource mounting.
Patent Information
- Application Number
- PCT/IB2025/053234
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-22
- Filing Date
- 2025-03-27
- Publication Date
- 2025-11-27
AI Technical Summary
In existing technologies, when containers mount computing resources on servers, the mounting speed is insufficient and it is intrusive to bare metal servers, making it impossible to efficiently complete resource mounting.
By obtaining mapping information from multiple namespaces, the target namespace is determined, and the target computing resources are directly mounted to the target container through the server's inherent resource access method of namespaces, avoiding mounting through the software stack of the virtualization layer.
It improves resource mounting speed, reduces intrusion on bare metal servers, and achieves efficient computing resource mounting.
Smart Images

Figure IB2025053234_27112025_PF_FP_ABST
Abstract
Description
[0001] Resource mounting method and data system The present disclosure claims priority to Chinese Patent Application No. 202410644989.3, filed on May 22, 2024 with the Chinese Patent Office, entitled "Resource mounting method and data system", the entire contents of which are incorporated herein by reference. TECHNICAL FIELD The present disclosure relates to the field of virtualization technology, and in particular, to a resource mounting method and a data system. BACKGROUND The development of virtualization technology has changed software development, deployment and operation with containers as a lightweight virtualization technology. Currently, container technology encapsulates application programs and their dependent environments into standardized units, which are run through computing resources on servers. However, containers are deployed on servers, and containers need to mount their respective computing resources before starting, which is mounted through a software stack of a virtualization layer, and the mounting rate is insufficient, or mounted by installing components on the server, which is invasive to bare-metal servers. Therefore, there is an urgent need for a resource mounting method with high mounting rate and no invasiveness. SUMMARY In view of the above, the present disclosure provides a resource mounting method and a data system. One or more embodiments of the present disclosure also relate to a data system, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects in the prior art. According to a first aspect of the present disclosure, a resource mounting method is provided, comprising: in response to a resource configuration event for a target container, obtaining mapping information of a plurality of namespaces, wherein the mapping information of the plurality of namespaces records information of a mapping relationship between the plurality of namespaces and computing resources configured through the plurality of namespaces; determining a target namespace from the plurality of namespaces based on the mapping information of the plurality of namespaces; and mounting a target computing resource to the target container based on the target namespace, wherein the target computing resource is configured through the target namespace. According to a second aspect of the present disclosure, a data system is provided, which comprises a target server, the target server including a target container, a target computing resource and a computing resource controller, the target container including a container engine; the computing resource controller is configured to, in response to a resource configuration event for the target container, obtain mapping information of a plurality of namespaces, determine a target namespace from the plurality of namespaces based on the mapping information of the plurality of namespaces, and generate a path file of the target namespace of the target container based on the target namespace, wherein the mapping information of the plurality of namespaces records information of a mapping relationship between the plurality of namespaces and computing resources configured through the plurality of namespaces; and the container engine is configured to mount the target computing resource to the target container based on the path file of the target namespace.According to a third aspect of the present disclosure, a computing device is provided, comprising: a memory and a processor; the memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the above method. According to a fourth aspect of the present disclosure, a computer readable storage medium is provided, which stores computer programs / instructions, which, when executed by the processor, implement the steps of the above method. According to a fifth aspect of the present disclosure, a computer program product is provided, comprising computer programs / instructions, which, when executed by the processor, implement the steps of the above method. In an embodiment of the present disclosure, in response to a resource configuration event for a target container, a target namespace is determined from a plurality of namespaces based on mapping information of the plurality of namespaces, and resource mounting of a target computing resource configured through the target namespace is completed directly through a resource access manner inherent to the namespace, avoiding mounting through a software stack of a virtualization layer, improving mounting rate, and without the need to install components for mounting, avoiding invasiveness to a bare metal server. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a schematic diagram of a resource mounting method; FIG. 2 is a flowchart of a resource mounting method provided by an embodiment of the present disclosure; FIG. 3 is a schematic diagram of a resource mounting method provided by an embodiment of the present disclosure; FIG. 4 is a structural schematic diagram of a data system provided by an embodiment of the present disclosure; and FIG. 5 is a structural block diagram of a computing device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. However, the present disclosure can be practiced without the specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to obscure the present disclosure. The terminology used in the description of one or more embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to limit the one or more embodiments of the present disclosure. As used in one or more embodiments of the present disclosure, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or," as used in one or more embodiments of the present disclosure, are to be interpreted as including any or all possible combinations of one or more of the associated listed items. It will be further understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are merely used to differentiate one piece of information from another. These terms are not intended to denote their usage in a sequence.For example, without departing from the scope of one or more embodiments of the present specification, the first can also be referred to as the second, and similarly, the second can also be referred to as the first. Depending on the context, the phrase "if" as used herein can be interpreted to mean "when" or "in response to determining" or "in response to ascertaining". In addition, it needs to be explained that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present specification are information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose authorization or refusal. First, the nomenclature involved in one or more embodiments of the present specification is explained. Mount: connecting computing resources on a server to a specific location (path file) of a running container, which is manifested as establishing a mounting relationship between the container and the computing resources, so that the application in the container can directly access these computing resources. runD: runD secure container, which provides a secure container engine that seamlessly integrates with the standard container ecosystem. Users can use the cloud-native ecosystem while taking advantage of the isolation capabilities of secure containers provided by containers and host machines. Peripheral Component Interconnect Express (PCIE): a high-speed serial computer expansion bus standard used to connect the motherboard and other computing resources to achieve efficient data access. Non-Volatile Memory Express (NVMe): a storage access protocol designed for use with non-volatile storage, providing a low-latency, high-bandwidth interface to fully utilize the performance potential of non-volatile storage. Peripheral Component Interconnect Express Virtual Function (PCIE VF): a virtualization technology for PCIE computing resources, which divides a single computing resource into multiple virtual partitions, each virtual partition behaves as an independent physical device for direct access by multiple virtual machines or containers.Non-Volatile Memory Express Multi-Namespaces (NVMe Multi-Namespaces): An advanced storage feature that allows a physical device to be partitioned into multiple independent logical units, each of which can be used and managed independently by different users or applications. Non-Volatile Memory Express Asynchronous Event Reporting (NVMe AER): A feature in the NVMe specification that allows NVMe devices to actively notify the host system when certain non-fatal errors or other important state changes are detected.
[0002] Kubernetes (K8S): An open-source container orchestration platform used to automate the deployment, scaling, and management of containerized applications. It provides a platform that allows users to define the deployment, configuration, updates, and maintenance of containerized applications in a declarative manner, ensuring that applications run efficiently, reliably, and scalably across multiple host nodes in a cluster environment.
[0003] TDC: A container resource management unit, as a front-end computing resource manager. Currently, in order to better solve the use and operation and maintenance of K8S, solve the complexity of resource and K8S split, use K8S as the use interface of computing resources, provide cloud computing services of computing resources for containers, and deliver mode is server less form, that is, users do not need to pay attention to the operation and maintenance management of underlying nodes and clusters: the container computing service operates the server (bare metal server), and the user only needs to operate the target container on the server, without maintaining the server where the target container is located. Currently, the management and control platform manages the additional cloud disk to the bare metal by the virtual partition hosting tool component, and then converts the bare virtual partition to be directly used by the container, and completes the resource mounting. As shown in FIG. 1, FIG. 1 shows a schematic diagram of a resource mounting method: step ①: when the operating system of the bare metal server starts, the preloading module is loaded, each physical partition is divided into multiple virtual partitions, and the preloading module hosts the multiple virtual partitions first. For example, a preloading module sri ov contro II er. ko is pre-installed in the bare metal server, which is loaded when the operating system of the bare metal server starts, each physical partition (physical function PCIe PF) is divided into 255 virtual partitions (virtual function PCIe VF), and the preloading module hosts the first 255 virtual partitions first, so as to avoid that the unallocated virtual partition loads the kernel space driver virtio-pci / NVMe to access the back-end computing resource. Step ②: the container computing service creates and mounts the computing resources (front-end computing resources and back-end computing resources) to the bare metal server through the data interface provided by the management and control platform: by creating a high-performance cloud server instance, integrating a high-concurrency and high-I / O processing capability cloud server instance, and creating and mounting the computing resources to the bare metal server from the container resource management unit. Then, the virtual partition hosting tool on the bare metal server is used to determine the virtual partition corresponding to the computing resource, load the kernel space driver for the virtual partition, complete the resource configuration through the virtualization layer, and generate the block device in the secure container. For example, the container computing service creates and mounts the container cloud disk to the bare metal server by using the data interface open api, and uses the virtual partition hosting tool vf-manager tool on the bare metal server to determine the corresponding virtual partition according to the serial number of the container cloud disk, loads the kernel space driver virtio-pci / NVMe for the virtual partition, completes the cloud disk configuration through the virtualization layer, and generates the block device in the secure container runD container. Step ③: unload the kernel space driver, and load the user space driver for the virtual partition.For example, the kernel space driver virtio-bik / NVMe driver is loaded with the user space driver vfio driver for the virtual partition. Step 4: Through the user space driver, the computing resources (front-end computing resources and back-end computing resources) are directly passed to the block device of the secure container for loading. For example, the user space driver vfio directly passes the computing resources (front-end computing resources and back-end computing resources) to the secure container runD container for loading. However, the above method needs to involve many modules and needs to pass through the software stack of the virtualization layer for mounting, and the mounting rate is insufficient, generally about 3s is needed to mount a container cloud disk of a container, and the virtual partition hosting tool component is installed on the server, which is invasive to the bare-metal server. In the present specification, a resource mounting method is provided, and the present specification also relates to a data system, a computing device, a computer readable storage medium and a computer program product, which are described in detail one by one in the following embodiments. Referring to FIG. 2, FIG. 2 shows a flowchart of a resource mounting method provided by an embodiment of the present specification, which includes the following specific steps: Step 202: In response to a resource configuration event for a target container, mapping information of a plurality of namespaces is obtained, wherein the mapping information of the plurality of namespaces records information of a mapping relationship between the plurality of namespaces and computing resources configured through the plurality of namespaces. The present disclosure is applied to a system platform for mounting computing resources of a container on a server. The container is a lightweight virtualization instance of an application program, which encapsulates the application program and its dependent environment into a standardized unit. A server often has multiple containers deployed thereon, and the multiple containers share the kernel space of the operating system of the server (host), but each has an independent user space. The computing resources are hardware resources supporting the running of the application program, including but not limited to: central processing unit (CPU), memory, disk storage and graphic processing unit (GPU). On the server, the computing resources are virtually divided into multiple containers, so that each container runs as if in an independent environment. The namespace is an access address space of the container for accessing the computing resources. The namespace is an access address space of the container for accessing the computing resources. The namespace is a logically divided access address space of the computing resources. For example, in a K8s cluster, each container has its own dedicated namespace.The mapping information of the namespace is information for recording the mapping relationship between the namespace and the computing resource configured through the namespace. The mapping information of the namespace includes but is not limited to: an identifier of the namespace, an identifier of the computing resource, a computing resource type, a computing resource path, access permission and mounting options, and the like. For example, a namespace information in a yaml format is as follows.
[0004] # Definition of the mapping information of the namespace namespace_mapping_info:
[0005] # Identifier of the namespace nvme namespace: myapp-cloud-disk-ns
[0006] # Identifier of the computing resource (container cloud disk ID) resource_id: cloud-disk-abcdefghij
[0007] # Computing resource type (container cloud disk) resource_type: ContainerCloudDisk
[0008] # Computing resource path (mounting point of the cloud disk on the host) resource_path: / mnt / cloud-disks / cloud-disk-abcdefghij
[0009] # Access permission: multiple container read-write access_mode: ReadWriteMany
[0010] # Mounting options mount_options:
[0011] - discard
[0012] - noatime where, nvme namespace: myapp-cloud-disk-ns: used to uniquely identify the nvme namespace, facilitating management and distinguishing different container cloud disk resources. cloud-disk-abcdefghij: indicates a specific container cloud disk resource ID, used to locate the container cloud disk. ContainerCloudDisk: explicitly indicates that the computing resource is a cloud disk service specially designed for containers, distinguished from other types of storage resources. / mnt / cloud-disks / cloud-disk-abcdefghij: the actual mounting path of the cloud disk on the host machine, and the application can access the cloud disk data through this path. ReadWriteMany: indicates that multiple containers can simultaneously access this cloud disk in read-write mode, suitable for multi-container application scenarios that need to share data. discard: enable TRIM / UNMAP support, optimize the space recycling performance of SSD cloud disks. noatime: turn off access timestamp updates, reduce unnecessary disk writes, and improve read-write performance. The target container is a container instance that needs to mount resources, and the target container is a standardized unit encapsulating a specific application and its dependent environment for deployment on a server. For example, in a K8s cluster, a target container that is running a database service needs to mount storage resources to ensure the stable operation of the database service and isolate it from other containers. The resource configuration event for the target container is a state change event triggered by the resource configuration for the target container. The resource configuration for the target container is completed through the target namespace to configure the target computing resource, so in this disclosure, the update of the mapping information of the target namespace is required to obtain the mapping information of multiple namespaces, and in step 204, based on the update of the mapping information of the multiple namespaces, the target namespace is determined. In response to the resource configuration event for the target container, the mapping information of the multiple namespaces is obtained, and one optional method is: in response to the resource configuration event for the target container, multiple namespaces are scanned to obtain the mapping information of the multiple namespaces.Exemplarily, in response to an asynchronous event report AER triggered by a container cloud disk configuration event for the target container of the runD container, a plurality of namespaces (NVMe NS1, NVMe NS2 and NVMe NS3) are scanned to obtain mapping information of the plurality of namespaces: NVMe NS1-mapping-inf, NVMe NS2-mapping-info and NVMe NS3-mapping-info. oIn response to the resource configuration event for the target container, the mapping information of the plurality of namespaces is obtained. The mapping information of the plurality of namespaces is obtained in a timely manner, thereby providing timely and accurate information support for subsequent determination of the target namespace. Step 204: Based on the mapping information of the plurality of namespaces, the target namespace is determined from the plurality of namespaces. The target namespace is an access address space used by the target container to access the target computing resource, and the target namespace is an access address space logically divided for the target computing resource. For example, in a K8s cluster, a target container running a database service has an access address space for accessing a target computing resource, and through the target namespace, a storage resource can be accessed. Based on the mapping information of the plurality of namespaces, the target namespace is determined from the plurality of namespaces, and the specific manner is: based on whether the mapping information of the plurality of namespaces is updated, the target namespace is determined from the plurality of namespaces. It should be noted that the mapping information of any namespace is updated before and after the computing resource is configured through the namespace. Configuring the computing resource through the namespace triggers the resource configuration event. Therefore, based on the change of the mapping information of the plurality of namespaces, it can be determined which namespace is used to complete the configuration of the computing resource, and then the resource mounting is completed in step 206. Exemplarily, based on whether the mapping information of the plurality of namespaces (NVMe NS1-mapping-info, NVMe NS2-mapping-info, and NVMe NS3-mapping-info) is updated, the target namespace NVMe NS1 is determined from the plurality of namespaces (NVMe NS1, NVMe NS2, and NVMe NS3). Based on the mapping information of the plurality of namespaces, the target namespace is determined from the plurality of namespaces. The target namespace is determined in a timely manner, thereby providing timely namespace support for subsequent mounting of the target computing resource. Step 206: Based on the target namespace, the target computing resource is mounted to the target container, wherein the target computing resource is configured through the target namespace. The target computing resource is a computing resource that needs to be mounted, and the target computing resource has been configured through the target namespace. The target computing resource includes but is not limited to: central processing unit, memory, disk storage, and graphics processing unit. For example, for the target container running the database service, the target computing resource is a container cloud disk, and the configuration parameters are as follows: memory: 8 GB RAM is allocated; SSD disk storage: 1 TB of SSD hard disk storage.Based on the target namespace, the target computing resource is mounted to the target container. An optional way is to generate a path file of the target container based on the target namespace, and mount the target computing resource to the target container through the path file. The path file is a file used to identify and access a specific computing resource. The path file is a specific location of the running target container, which indicates the actual mounting point of the target computing resource on the host machine, so that the application in the target container can correctly access and use the mounted target computing resource through the path file, which is to establish the mounting relationship between the container and the computing resource. Illustratively, based on the target namespace NVMe NS1, the path file / dev / nvme0n2 of the target container is generated, and the container cloud disk is mounted to the target container through the path file / dev / nvme0n2. In the present disclosure, in response to a resource configuration event for the target container, the target namespace is determined from a plurality of namespaces based on mapping information of the plurality of namespaces, and the resource mounting of the target computing resource configured through the target namespace is directly completed through the resource access mode inherent to the namespace of the server, avoiding mounting through the software stack of the virtualization layer, improving the mounting rate, and without the need to install components for mounting, avoiding the invasiveness to the bare-metal server. In an optional embodiment of the present disclosure, step 202 comprises the following specific steps: in response to a resource configuration event for the target container, mapping scanning is performed on a plurality of namespaces to obtain mapping information of the plurality of namespaces. The mapping scanning is an operation of identifying and collecting information of a plurality of namespaces and computing resources having a mapping relationship with the plurality of namespaces. The mapping scanning is used to obtain the mapping relationship between each namespace and the computing resource and the resource information of the computing resource. For example, in the K8s cluster, in response to a resource configuration event for the target container, the computing resource scanning: all computing resources (CPU, memory, disk storage, GPU, etc.) having a mapping relationship with a plurality of namespaces are traversed, and resource information (basic information, use state, and allocation, etc.) of these resources is collected. Mapping relationship identification: according to the collected resource information, the mapping relationship between each namespace and its associated computing resource is identified and recorded. Information integration: the identified mapping relationship and computing resource information are integrated into the mapping information of the namespace, such as a data structure in yam I format. Illustratively, in response to a resource configuration event for the target container, mapping scanning is performed on a plurality of namespaces (NVMe NS1, NVMe NS2, and NVMe NS3).The computing resources mapped with the plurality of namespaces are searched, resource information thereof is collected, and the mapping relationship between each namespace and the resources is recorded, and mapping information of the plurality of namespaces NVMe NS1-mapping-info, NVMe NS2-mapping-info, NVMe NS3-mapping-info is integrated. oIn response to the resource configuration event for the target container, the plurality of namespaces are scanned to obtain mapping information of the plurality of namespaces. Through the timely mapping scanning, the mapping information of the plurality of namespaces is obtained, which provides timely and accurate information support for subsequent determination of the target namespace. In an optional embodiment of the present specification, in response to the resource configuration event for the target container, the plurality of namespaces are scanned to obtain mapping information of the plurality of namespaces, including the following specific steps: in response to the resource configuration event for the target container, the computing resources having a mapping relationship with the plurality of namespaces are scanned to obtain resource information of the computing resources; and based on the resource information, the mapping information of the plurality of namespaces is obtained. The mapping relationship is a logical mapping relationship established between the namespace and the computing resource, and the mapping relationship represents which computing resource is configured through which namespace, thereby clarifying which computing resource can be accessed by the container through which namespace after the resource mounting is completed. The resource information of the computing resource is information describing the configuration and state of the computing resource, and the resource information includes but is not limited to: configuration parameters such as an identifier, a type, a capacity, a performance index and an access permission of the computing resource, and state parameters such as a usage and a mounting state. For example, a container cloud disk resource (ID: cloud-disk-abcdefghij), the resource information of which includes: a resource identifier: cloud-disk-abcdefghij; a resource type: ContainerCloudDisk; a capacity: 1 TB; a usage: used space, remaining space, read-write rate, etc.; a performance index: IOPS, throughput, delay, etc.; a mounting state: whether it has been mounted to a host, a mounting path, etc.; and an access permission: which namespaces have the right to access, an access mode (such as multiple container read-write ReadWriteMany, single container read-write ReadWriteOnly). Illustratively, in response to the resource configuration event for the target container, the computing resources having a mapping relationship with the plurality of namespaces (NVMe NS1, NVMe NS2 and NVMe NS3) are scanned to obtain resource information of the computing resources, the resource information of which is collected, and the mapping relationship between each namespace and the resources is recorded, the mapping relationship and the resource information are integrated, and the mapping information of the plurality of namespaces NVMe NS1-mapping-inf, NVMe NS2-mapping-inf and NVMe NS3-mapping-info is obtained. oIn response to the resource configuration event for the target container, the computing resources mapped with the plurality of namespaces are scanned to obtain resource information of the computing resources; and based on the resource information, mapping information of the plurality of namespaces is obtained. Based on the mapping relationship, the computing resources are scanned, and based on the resource information, the mapping information of the plurality of namespaces is obtained, which provides timely, accurate and comprehensive information support for subsequent determination of the target namespace. In an optional embodiment of the present specification, after step 206, the following specific steps are further included: starting the target container based on the target computing resource. Illustratively, based on the container cloud disk of the target container, the running environment of the target container is configured, and the runD container, which is the target container, is started on the running environment of the target container. Starting the target container based on the target computing resource. Starting the target container based on the high-efficiency mounted target computing resource improves the starting rate of the target container. In an optional embodiment of the present specification, before step 202, the following specific steps are further included: obtaining configuration parameters of the target namespace and the target computing resource for the target container; and configuring the target computing resource based on the configuration parameters through the target namespace, and updating the mapping information of the target namespace. The configuration parameters of the target computing resource are attribute parameters used for configuring the target computing resource, including but not limited to: resource type, resource quota, resource limit, performance policy and access mode. For example, the resource type includes CPU core number, memory capacity, disk storage space and GPU quantity, the resource quota includes CPU share, memory limit, disk quota and GPU video memory size, the resource limit includes CPU limit, memory limit, IOPS limit and bandwidth limit, the performance policy includes priority during resource use, cache strategy and prefetch behavior, and the access mode includes single-container read-write ReadWriteOnce, multiple-container read-write ReadWriteMany, multiple-container read-only ReadOnlyMany and multiple-container write-only WriteOnlyMany. An optional way of obtaining the target namespace for the target container is to allocate the target namespace for the target computing resource of the target container. An optional way of obtaining the configuration parameters of the target computing resource is to obtain the configuration parameters of the target computing resource through remote procedure call. An optional way of obtaining the configuration parameters of the target computing resource is to obtain the configuration parameters of the target computing resource through a data interface.The target namespace is accessed based on the configuration parameters to configure the target computing resource. An optional way is to access the target namespace based on the configuration parameters to configure the target computing resource through a remote procedure call. An optional way is to access the target namespace based on the configuration parameters to configure the target computing resource through a data interface. Illustratively, the container computing service configures resources through the management platform through a remote procedure call, obtains configuration parameters of the container cloud disk through the remote procedure call, and accesses the target namespace NVMe NS1 based on the configuration parameters to configure the container cloud disk through the remote procedure call. The configuration parameters of the target namespace and the target computing resource for the target container are obtained; the target computing resource is configured based on the configuration parameters through the target namespace, and the mapping information of the target namespace is updated. The configured resources provide support for subsequent resource mounting. In an optional embodiment of the present specification, obtaining the configuration parameters of the target namespace and the target computing resource includes the following specific steps: receiving a resource mounting request for the target container, wherein the resource mounting request includes the configuration parameters of the target computing resource; in response to the resource mounting request, determining the target namespace that has not established a mapping relationship with the computing resource from a plurality of namespaces. The resource mounting request for the target container is an instruction request for mounting the target computing resource to the target container, which can be sent by a person, can be an automatic script, or can be conditionally triggered, which is not limited herein. The resource mounting request can be a remote procedure call, for example, an attach-namespace rpc call, or a data interface request, for example, an open-api interface request. For example, a resource mounting request in a yaml format is as follows: apiVersion: v1.
[0013] # Type of target computing resource kind: PersistentVolumeClaim metadata:
[0014] # PVC name, used to uniquely identify this PVC resource name: db-pvc
[0015] # Target namespace nvme namespace: myapp-cloud-disk-ns spec:
[0016] # Specify the storage class name to be used as cloud-disk-storage-class storageClassName: cloud-disk-storage-class
[0017] # Specify the access mode as single container read-write accessModes:
[0018] - ReadWriteOnce resources: requests:
[0019] # Request to mount a storage resource of 1TiB (Terabyte) size storage: 1Ti Wherein, kind: PersistentVolumeClaim defines a target computing resource of a K8s persistent volume, named db-pvc, belonging to myapp-cloud-disk-ns, an nvme target namespace. By specifying storageClassName as cloud-disk-storage-class, it indicates K8s to use the storage class configured to interface with the cloud service provider container cloud disk service to dynamically provision or bind cloud disk resources. The access mode is set to ReadWriteOnce, meaning that the requested cloud disk can only be mounted by a single container in read-write mode. Finally, in the resources, requests part, the size of the required storage resource is specified as 1TiB. Exemplarily, the container computing service initiates a resource mounting request attach-namespace remote procedure call through the data interface provided by the management platform. The container resource management unit determines the target namespace NVMe NS3 that is not mapped with the computing resource from multiple namespaces (NVMe NS1, NVMe NS2, and NVMe NS3) in response to the resource mounting request OReceiving a resource mounting request for a target container, wherein the resource mounting request comprises configuration parameters of a target computing resource; determining, from the plurality of namespaces, a target namespace that has not established a mapping relationship with the computing resource, in response to the resource mounting request. Precise matching and dynamic allocation of the computing resource and the namespace are achieved, and configuration of the target computing resource is automatically completed. In an optional embodiment of the present specification, after the target computing resource is configured based on the configuration parameters through the target namespace, the following specific steps are further included: generating a resource configuration event for the target container, in a case where it is identified that the configuration of the target computing resource is completed. An optional way to identify whether the configuration of the target computing resource is completed is to continuously acquire state parameters of the target computing resource, and determine whether the configuration of the target computing resource is completed based on the state parameters. For example, the state parameters of the container cloud disk are continuously acquired, it is determined whether the configuration of the container cloud disk is completed based on the state parameters, and a container cloud disk configuration event of the target container is generated, in a case where it is identified that the configuration of the container cloud disk is completed. An asynchronous event report AER triggered by the container cloud disk configuration event of the target container is generated, in a case where it is identified that the configuration of the target computing resource is completed. The resource configuration event for the target container is generated in a timely manner, thereby triggering subsequent resource mounting in a timely manner, and ensuring the speed and accuracy of resource mounting. In an optional embodiment of the present specification, step 204 comprises the following specific steps: identifying whether mapping information of the plurality of namespaces is updated; determining, from the plurality of namespaces, a target namespace in which the mapping information is updated. The mapping information of any namespace is updated before and after the computing resource is configured through the namespace, and the configuration of the computing resource through the namespace triggers a resource configuration event. Therefore, in a case where the resource configuration event is triggered, it can be determined which namespace is updated, and the namespace is the target namespace in which the configuration of the target computing resource is completed, and resource mounting is completed in subsequent step 206. For example, it is identified whether the mapping information (NVMe NS1-mapping-info, NVMe NS2-mapping-info and NVMe NS3-mapping-info) of the plurality of namespaces is updated, and a target namespace NVMe NS1 in which the mapping information is updated is determined from the plurality of namespaces (NVMe NS1, NVMe NS2 and NVMe NS3). odetermine the target namespace in a timely and accurate manner, providing timely and accurate namespace support for subsequent completion of the target computing resource loading. FIG. 3 shows a schematic diagram of a resource mounting method provided by an embodiment of the present specification, as shown in FIG. 3: Step ①: The container computing service initiates a resource mounting request through a data interface provided by the high-performance computing cloud server instance of the management platform: By creating a high-performance computing cloud server instance, the management component of the management platform initiates a remote process call to the resource mounting service of the container resource management unit. For example, the container computing service initiates a resource mounting request through the data interface open api provided by the high-performance computing cloud server instance of the management platform EBS, and the management component of the management platform EBS initiates a remote process call to the resource mounting service of the attach-namespace rpc container resource management unit TDC. Step ②: The container resource management unit processes the remote process call, determines the target namespace that has not established a mapping relationship with the computing resource from multiple namespaces, configures the target computing resource based on the configuration parameters through the target namespace, and updates the mapping information of the target namespace. For example, the container resource management unit TDC processes the remote process call attach namespace, determines the target namespace (namespace 1 and namespace 2) that has not established a mapping relationship with the computing resource from multiple namespaces, configures the container cloud disk based on the configuration parameters of the container cloud disk through the target namespace, and updates the mapping information of the target namespace. Step ③: The container resource management unit generates a resource configuration event for the target container when it identifies that the configuration of the target computing resource is complete, and sends the resource configuration event to the computing resource controller. For example, the container resource management unit generates a resource configuration event AER for the target container when it identifies that the configuration of the container cloud disk is complete, and sends the resource configuration event AER to the computing resource controller NVMe controller. Step ④: The computing resource controller responds to the resource configuration event for the target container, scans the computing resource that has a mapping relationship with multiple namespaces, obtains the resource information of the computing resource, obtains the mapping information of multiple namespaces based on the resource information, identifies whether the mapping information of multiple namespaces is updated, determines the target namespace in which the mapping information is updated from multiple namespaces, and generates a path file of the target container based on the target namespace.For example, the computing resource controller NVMe controller scans the computing resources mapped with the multiple namespaces in response to the resource configuration event AER for the target container, obtains resource information of the computing resources, obtains mapping information of the multiple namespaces based on the resource information, identifies whether the mapping information of the multiple namespaces is updated, determines a target namespace in which the mapping information is updated from the multiple namespaces, and generates a path file / dev / nvme0n2 of the target container based on the target namespace. Step 5: The container engine mounts the target computing resource to the target container through the path file. For example, the container engine runD of the target container starts the target container pod based on the path file / dev / nvme0n2. In the present disclosure, a piece of container cloud disk is mounted as a target namespace namespace under a computing resource controller NVMe controller through the resource access mode inherent to the server, i.e., the multiple namespaces Mu11i-namespace, a path file of the block device / dev / nvme1nX is generated, and the device is provided to the target container runD pod. Fewer modules are involved, and mounting through the software stack of the virtualization layer is avoided, thereby improving the mounting rate. The concurrent mounting of 100 pieces of container cloud disks can be completed in 1.7s, and no components need to be installed in the bare-metal server for mounting, thereby avoiding the invasiveness to the bare-metal server. Corresponding to the method embodiments described above, the present specification also provides a data system embodiment, and FIG. 4 shows a structural schematic diagram of a data system according to an embodiment of the present specification. As shown in FIG. 4, the system 400 includes a target server 410, the target server 410 includes a target container 4110, a target computing resource 4120, and a computing resource controller 4130, the target container 4110 includes a container engine 41110; the computing resource controller 4130 is configured to obtain mapping information of multiple namespaces in response to a resource configuration event for the target container 4110, determine a target namespace from the multiple namespaces based on the mapping information of the multiple namespaces, and generate a path file of the target namespace of the target container 4110 based on the target namespace, wherein the mapping information of the namespaces records information of a mapping relationship between the multiple namespaces and computing resources configured through the multiple namespaces; and the container engine 41110 is configured to mount the target computing resource 4120 to the target container 4110 based on the path file of the target namespace. oThe data system is a distributed container system that uses containerization technology, resource management and control strategies, and virtualization technology to manage and schedule computing resources to ensure that data processing tasks are executed efficiently and securely within target containers, such as a Hadoop distributed system. The target server is a server that deploys multiple containers, and the target server runs target containers, target computing resources (such as container cloud disks), and computing resource controllers (such as NVMe controllers), such as a bare metal server (Bare Metal Server), which is a physical server that does not install any virtualization software and directly runs an operating system and an application. The computing resource controller is a hardware or software component located inside the target server that is responsible for directly managing specific computing resources. It works with the resource management unit to ensure that the target container can safely and efficiently access and use the target computing resources configured for it. In this embodiment, the computing resource controller performs tasks such as obtaining mapping information of multiple namespaces, determining target namespaces, and completing target computing resource mounting. For example, an NVMe controller. In an optional embodiment of the present specification, the target server 410 further includes a container resource management unit 4140; the computing resource controller 4130 is further configured to issue a resource information request to the container resource management unit 4140 in response to a resource configuration event for the target container 4110; the container resource management unit 4140 is configured to receive the resource information request, scan the computing resources that have a mapping relationship with the multiple namespaces, obtain resource information of the computing resources, and feed back the resource information to the computing resource controller 4130; and the computing resource controller 4130 is further configured to receive the resource information fed back by the container resource management unit 4140 and obtain mapping information of the multiple namespaces based on the resource information. The container resource management unit is a system component used to implement resource allocation, monitoring, and adjustment at the target server level, and it closely cooperates with the computing resource controller to ensure that the target container can safely and efficiently use the computing resources according to the preset strategy. For example, TDCo In an optional embodiment of the present specification, the target server 410 further includes a container resource management unit 4140; the container resource management unit 4140 is configured to obtain configuration parameters of a target namespace of the target container 4110 and a target computing resource 4120, configure the target computing resource 4120 based on the configuration parameters through the target namespace, and update the mapping information of the target namespace.In an optional embodiment of the present specification, the system 400 further comprises a management platform 420; the container resource management unit 4140 is further configured to receive a resource mounting request for the target container 4110 sent by the management platform 420, wherein the resource mounting request comprises configuration parameters of the target computing resource 4120, and in response to the resource mounting request, determine a target namespace that has no mapping relationship with the computing resource from the plurality of namespaces. The management platform is a software system for global resource scheduling, policy making, permission control, and providing a unified management interface, for example, EBS and ECS. EBS (Elastic Block Store) is a block storage service that provides cloud disk creation, mounting, backup, and other functions, and ECS (Elastic Container Service) is a container orchestration service that is used to manage the life cycle, deployment, and scaling of containers. In an optional embodiment of the present specification, the container resource management unit 4140 is further configured to, in response to identifying that the target computing resource 4120 is configured, generate a resource configuration event for the target container 4110, and send the resource configuration event to the computing resource controller 4130. o In the present disclosure, the computing resource controller is configured to, in response to the resource configuration event for the target container, determine a target namespace from the plurality of namespaces based on mapping information of the plurality of namespaces, and directly complete resource mounting of the target computing resource configured through the target namespace through a resource access mode inherent to the namespace, thereby avoiding mounting through a software stack of a virtualization layer, improving the mounting rate, and avoiding the need to install components for mounting, thereby avoiding invasiveness to a bare-metal server and improving the system performance of the data system. The above is a schematic scheme of a data system according to an embodiment. It should be noted that the technical scheme of the data system and the technical scheme of the resource mounting method belong to the same concept, and the details of the technical scheme of the data system that are not described in detail can be referred to the description of the technical scheme of the resource mounting method. FIG. 5 shows a structural block diagram of a computing device according to an embodiment of the present specification. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520 oThe processor 520 is connected with the memory 510 through a bus 530, and the database 550 is used to save data. The computing device 500 further includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 540 can include one or more of any type of network interface (e.g., a Network Interface Controller (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, or a wired or wireless interface. In one embodiment of the present specification, the above-mentioned components of the computing device 500 and other components not shown in FIG. 5 can also be connected with each other, for example, through a bus. It should be understood that the computing device structure block diagram shown in FIG. 5 is only for the purpose of example, and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed. The computing device 500 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC).The computing device 500 can also be a server, either mobile or stationary. The processor 520 is configured to execute computer program instructions to implement the steps of the resource mounting method described above. The above is a schematic solution of the computing device according to an embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the resource mounting method belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the resource mounting method. An embodiment of the present specification also provides a computer readable storage medium storing computer program instructions, which are executed by a processor to implement the steps of the resource mounting method described above. The above is a schematic solution of the computer readable storage medium according to an embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the resource mounting method belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the resource mounting method. An embodiment of the present specification also provides a computer program product including computer program instructions, which are executed by a processor to implement the steps of the resource mounting method described above. The above is a schematic solution of the computer program product according to an embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the resource mounting method belong to the same concept, and the details of the technical scheme of the computer program product that are not described in detail can be referred to the description of the technical scheme of the resource mounting method. The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps in a claim can be performed in an order different than examples and still accomplish the desired result. Also, the described processes can not require the particular order shown, or sequential order, to accomplish the desired results. In certain implementations, multitasking and parallel processing can be advantageous. The computer instructions include computer program code, which can be in source code, object code, executable or some intermediate form. The computer readable medium can include any entity or apparatus capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer storage, read-only memory (ROM), random access memory (RAM), electric carrier wave signal, telecommunication signal, and software distribution medium, etc.It should be noted that the contents included in the computer readable medium can be appropriately increased or decreased according to the requirements of patent practices, for example, according to the patent practices, the computer readable medium does not include the electric carrier signals and the telecommunication signals in some regions. It should be noted that for the foregoing method embodiments, in order to facilitate the description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited to the action sequence described, because according to the present disclosure, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the present disclosure. In the above embodiments, the description of each embodiment is focused on, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments. The preferred embodiments disclosed above are only used to help explain the present disclosure. The optional embodiments do not describe all the details and limit the invention to the specific embodiments described. Obviously, according to the content of the present disclosure, many modifications and changes can be made. The present disclosure selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present disclosure, so that those skilled in the art can well understand and use the present disclosure. The present disclosure is limited by the claims and their full scope and equivalents.
Claims
CLAIM 1. A resource mounting method, comprising: In response to a resource configuration event for a target container, mapping information of a plurality of namespaces is obtained, wherein the mapping information of the plurality of namespaces records information of mapping relationships between the plurality of namespaces and computing resources configured through the plurality of namespaces; based on the mapping information of the plurality of namespaces, a target namespace is determined from the plurality of namespaces; based on the target namespace, a target computing resource is mounted to the target container, wherein the target computing resource is configured through the target namespace.
2. The method of claim 1, wherein the obtaining the mapping information of the plurality of namespaces in response to the resource configuration event for the target container comprises: In response to a resource configuration event for a target container, a plurality of namespaces are mapped and scanned to obtain mapping information of the plurality of namespaces.
3. The method of claim 2, wherein the mapping scanning, in response to the resource configuration event for the target container, on a plurality of namespaces to obtain mapping information of the plurality of namespaces comprises: In response to a resource configuration event for a target container, computing resources having a mapping relationship with a plurality of namespaces are mapped and scanned to obtain resource information of the computing resources. Based on the resource information, mapping information of the plurality of namespaces is obtained.
4. The method of any of claims 1-3, before the obtaining the mapping information of the plurality of namespaces in response to the resource provisioning event for the target container, further comprising: Configuration parameters of a target namespace and a target computing resource for a target container are obtained. Based on the configuration parameters, the target computing resource is configured through the target namespace, and mapping information of the target namespace is updated.
5. The method of claim 4, wherein the obtaining the configuration parameters of the target computing resource and the target namespace for the target container comprises: A resource mounting request for a target container is received, wherein the resource mounting request includes configuration parameters of a target computing resource; in response to the resource mounting request, a target namespace that does not have a mapping relationship with a computing resource is determined from a plurality of namespaces.
6. The method of claim 4 or 5, after the configuring the target computing resource based on the configuration parameters through the target namespace, further comprising: In a case where it is identified that the target computing resource is configured, a resource configuration event for the target container is generated.
7. The method according to any one of claims 1 to 6, wherein the determining the target namespace from the plurality of namespaces based on the mapping information of the plurality of namespaces comprises: It is identified whether mapping information of the plurality of namespaces is updated; A target namespace in which mapping information is updated is determined from the plurality of namespaces.
8. A data system, the system comprising a target server, the target server containing a target container, a target computing resource and a computing resource controller, the target container comprising a container engine; the computing resource controller, in response to a resource configuration event for the target container, obtaining mapping information of a plurality of namespaces, determining a target namespace from the plurality of namespaces based on the mapping information of the plurality of namespaces, generating a path file of the target namespace of the target container based on the target namespace, wherein, The mapping information of the namespace records information of mapping relationships between the plurality of namespaces and computing resources configured through the plurality of namespaces; and the container engine is configured to mount the target computing resource to the target container based on a path file of the target namespace.
9. The system of claim 8, wherein the target server further comprises a container resource management unit; the computing resource controller is further configured to, in response to a resource configuration event for a target container, send a resource information request to the container resource management unit; the container resource management unit is configured to receive the resource information request, scan computing resources having a mapping relationship with a plurality of namespaces to obtain resource information of the computing resources, and feed back the resource information to the computing resource controller; and the computing resource controller is further configured to receive the resource information fed back by the container resource management unit, and obtain mapping information of the plurality of namespaces based on the resource information. 10. The system of claim 9, further comprising a management platform; and the container resource management unit is further configured to receive a resource loading request for a target container sent by the management platform, wherein, the resource loading request comprises a container identifier of the target container, a resource identifier of a resource to be loaded, and a resource loading request identifier. The resource mounting request includes configuration parameters of a target computing resource, and in response to the resource mounting request, a target namespace that has not established a mapping relationship with the computing resource is determined from a plurality of namespaces.
1. A computing device comprising: The memory and the processor; The memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions, so as to implement the steps of the method in any one of claims 1 to 7.
12. A computer readable storage medium, which stores computer programs / instructions, and the computer programs / instructions, when executed by a processor, implement the steps of the method in any one of claims 1 to 7.
13. A computer program product, which comprises computer programs / instructions, and the computer programs / instructions, when executed by a processor, implement the steps of the method in any one of claims 1 to 7.
Citation Information
Patent Citations
Persistent memory access method and device for container in cloud platform virtual machine
CN114356501A
Cloud computing system data processing method and device, electronic equipment and storage medium
CN116382883A
Serverless namespace management method and system
CN117112204A