A method for training multi-tenant isolation of a visualization service and related devices
By identifying the project identifier and configuring storage volume mount information, the routing relationship between the project access path and the training visualization service instance is established, which solves the problem of training log data isolation and achieves data isolation and correct display between projects.
Patent Information
- Application Number
- CN202611482673.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-21
- Publication Date
- 2026-11-20
AI Technical Summary
In existing technologies, training visualization service instances cannot effectively isolate training log data from different projects, leading to problems such as data being visible to each other, cross-reading, or mixed display.
By receiving requests for training visualization services, the system obtains the project identifier of the target project, determines the corresponding training visualization service instance, project log subpath, and project access path, configures the subpath mounting information of the persistent storage volume, and establishes the routing relationship between the project access path and the training visualization service instance to ensure data isolation for each project.
This achieves effective isolation of training log data between different projects, preventing access requests from being forwarded to the wrong training visualization service instance, preventing data from being mutually visible and cross-read, and ensuring that the training log data of each project is only displayed within the scope of that project.
Smart Images

Figure CN123137930A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a multi-tenant isolation method and related equipment for training visualization services. Background Technology
[0002] With the development of machine learning training platforms, a single training platform typically needs to support multiple projects and one or more training tasks within each project. During the execution of training tasks, training log data such as loss values, accuracy, parameter distributions, and computational graphs can be generated. Training visualization services such as TensorBoard can read the training log data from a specified log directory and display the corresponding training metrics and training process through a visual interface.
[0003] In application scenarios where multiple projects share computing resources and persistent storage, training log data from different projects can be stored in different directories of the persistent storage space. To provide training visualization services to different projects, it is also necessary to configure corresponding training visualization service instances, log reading paths, service endpoints, and access routes.
[0004] However, in existing technologies, different projects may share the same training visualization service instance, or the training visualization service instance may be configured to mount a storage range containing log directories of multiple projects. Therefore, the storage mount range or log reading range of the training visualization service instance may include the log directories of other projects. Consequently, when the mapping between access routes, service endpoints, and training visualization service instances is inconsistent, access requests for a project may be forwarded to a training visualization service instance that does not correspond to that project, resulting in training log data from different projects being mutually visible, cross-read, or mixed in display.
[0005] Therefore, how to effectively isolate training log data from different projects is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] This application provides a multi-tenant isolation method for training visualization services to solve the problem in the prior art that the training log data of different projects are easily visible to each other, cross-read, or mixed and displayed because the training log data of different projects cannot be effectively isolated.
[0007] This application also provides a multi-tenant isolation device for training visualization services, an electronic device, a computer-readable storage medium, and a computer program product.
[0008] The embodiments of this application adopt the following technical solutions: In a first aspect, embodiments of this application provide a multi-tenant isolation method for training visualization services, including: Receive a request to obtain the training visualization service for the target project, and obtain the project identifier of the target project from the request. Based on the project identifier, determine the training visualization service instance corresponding to the target project, the project log sub-path in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project. Different project identifiers correspond to different training visualization service instances, project log sub-paths, and project access paths. Determine the project log mount path corresponding to the project log sub-path in the runtime environment of the training visualization service instance, and configure the sub-path mount information corresponding to the persistent storage volume based on the project log sub-path; Based on the sub-path mounting information, the persistent storage volume is mounted to the project log mount path in the runtime environment of the training visualization service instance, so that the mount range corresponding to the persistent storage volume in the runtime environment is limited to the data range corresponding to the project log sub-path. Configure the log reading path of the training visualization service instance as the project log mounting path, so that the training visualization service instance can read the training log data corresponding to the target project based on the project log mounting path; Configure the project access route corresponding to the project access path so that access requests matching the project access path are forwarded to the corresponding training visualization service instance.
[0009] Secondly, embodiments of this application provide a multi-tenant isolation device for training visualization services, including an acquisition module, a first determination module, a second determination module, a third determination module, a first configuration module, and a second configuration module, wherein: The acquisition module is used to receive the training visualization service acquisition request for the target project and obtain the project identifier of the target project from the training visualization service acquisition request; The first determination module is used to determine the training visualization service instance corresponding to the target project, the project log sub-path in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project based on the project identifier. Different project identifiers correspond to different training visualization service instances, project log sub-paths, and project access paths. The second determination module is used to determine the project log mount path corresponding to the project log sub-path in the running environment of the training visualization service instance, and to configure the sub-path mount information corresponding to the persistent storage volume based on the project log sub-path. The third determining module is used to mount the persistent storage volume to the project log mount path in the runtime environment of the training visualization service instance according to the sub-path mount information, so that the mount range corresponding to the persistent storage volume in the runtime environment is limited to the data range corresponding to the project log sub-path. The first configuration module is used to configure the log reading path of the training visualization service instance as the project log mounting path, so that the training visualization service instance can read the training log data corresponding to the target project based on the project log mounting path; The second configuration module is used to configure the project access route corresponding to the project access path, so that access requests matching the project access path are forwarded to the corresponding training visualization service instance.
[0010] Thirdly, embodiments of this application provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the multi-tenant isolation method for training visualization services as described above.
[0011] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the multi-tenant isolation method for training visualization services as described above.
[0012] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the multi-tenant isolation method for the training visualization service as described above.
[0013] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: The method provided in this application determines the training visualization service instance, project log sub-path, and project access path corresponding to the target project based on the project identifier. It then configures the sub-path mounting information of the persistent storage volume based on the project log sub-path, limiting the visible mounting range of the training visualization service instance in the runtime environment to the data range corresponding to the target project. Simultaneously, it configures the log reading path of the training visualization service instance to the corresponding project log mounting path and establishes a routing relationship between the project access path and the corresponding training visualization service instance. This ensures a consistent correspondence between the project access path, training visualization service instance, storage mounting range, and log reading range for the same project. This allows each project's corresponding training visualization service instance to only mount and read the training log data of its own project, thus avoiding issues such as access requests for one project being forwarded to training visualization service instances of other projects, and the mutual visibility, cross-reading, or mixed display of training log data from different projects. This effectively isolates training log data between different projects. Attached Figure Description
[0014] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A schematic diagram illustrating the implementation process of a multi-tenant isolation method for a training visualization service provided in this application embodiment; Figure 2 This is a schematic diagram illustrating the implementation process of validating the access token carried in the training visualization service acquisition request, as provided in an embodiment of this application. Figure 3 A schematic diagram illustrating an application process of the method provided in the embodiments of this application in practice; Figure 4 This application provides a schematic diagram of the specific structure of a multi-tenant isolation device for training visualization services. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0017] To address the problem in existing technologies where the inability to effectively isolate training log data from different projects leads to mutual visibility, cross-reading, or mixed display of training log data from different projects, this application provides a multi-tenant isolation method for training visualization services.
[0018] Specifically, the implementation flow of the method provided in this application embodiment is as follows: Figure 1 As shown, it includes the following steps: Step 102: Receive a request to obtain training visualization service for the target project, and obtain the project identifier of the target project from the request.
[0019] In this embodiment of the application, the request to obtain the training visualization service can be triggered by the user clicking on controls such as the training visualization service on the front-end interface, or it can be initiated by other platform services through the application programming interface.
[0020] Training visualization service refers to a service that can read training log data generated by training tasks, parse the training log data, and provide a visual access interface. This training visualization service can be TensorBoard, or other training process display services with corresponding log reading and web access capabilities.
[0021] The target project is the project that the current training visualization service request is targeting. The project identifier is used to uniquely distinguish the project, or at least within the current platform. In the specific implementation, it can be a number, a string, or a combination thereof.
[0022] In some embodiments, the frontend can call the GET / resource / pod / createTensorBoard interface to initiate a request to obtain the training visualization service for the target project. Optionally, the request can carry three fields: resourcePoolId, projectId, and image, where projectId is the project identifier, resourcePoolId is the resource pool identifier, and image is the image address of the training visualization service.
[0023] Step 104: Based on the project identifier, determine the training visualization service instance corresponding to the target project, the project log sub-path in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project.
[0024] Different project identifiers correspond to different training visualization service instances, project log sub-paths, and project access paths.
[0025] A training visualization service instance can be understood as a service unit capable of independently running a training visualization service process and handling access requests. Different project identifiers correspond to different training visualization service instances, meaning that for any two different project identifiers, the platform will assign different service instances to them.
[0026] A persistent storage volume is a storage resource that can continue to retain training log data after a training task or service instance restarts or is migrated. This storage resource can be provided by a network file system, a distributed file system, or other storage backends that can be mounted by multiple runtime environments, such as NFS or Ceph storage. A persistent storage claim is used to declare the persistent storage capabilities required by an application and associate it with the corresponding persistent storage volume. In Kubernetes implementations, persistent storage claims can use PersistentVolumeClaim, abbreviated as PVC.
[0027] The project log subpath is a subpath allocated to the target project within the persistent storage volume; the project log mount path is the path used by the target project's training visualization service instance to access the project log subpath within its own runtime environment. For example, when the project identifier is 100, the project log subpath can be tensorboard-logs / 100, and the project log mount path can be / mnt / tensorboard-logs / 100.
[0028] The project access path is the path used to identify the target project and select the project access route from the request path of the access request, such as / 100; the project access address is the complete address formed by combining the basic access address with the project access path, which is used by the user to initiate an access request, such as http: / / magic.example.com / 100.
[0029] In some embodiments, a mapping record between the project identifier and the service instance identifier, the project log subpath, and the project access path can be pre-established, or the corresponding object can be dynamically generated based on the project identifier and preset naming rules. For example, the project identifier can be appended to the service instance name, the storage directory prefix, and the access path prefix.
[0030] Optionally, the training visualization service instance can be an already running instance or an instance that is ready to be created based on a training visualization service acquisition request. In an optional implementation, to avoid the duplicate creation of multiple sets of resources for the same project, before determining the training visualization service instance corresponding to the target project based on the project identifier, it is also possible to query whether the instance resources, network service resources, and access routing resources corresponding to the target project exist based on the project identifier, and obtain resource query results. The resource query results can record the existence status of the three types of resources respectively, so that when only one or two resources are missing, the resources that need to be added can be accurately identified subsequently.
[0031] When the resource query results indicate that all three types of resources exist, the creation process of the corresponding resources can be skipped, and the training visualization service instance, project log sub-path, and project access path corresponding to the existing resources can be determined.
[0032] Alternatively, if the resource query results indicate that at least one resource is missing, the missing resources can be created and configured separately based on the project identifier until the instance resource, network service resource, and access route resource corresponding to the target project all exist. For example, if the instance resource and access route resource already exist but the network service resource is missing, only the network service resource is created, without recreating the existing resource. By creating resources according to their type, the need to delete and rebuild the entire set of resources due to the absence of a single resource can be avoided.
[0033] In some embodiments, the name tensorboard-{projectId} can be used to query Deployment, Service, and Ingress objects respectively. If the Kubernetes application interface returns success, it means that the corresponding object exists; if it returns a not found status, it means that the corresponding object does not exist. Here, resource existence means that the corresponding Deployment, Service, or Ingress resource object has been created.
[0034] In some embodiments, instance resources can be Deployments in a Kubernetes cluster. A Deployment is a deployment resource used to declare and manage replicas of Pods, and a Pod is a group of containers capable of hosting one or more containers. By creating Deployments with different names and project tags for different projects, the training visualization service processes for different projects can be managed by different deployment resources.
[0035] When the resource query result indicates that the Deployment representing the target project does not exist, the Deployment can be created and configured as follows: First, obtain the image address of the training visualization service from the request for the training visualization service, and build a service container for running the training visualization service instance based on the image address.
[0036] For example, in a TensorBoard instance, the service container can be named tensorboard, and the image pull strategy can be set to IfNotPresent, so that if the same image already exists locally on the node, it does not need to be pulled again.
[0037] Next, you can configure the service container's log directory parameter to the project log mount path, so that the training visualization service instance uses this path as the log reading path after startup. For example, you can configure "tensorboard" and "--logdir= / mnt / tensorboard-logs / 100" in the container startup parameters. The first parameter is used to start TensorBoard, and / mnt / tensorboard-logs / 100 in the second parameter is the project log mount path for project 100.
[0038] In this embodiment, the container startup parameters may further include "--host=0.0.0.0", "--port=6006", and "--reload_interval=10". The `host` parameter causes the training visualization service to listen to the container's network interface, the `port` parameter specifies the listening port, and the `reload_interval` parameter causes the training visualization service to rescan the logs at appropriate intervals. The values 6006 and 10 seconds are merely examples for TensorBoard deployment and can be configured according to the training visualization service used and the required update frequency.
[0039] Subsequently, Pod templates can be built based on the configured service containers. The metadata of the Pod template can be set with two project tags: `app=tensorboard` and `Project={projectId}`, where the value of the `Project` tag corresponds to the project identifier. The container list of the Pod template includes the aforementioned service containers. The Deployment's tag selector can be configured to match both `app=tensorboard` and `Project={projectId}`, ensuring that the Deployment only manages Pods with the target project tag.
[0040] Next, a Deployment can be created based on the Pod template and the configured tag selector. A specific Deployment can use apps / v1 as the application interface version, the kind field as Deployment, the name as tensorboard-{projectId}, the namespace read from the platform configuration, and the metadata tags can include app=tensorboard and Project={projectId}. The replicas in the Deployment specification can be set to 1 to accommodate scenarios with low access volume for training visualization. It should be noted that replicas of 1 is only an exemplary illustration in this application embodiment and does not impose any limitation on this application embodiment; optionally, when the access volume of a single project increases, multiple replicas can be configured, and the network service resources corresponding to the project can distribute requests among these replicas of the same project.
[0041] In some embodiments, network service resources can be Services within a Kubernetes cluster. A Service provides a relatively stable network endpoint for dynamically created Pods and discovers backend Pods based on a tag selector. When a resource query result indicates that the Service for the target project does not exist, the Service can be created and configured as follows: First, the project tag corresponding to the instance resource is determined based on the project identifier. This project tag is consistent with Project={projectId} in the aforementioned Deployment Pod template. Then, the Service's tag selector is configured to match app=tensorboard and Project={projectId}, ensuring that the Service only selects the TensorBoard Pod of the target project as the backend endpoint. A specific Service can use v1 as the application interface version, the kind field as Service, the name as tensorboard-{projectId}, and the namespace read from the platform configuration.
[0042] Next, you can obtain the preset listening port corresponding to the training visualization service, and configure the service port and target port of the Service based on this preset listening port. Taking TensorBoard as an example, both the service port (port) and the target port (targetPort) can be set to 6006, and the protocol can be TCP. The service port is the port used by other cluster resources to access the Service, and the target port is the container listening port used by the Service to forward requests to the service container.
[0043] Finally, after creating a Service based on the label selector, service port, and target port, Kubernetes can automatically discover Pods with the target project label according to the selector and form corresponding service endpoints. The Service type can use ClusterIP, making this network endpoint reachable only within the cluster by default, with external requests entering through Ingress (described later). Therefore, project access routing does not need to directly track Pod address changes, and because different project Services use different project label selectors, access requests will not be selected to instances of other projects due to dynamic changes in Pods.
[0044] In some embodiments, the access routing resource can be an Ingress in a Kubernetes cluster, which is used to declare matching rules for external HTTP or HTTPS requests and backend services.
[0045] When the Ingress representing the target project in the resource query results does not exist, the Ingress can be created and configured as follows: First, you can configure the Ingress request matching path to the project access path and the matching method to Prefix. For example, taking project identifier 100 as an example, the request matching path can be / 100. Prefix matching ensures that / 100, as well as page sub-paths, static resource paths, and data interface paths prefixed with / 100, can all match the routing rules of the target project.
[0046] Secondly, configure the Ingress backend service to the Service corresponding to the target project, and configure the backend port to the service port of that Service. For example, the backend service name for the Ingress path / 100 can be tensorboard-100, and the backend port can be 6006. Thus, when the request path matches / 100, Ingress will forward the request to the Service tensorboard-100, and then that Service will forward it to the TensorBoard Pod with Project=100 according to the project tag selector.
[0047] Next, you can read the ingress controller class name and optional access domain name from environment variables or configuration files. For example, you can use `notebookIngressClassName` to represent the ingress controller class name, configure it as nginx, and then specify the corresponding ingress controller through the `kubernetes.io / ingress.class` annotation or the `IngressClassName` field. If `notebookIngressAccessByHost` is configured, such as `magic.example.com`, you can write that domain name into the `host` field of the Ingress rule; if no domain name is configured, you can access the corresponding path through the ingress controller's network address.
[0048] Optionally, Ingress can use networking.k8s.io / v1 as the application interface version, with the kind field being Ingress and the name being tensorboard-{projectId}, the namespace being read from the platform configuration. After the Ingress controller detects this resource, it can update its proxy configuration so that external requests are forwarded to the corresponding project service according to the project access path.
[0049] Finally, when TensorBoard is deployed in a non-root path, the access path prefix parameter for the training visualization service instance can also be configured to match the project access path. For example, "--path_prefix= / 100" can be configured in the service container startup parameters for project 100. This parameter causes TensorBoard to use the / 100 prefix when generating inline links, static resource addresses, and data interface addresses, thus cooperating with the Ingress Prefix rules and preventing page loading failures caused by the homepage being able to open but static resources still being loaded from the root path.
[0050] Correspondingly, Project 200 can use / 200, Service tensorboard-200, Project=200 Pod, and "--path_prefix= / 200". This way, when a user accesses http: / / magic.example.com / 100, the request is forwarded to the Project 100 instance, and when a user accesses http: / / magic.example.com / 200, the request is forwarded to the Project 200 instance. The two projects can share the domain name and ingress controller, but they will not share project routing rules, Services, or training visualization service instances.
[0051] When a user actually accesses the TensorBoard of project 100, the domain name can first be resolved to the network address of the node where the ingress controller is located or the load balancer. After receiving the request, the ingress controller matches the Ingress rules of project 100 according to the path / 100. The Ingress forwards the request to the Service tensorboard-100. The Service finds the Pod of Project=100 according to the project tag and forwards the request to port 6006 of that Pod. The TensorBoard processes the request according to the path_prefix and loads static resources, and then reads the training log data from / mnt / tensorboard-logs / 100 pointed to by logdir. Finally, the TensorBoard parses the training metrics such as loss value and accuracy and returns the visualization results to the browser.
[0052] Step 106: Determine the project log mount path corresponding to the project log sub-path in the runtime environment of the training visualization service instance, and configure the sub-path mount information corresponding to the persistent storage volume based on the project log sub-path.
[0053] In some embodiments, the runtime environment of the training visualization service instance can be a container, a container group, a virtual machine, or other environment capable of mounting storage volumes and running the training visualization service process.
[0054] In this embodiment, the subpath mount information can at least indicate which subpath of the persistent storage volume the data is retrieved from, and indicate where that subpath is presented within the runtime environment. Furthermore, the subpath mount information can be stored as a container orchestration configuration, operating system mount parameters, or a platform-internal mount description object.
[0055] Optionally, the project log mount path can be dynamically generated based on the project identifier, or the same in-container path can be used for different projects, but mapped to different project log sub-paths in different runtime environments.
[0056] In some embodiments, a persistent storage volume can be a storage volume shared by multiple projects and associated with a persistent storage declaration. In this case, when configuring the subpath mount information corresponding to the persistent storage volume based on the project log subpath, a log volume referencing the persistent storage declaration can be constructed first; then, the service container can construct the subpath mount information for the log volume, configuring the mount subpath in the subpath mount information as the project log subpath, and configuring the container mount path in the subpath mount information as the project log mount path; finally, the subpath mount information is configured in the service container, and the log volume is configured in the container group template, so that when the service container runs, the project log subpath in the persistent storage volume is mounted to the project log mount path in the runtime environment according to the subpath mount information.
[0057] In practical applications, the first step is to construct a log volume that references a PVC. This log volume can be named `tb-logs`, and its persistent storage declaration references the PVC name configured on the platform. This log volume is configured in the Pod template, enabling Pods generated based on the template to request and mount the corresponding persistent storage volume.
[0058] Secondly, service containers can be configured with subpath mounting information for the log volume. For example, for project 100, the volume name can be configured as tb-logs, the mount subpath as tensorboard-logs / 100, and the container mount path as / mnt / tensorboard-logs / 100; for project 200, these can be configured as tensorboard-logs / 200 and / mnt / tensorboard-logs / 200 respectively. The mount subpath corresponds to the project log subpath, and the container mount path corresponds to the project log mount path.
[0059] Then, the subpath mount information is configured in the service container, and the log volume is configured in the Pod template. When the service container runs, Kubernetes mounts the target project log subpath in the persistent storage volume to the project log mount path in the service container's runtime environment based on the subpath mount information. The content seen by the service container at this mount point is rooted at the target project log subpath; other project log subpaths in the same persistent storage volume are not directly displayed.
[0060] Optionally, the underlying persistent storage volume can be provided by a network file system that supports ReadWriteMany access mode, such as NFS, or by other storage systems that support corresponding shared access capabilities. Multiple training task Pods and multiple project TensorBoard Pods can mount the same persistent storage volume, but each project's TensorBoard Pod obtains a different project log subpath through subPath. This approach can reuse a single PVC, reducing the management overhead of requesting a separate storage volume for each project.
[0061] Step 108: Mount the persistent storage volume to the project log mount path in the runtime environment of the training visualization service instance according to the sub-path mount information, so that the mount range corresponding to the persistent storage volume in the runtime environment is limited to the data range corresponding to the project log sub-path.
[0062] Specifically, limiting the mount range corresponding to the persistent storage volume in the runtime environment to the data range corresponding to the project log subpath means that when the training visualization service process accesses the mount point from its normal file system view, it presents the target project's project log subpath, rather than the root directory of the persistent storage volume or the project log subpath of other projects. Therefore, even if multiple projects share the same persistent storage volume on the storage backend, the mount views obtained by each project instance will still be different.
[0063] Step 110: Configure the log reading path of the training visualization service instance as the project log mounting path, so that the training visualization service instance can read the training log data corresponding to the target project based on the project log mounting path.
[0064] In some embodiments, the log reading path can be specified via command-line parameters, environment variables, or configuration files when the training visualization service instance starts, or it can be set via the service configuration interface after the instance is running. Subsequently, the training visualization service instance can scan the event files, metric files, or other training log files in this path and parse and display them in a way that it supports, thereby configuring the log reading path of the training visualization service instance as the project log mounting path.
[0065] In some embodiments, when a project includes multiple training tasks, each training task can write its training log data to the same directory in the project log subpath or its corresponding subdirectory. The training visualization service instance then aggregates and loads the logs of these training tasks using the project log mount path as the root read path. This enables a unified display of multiple training tasks within a project, while preventing the project-wide aggregation from being extended to cross-project reading because the root read path remains within the mount view corresponding to the target project.
[0066] Step 112: Configure the project access route corresponding to the project access path so that access requests matching the project access path are forwarded to the corresponding training visualization service instance.
[0067] Optionally, project access routing can be implemented by a reverse proxy, application gateway, service mesh ingress, or cluster ingress controller. Route matching can be exact matching, prefix matching, or other matching methods that can distinguish the project access path.
[0068] The method provided in this application determines the training visualization service instance, project log sub-path, and project access path corresponding to the target project based on the project identifier. It then configures the sub-path mounting information of the persistent storage volume based on the project log sub-path, limiting the visible mounting range of the training visualization service instance in the runtime environment to the data range corresponding to the target project. Simultaneously, it configures the log reading path of the training visualization service instance to the corresponding project log mounting path and establishes a routing relationship between the project access path and the corresponding training visualization service instance. This ensures a consistent correspondence between the project access path, training visualization service instance, storage mounting range, and log reading range for the same project. This allows each project's corresponding training visualization service instance to only mount and read the training log data of its own project, thus avoiding issues such as access requests for one project being forwarded to training visualization service instances of other projects, and the mutual visibility, cross-reading, or mixed display of training log data from different projects. This effectively isolates training log data between different projects.
[0069] In practical applications, considering that different resource pools can correspond to different cluster nodes and computing resource supply ranges, and that training visualization service instances corresponding to multiple projects may run simultaneously in the same Kubernetes cluster, if the scheduling location of container groups and the resource occupation range of service containers are not limited, container groups may be scheduled to nodes that do not belong to the corresponding resource pool, or a single training visualization service instance may occupy too much computing resources, thereby affecting the operation of training visualization service instances corresponding to other projects.
[0070] To avoid the above problems, this application embodiment can further configure node scheduling configuration according to resource pool identifier and set the resource request volume and resource limit of service container according to preset resource configuration when configuring the container group template of instance resources.
[0071] Specifically, the training visualization service acquisition request may include not only the target project's identifier and the image information used by the service container, but also a resource pool identifier. The resource pool identifier represents the resource pool used by the target project and serves as the basis for determining the container group scheduling scope. After obtaining the resource pool identifier from the training visualization service acquisition request, the platform can determine the node scheduling configuration corresponding to the container group template based on the pre-configured correspondence between resource pool identifiers and node scheduling rules.
[0072] In one specific implementation, node scheduling configuration can include a node selector and tolerances. The platform can call the `buildNodeSelector(resourcePoolId)` method to generate a node selector based on the resource pool identifier, ensuring that container groups generated from container group templates only select nodes with the corresponding node labels as candidate scheduling nodes. It can also call the `buildTolerations()` method to generate tolerances, allowing container groups to be scheduled to nodes with corresponding node taints. The node selector is used to narrow down the range of candidate scheduling nodes based on node labels, while the tolerances are used to ensure that container groups meet the scheduling admission conditions for the corresponding special nodes. Together, these constitute the node scheduling configuration, ensuring that the candidate scheduling nodes of the container group correspond to the resource pool indicated by the training visualization service's request.
[0073] The platform can also obtain preset resource configurations for running training visualization service instances from configuration files. These preset resource configurations can include processor resource configurations and memory resource configurations. Based on these preset resource configurations, the platform determines the resource request amount and resource limit for each service container. The resource request amount represents the amount of computing resources calculated based on the service container's operational needs when scheduling the container group. The Kubernetes cluster can use the resource request amount to determine whether candidate scheduling nodes have allocable computing resources sufficient to meet the container group's operational needs. The resource limit represents the maximum computing resources allowed for the service container during operation, constraining the upper limit of the service container's resource usage.
[0074] For example, the resource request amount of a service container may include the processor resource request amount and memory resource request amount read from the configuration file, such as a processor resource request amount of 0.5 cores and a memory resource request amount of 1 Gi; the resource limit of a service container may include the processor resource limit amount and the memory resource limit amount, such as a processor resource limit amount of 2 cores and a memory resource limit amount of 4 Gi.
[0075] After determining the node scheduling configuration, resource request volume, and resource limit, the node scheduling configuration can be configured in the container group specification of the container group template, and the resource request volume and resource limit can be configured in the resource configuration of the service containers contained in the container group template. When the Kubernetes cluster generates and schedules container groups based on the container group template, it first determines candidate scheduling nodes that meet the corresponding node tags and scheduling admission conditions based on the node scheduling configuration, and then determines the nodes with the corresponding allocable computing resources from the candidate scheduling nodes based on the resource request volume. After the service container runs, the Kubernetes cluster limits the maximum computing resources that the service container can occupy based on the resource limit.
[0076] In this way, since the resource pool identifier is converted into the node scheduling constraint of the container group, the container group carrying the training visualization service instance can be scheduled to the node range that matches the corresponding resource pool. At the same time, since the resource request volume participates in the scheduling judgment of the container group, and the resource limit is used to constrain the maximum resource consumption during the service container's operation, it can reduce the situation where the container group is scheduled to a node with insufficient computing resources or does not belong to the corresponding resource pool, and avoid the excessive consumption of cluster computing resources by a single project's training visualization service instance, which would affect other projects. This further realizes the isolation between different projects in terms of computing resource scheduling and resource consumption, and improves the stability of multi-project training visualization service operation.
[0077] In one optional implementation, considering that although the project access route corresponding to the target project has been configured, the requester still needs to obtain the complete address that can actually initiate the access request; if the front-end derives or concatenates the access address itself, the path used may be inconsistent with the project access path configured on the back-end, causing the access request to fail to hit the project access route corresponding to the target project. To avoid this problem, in this embodiment, after completing the configuration of the project access route, the basic access address of the training visualization service can be further obtained, the basic access address can be combined with the already determined project access path to generate the project access address corresponding to the target project, and the project access address can be returned to the requester through the service response.
[0078] The basic access address is the public address portion used when the training visualization service provides an access point to the outside world. It may include communication protocols, domain names or network addresses, and optional port information. The project access path is the path portion used to distinguish different projects and match the access routes of the corresponding projects. The project access address is the complete address formed by the basic access address and the project access path, which can be directly accessed by the requester.
[0079] Specifically, after determining the training visualization service instance and project access path corresponding to the target project, and completing the configuration of the corresponding project access routes, the basic access address of the training visualization service can be read from the configuration file. For example, the basic access address http: / / magic.example.com can be obtained by reading the configuration item user.config.notebook-ingress-controller-url. This basic access address can point to the entry controller used to receive access requests to the training visualization service and can be used by different projects. The basic access address can also be the network address corresponding to the entry controller, and its specific form can be determined according to the network deployment method of the training visualization service.
[0080] The platform determines the project access path based on the target project's project identifier. For example, if the project identifier is 100, the project access path could be / 100; if the project identifier is 200, the project access path could be / 200. Then, the `getProjectTensorboardUrl(projectId)` method can be called to concatenate the base access address with the project access path according to preset address concatenation rules, generating the project access address corresponding to the target project. For example, concatenating the base access address `http: / / magic.example.com` with the project access path ` / 100` generates the project access address `http: / / magic.example.com / 100` for project 100; concatenating the base access address with the project access path ` / 200` generates the project access address `http: / / magic.example.com / 200` for project 200.
[0081] In one specific implementation, regardless of whether the request for the training visualization service triggers the creation of the resource corresponding to the target project, or whether the training visualization service instance and project access route for the target project already exist, the project access address can be generated after confirming that the project access route for the target project is available. In this way, even when existing resources are reused, there is no need to repeatedly create the training visualization service instance and project access route; the corresponding project access address can still be returned to the requester.
[0082] After generating the project access address, it can be written into the service retrieval response, forming a service retrieval response carrying the project access address. This response is then sent to the front end in response to the current training visualization service retrieval request. Upon receiving the service retrieval response, the front end can display the project access address as an accessible link, or open the project access address in a browser window based on a user-triggered viewing action, without needing to determine the base access address of the training visualization service or deduce the corresponding project access path.
[0083] When a user initiates an access request via a project access address, the request path includes the corresponding project access path. For example, an access request initiated via http: / / magic.example.com / 100 has a request path that matches the project access path / 100. After receiving this access request, the ingress controller can forward the access request to the training visualization service instance corresponding to project 100 according to the configured project access route, so that the training visualization service instance can read and display the training log data corresponding to project 100.
[0084] In this way, since the project access address is generated using the basic access address uniformly obtained by the backend and the already determined project access path, and the service response corresponding to the request is obtained through the training visualization service and directly returned to the requester, the access address used by the requester can be kept consistent with the project access route corresponding to the target project. This reduces the situation where the project access path is missing or inconsistent due to the requester concatenating the address themselves, so that the access request can accurately hit the project access route corresponding to the target project and be forwarded to the corresponding training visualization service instance.
[0085] In one alternative implementation, considering that the training visualization service instance needs to read training log data from the data range corresponding to the project log sub-path, if the training task does not write training log data according to the project log sub-path corresponding to the target project, even if the mounting range and log reading path of the training visualization service instance have achieved project-level isolation, there may be problems such as the training log data not entering the corresponding reading range, being written to other project directories, or not being able to be read by the corresponding training visualization service instance.
[0086] To avoid the aforementioned technical problems, in this embodiment of the application, when submitting the training task corresponding to the target project, the project log sub-path can also be determined according to the project identifier, and the log writing path corresponding to the project log sub-path in the running environment of the training task can be passed to the training task, so that the training task writes the generated training log data to the project log sub-path.
[0087] Specifically, the training task submission request is used to request the creation and execution of training tasks under the target project. In response to the training task submission request, the platform can obtain the project identifier of the target project from the training task submission request or the training task record corresponding to the request, and determine the project log sub-path in the persistent storage volume corresponding to the target project based on the project identifier.
[0088] Project log subpaths can be generated based on the project identifier and preset directory naming rules. For example, a public directory `tensorboard-logs` can be set in the persistent storage volume, and the project identifier can be used as the subdirectory name under this public directory. When the project identifier is 100, the corresponding project log subpath could be `tensorboard-logs / 100`; when the project identifier is 200, the corresponding project log subpath could be `tensorboard-logs / 200`. These project log subpaths represent the storage location within the persistent storage volume, not the file system path directly used by the training task in its runtime environment.
[0089] After determining the project log subpath, you can check if it already exists. If it doesn't exist, the platform creates it in the persistent storage volume to provide a storage location for subsequent training log data written to the training task. If it already exists, it can be reused directly. Therefore, the project log subpath can be created when the first training task under the target project is created, without the training visualization service instance needing to handle its creation. Subsequent submissions of other training tasks within the same project can also continue to use the corresponding project log subpath.
[0090] Subsequently, the persistent storage volume is mounted to the training task's runtime environment. The training task's runtime environment can be a container, a group of containers, or other runtime environments capable of mounting persistent storage volumes, used to run model training programs. In one Kubernetes implementation, the training task's container group and the training visualization service instance's container group can mount a persistent storage volume referenced by the same persistent storage declaration. This persistent storage volume can employ a storage method that supports read / write operations across multiple runtime environments, such as NFS storage with RWX read / write mode, enabling the training task to write training log data and allowing the training visualization service instance to read corresponding data from the same persistent storage volume.
[0091] After mounting the persistent storage volume to the training task's runtime environment, the corresponding log write path within the training task's runtime environment is determined based on the persistent storage volume's mount location and the project log subpath. The log write path is the file system path used by the training task when accessing the project log subpath within its own runtime environment. For example, after mounting the persistent storage volume to the base mount path in the training task's runtime environment, the project log subpath corresponding to the target project can be located under this base mount path, and the corresponding internal runtime path can be determined as the log write path; alternatively, the project log subpath can be directly mounted to a specified path within the training task's runtime environment, and this specified path can be determined as the log write path.
[0092] It's important to note that the log write path and the project log mount path belong to different runtime environments. The log write path is used by the training task to write training log data, while the project log mount path is used by the training visualization service instance to read training log data. The path strings for both can be the same or different, as long as they both map to the same project log sub-path in the persistent storage volume. For example, the project log sub-path for project 100 is tensorboard-logs / 100. This project log sub-path can correspond to a log write path in the training task runtime environment and to the project log mount path / mnt / tensorboard-logs / 100 in the training visualization service instance runtime environment.
[0093] After determining the log write path, the platform passes it to the training task. Specifically, the log write path can be passed to the algorithm program within the training task as a training task startup parameter, environment variable, configuration file content, or task description field. In one implementation, the platform service records the corresponding log write path for the training task in the `visualized_log_path` field when creating the training task, and then passes the log write path to the algorithm program when scheduling the training task. `visualized_log_path` is merely an example field name; its purpose is to store and pass the log write path required by the training task.
[0094] After the training task runs, the algorithm program writes the training log data generated during training, such as loss values, accuracy, parameter distribution, and computation graph, to the received log write path. Since the log write path maps to the project log sub-path corresponding to the target project, the training log data is ultimately written to the project log sub-path in the persistent storage volume, instead of the algorithm program automatically selecting a public log directory that does not correspond to the target project.
[0095] When a target project includes multiple training tasks, each training task can write its training log data based on the target project's project log subpath. Different training tasks can write their training log data to different task subdirectories within the project log subpath to distinguish the training log data generated by each task. Each task subdirectory remains within the data scope defined by the same project log subpath. The training visualization service instance corresponding to the target project can use the project log mount path as the root path to aggregate and read training log data generated by multiple training tasks under that project, without expanding to the project log subpaths of other projects.
[0096] After the training task completes the writing of training log data, the training visualization service instance corresponding to the target project can read the training log data in the same project log sub-path through the project log mount path. For example, TensorBoard can configure the logdir parameter to the project log mount path and periodically scan the project log mount path according to its log refresh mechanism. Once the new training log data written by the training task is visible in the persistent storage volume, it can be read, parsed, and displayed by the training visualization service instance during subsequent refresh processes. The training task side and the training visualization service instance side can rely on the file visibility provided by the persistent storage volume and the log refresh mechanism of the training visualization service instance to complete the connection between writing and reading, without having to make additional application-layer read-write locks a necessary condition for this implementation method.
[0097] In this way, since both the training task side and the training visualization service instance side determine and use the same project log sub-path based on the same project identifier, and the platform explicitly passes the log writing path corresponding to the project log sub-path to the training task, the training log data generated by the training task can accurately enter the log storage range corresponding to the target project. This reduces the possibility of the training task writing the training log data to a public directory, other project directories, or directories that the training visualization service instance cannot read. As a result, the log writing process of the training task and the restricted mounting and log reading process of the training visualization service instance form a closed loop. While supporting the aggregation and display of logs from multiple training tasks within the same project, this further ensures the isolation of training log data from different projects.
[0098] In an optional implementation, considering that the project identifier carried in the training visualization service acquisition request can only indicate the target project of the request, but cannot indicate the authenticity of the requester's identity or that the requester belongs to the target project, if the training visualization service instance, project log sub-path, and project access path are directly determined without verifying the requester's identity and project member relationships, invalid requests or requests initiated by non-project members may enter the project-level resource and path determination process. Therefore, in this embodiment, before determining the training visualization service instance, project log sub-path, and project access path corresponding to the target project based on the project identifier, if... Figure 2 As shown, the validity of the access token carried in the training visualization service acquisition request can be verified first, and then the project member association record can be queried according to the user identifier corresponding to the valid access token. The processing flow of steps 102 to 112 above can only be entered when the access token is valid and there is a project member association record.
[0099] Specifically, users can complete identity authentication through the training platform's single sign-on system. After the single sign-on system verifies the authentication information submitted by the user, it generates an access token and returns it to the front end. The access token can be a JSON Web Token (JWT) or a session identifier associated with the server session. The front end can store the access token locally or in a cookie and include it in the training visualization service retrieval request when the user initiates such a request. For example, the access token can be included in the Authorization header of the training visualization service retrieval request in the form of Bearer {token}. The training visualization service retrieval request also carries the target project's identifier so that the user identified by the access token can be subsequently associated with the target project for verification.
[0100] After receiving a request to access the training visualization service, the platform extracts the access token from the request and verifies its validity, obtaining a token verification result. The token verification result indicates whether the access token can effectively prove the identity of the current requester, and can include either a valid or invalid access token.
[0101] When the access token is a JWT, it can be verified whether the access token has expired, whether the access token signature is correct, and whether the access token issuance information conforms to the platform's token verification rules. When the access token is a session identifier associated with a server session, it can be used to query whether the corresponding session exists and whether the session is still valid. When the training visualization service request does not carry an access token, the access token cannot be parsed, the access token has expired, the access token signature verification fails, or the corresponding session has expired, a token verification result indicating an invalid access token can be obtained.
[0102] If the token verification result indicates that the access token is invalid, the platform rejects the request to obtain the training visualization service. For example, it can return an HTTP 401 Unauthorized status to the frontend and terminate further processing of the current request to obtain the training visualization service. In this case, it no longer determines the training visualization service instance, project log subpath, and project access path corresponding to the target project based on the project identifier, nor is it necessary to continue querying project member association records. In this way, requests with unverifiable identities can be blocked at the front end of the process, reducing the impact of invalid requests on subsequent database queries, project-level resource determination, and resource configuration processes.
[0103] If the token verification result indicates that the access token is valid, the platform determines the user identifier based on the access token. The user identifier is used to distinguish different users within the training platform and serves as an association condition for subsequent queries of project member-related records. For JWTs, the user identifier can be parsed from the token payload of the access token; for access tokens associated with a server session, the security context or session information can be queried based on the access token, and the user identifier can be obtained from the security context or session information.
[0104] For example, the backend service can obtain the SessionUser object corresponding to the current access token using the currentUserService.getCurrentUser() method, then retrieve the userId from that object and use the userId as the user identifier. It can also retrieve user information such as username and role from this object for logging or other permission processing.
[0105] After determining the user identifier, the platform queries the project member association records based on the user identifier and the project identifier obtained from the training visualization service request, thus obtaining the member query results. The project member association records are used to indicate whether a valid membership relationship exists between a user and a project. A valid access token only proves the user's identity is trustworthy; it cannot prove that the user belongs to the target project alone. Therefore, it is necessary to combine the user identifier and the project identifier to query the project member association records.
[0106] In a specific database implementation, project member association records can be stored in the `project_user_info` table. This table must include at least two fields: `user_id` and `project_id`. The `user_id` field records the user identifier, and the `project_id` field records the project identifier. The table may also include a logical deletion flag `is_dtl` to indicate whether the corresponding project member association record is still valid. For example, an `is_dtl` value of 0 indicates that the project member association record has not been logically deleted, while an `is_dtl` value of 1 indicates that the project member association record has been logically deleted. The field names and values described above are merely one specific implementation and do not constitute a limitation on the data storage format of project member association records.
[0107] In one implementation using MyBatis Plus, a Mapper can be used to construct a query that simultaneously satisfies the condition that `user_id` equals the current user identifier and `project_id` equals the target project identifier, and then the `selectOne` method can be called to retrieve the corresponding project member association records. For project member association records with a logical deletion flag, a condition that the record has not been logically deleted can be added to the query conditions. Alternatively, after retrieving the project member association records, the validity of the project member association record can be further determined based on the logical deletion flag.
[0108] If no matching project member association records are found, or if the found records are logically deleted, the member query result indicates that no project member association records exist. The platform rejects the current request to obtain the training visualization service and terminates subsequent processing. For example, the platform can log a warning containing the user identifier and project identifier, return an HTTP 403 Forbidden status to the frontend, or throw a corresponding business exception. In this case, although the access token is valid and the user's identity has been confirmed, because the user does not belong to the target project, the steps of determining the training visualization service instance, project log subpath, and project access path based on the project identifier are not executed.
[0109] When a valid project member association record matching the user identifier and project identifier is found, the member query result indicates the existence of such a record. Based on this, the platform determines that the current user belongs to the target project and proceeds to step 102 and subsequent steps. Furthermore, the platform can further configure the mounting relationship of project log subpaths, the log reading path for training the visualization service instance, and the project access route corresponding to the project access path.
[0110] In this way, since only requests with valid access tokens and associated records of project members can enter the process of determining the training visualization service instance, project log subpath, and project access path corresponding to the target project, it can reduce the situation where invalid users or non-project members trigger target project resource processing or obtain project access entry through the interface of the training visualization service. It also connects the project-level resource isolation mechanism of the training visualization service with the platform's identity authentication mechanism and project member management mechanism.
[0111] In practical applications, considering that project member association records are only used to determine whether the current user belongs to the target project, while different users belonging to the same project may have different responsibilities and need different operating permissions, in an optional implementation, if the member query results indicate that there are project member association records, the current user's role information in the target project can also be obtained, and the current user's operating permissions for the training visualization service can be determined based on the role information.
[0112] Specifically, role information can be recorded in the project member association record, or it can be retrieved from the preset role configuration information based on the role identifier contained in the project member association record. In a specific implementation, the user_type field in the project_user_info table can be used as role information. For example, a user_type value of 1 indicates a project manager, and a value of 0 indicates a regular member. The type and number of roles can be configured according to the platform's project management needs, and are not limited to just project manager and regular member roles.
[0113] The platform can pre-establish the mapping between different roles and corresponding operation permissions, and refine the operation permissions to menus, buttons, or interface operations related to the training visualization service. For example, operation permissions may include permissions to create training visualization services, view training visualization services, and manage training visualization services. The platform queries the corresponding operation permissions based on the current user's role information and determines whether the current user has the target operation permissions required for this operation.
[0114] If the current user has the necessary permissions for the target operation, the front-end can display the corresponding menu or button and allow the user to initiate the corresponding operation request. Upon receiving the operation request, the back-end can continue to execute the corresponding training visualization service processing flow. If the current user does not have the necessary permissions for the target operation, the front-end can hide or disable the corresponding menu or button, and the back-end can refuse to execute the operation corresponding to the required permissions, to avoid allowing the user to directly construct an operation request simply by hiding UI controls.
[0115] In this way, since the project member association record is used to determine whether a user belongs to the target project, and the role information is further used to determine the specific operations that the user can perform within the target project, the access rights of different project members to the training visualization service can be further differentiated on the basis of project member-level access control. This reduces the number of ordinary project members performing creation, viewing, or management operations beyond their responsibilities, thereby achieving more granular access control within the project.
[0116] The following describes how the methods provided in the embodiments of this application are applied in practice, taking into account real-world scenarios.
[0117] Please see Figure 3 This is a schematic diagram illustrating an application process of the method provided in this application embodiment. The process specifically includes the following steps: The multi-tenant isolation method for training visualization services provided in this application embodiment can be applied to a training platform including users, training task services, task scheduling services, Kubernetes APIs, and training visualization service instances. The training task service can be the `magic-train` service in the diagram, used to receive training task creation requests and save training task information; the task scheduling service can be the `magic-task` service in the diagram, used to prepare training visualization service instances and their related resources; the training visualization service instance can be... Figure 3 This is an implementation of TensorBoard Pod in the documentation. The following example, using a target project with a project identifier of 100, illustrates the practical application of this method.
[0118] First, the user submits a training task creation request corresponding to the target project to the training task service through the training platform. The request includes the project identifier of the target project and the training parameters required for the training task. The training task service determines the project log sub-path in the persistent storage volume corresponding to the target project based on the project identifier. For example, if the project identifier is 100, the project log sub-path could be tensorboard-logs / 100. If the project log sub-path does not exist, the training task service or the corresponding task scheduling module can create it in the persistent storage volume.
[0119] Secondly, the training task service saves training task information to the database and records the log write path corresponding to the training task in the `visualized_log_path` field. When actually running a training task, the platform mounts the persistent storage volume to the training task's runtime environment, determines the corresponding log write path for the project log subpath within that environment, and passes this log write path to the algorithm program in the training task. During training, the algorithm program writes the generated loss value, accuracy, parameter distribution, and computation graph, among other training log data, to the project log subpath based on the log write path. The diagram does not separately show the training task's runtime environment and its log writing process.
[0120] When a target project includes multiple training tasks, each training task can use its corresponding task subdirectory under the project log subpath. In this way, the training log data generated by multiple training tasks under the target project are all within the data range defined by the project log subpath, and can be uniformly read and displayed by the training visualization service instance corresponding to the target project.
[0121] Next, when a user needs to view the training process of a target project, they can trigger a training visualization service retrieval operation on the front end. The front end then calls the createTensorBoard interface provided by the task scheduling service, sending a training visualization service retrieval request to the task scheduling service. This request carries at least the target project's identifier, and may also include information such as the resource pool identifier and the training visualization service mirror address.
[0122] In one alternative implementation, the request to acquire the training visualization service may also carry an access token. The task scheduling service can verify the validity of the access token before checking or creating resources related to the training visualization service, and query the project member association records based on the user identifier and project identifier corresponding to the access token. Subsequent processing will only proceed if the access token is valid and a project member association record exists.
[0123] The task scheduling service checks whether the training visualization service instance corresponding to the target project already exists based on the project identifier. In the Kubernetes implementation, the Kubernetes API can be used to query whether the Deployment, Service, and Ingress corresponding to the target project have been created. For example, you can query the Deployment, Service, and Ingress named tensorboard-100.
[0124] If all three types of resources already exist, the task scheduling service can reuse existing resources and skip the resource creation process.
[0125] Alternatively, if at least one resource is missing, the task scheduling service identifies the missing resources and creates and configures them via the Kubernetes API. For example, if a Deployment already exists but a Service does not, the Service can be created without recreating the Deployment.
[0126] Specifically, when a Deployment needs to be created, the task scheduling service constructs the Deployment based on the target project's project identifier, the training visualization service image address, and the preset deployment configuration. This Deployment is used to generate the TensorBoard Pod corresponding to the target project, and to assign different training visualization service instances to different projects.
[0127] The task scheduling service uses the project log subpath tensorboard-logs / 100 in the persistent storage volume as the mount subpath and mounts it to the project log mount path in the TensorBoard Pod runtime environment, for example, / mnt / tensorboard-logs / 100. Simultaneously, the TensorBoard's log read path is configured to this project log mount path. In this way, the TensorBoard Pod corresponding to project 100 can only access the training log data corresponding to project 100 through this project log mount path in its runtime environment.
[0128] The task scheduling service can also configure the TensorBoard access path prefix parameter to the project access path / 100, and configure the project tag, node scheduling configuration, resource request volume, and resource limit corresponding to project 100 in the container group template. Kubernetes generates and schedules TensorBoard Pods based on the Deployment's container group template.
[0129] Alternatively, when a Service needs to be created, the task scheduling service creates a Service corresponding to project 100 based on the project identifier, for example, a Service named tensorboard-100. This Service's tag selector matches the project tag of the TensorBoardPod, and the service port and target port are configured to the ports that TensorBoard listens on, such as port 6006. Thus, the Service can discover the TensorBoard Pod corresponding to project 100 and forward access requests to that TensorBoard Pod, instead of selecting the TensorBoard Pod corresponding to other projects.
[0130] Alternatively, when an Ingress needs to be created, the task scheduling service creates an Ingress corresponding to project 100 based on the project identifier, configures its request matching path to the project access path / 100, and sets the matching method to prefix matching. Simultaneously, it configures the backend service of this Ingress to the Service corresponding to project 100, and sets the backend port to the service port of that Service. Thus, access requests with a request path matching / 100 can be forwarded via this Ingress to tensorboard-100, and then from tensorboard-100 to the TensorBoard Pod corresponding to project 100.
[0131] After the training visualization service instance, Service, and Ingress corresponding to the target project already exist, the task scheduling service obtains the basic access address of the training visualization service and generates the project access address corresponding to the target project based on the basic access address and the project access path. For example, if the basic access address is http: / / domain and the project access path is / 100, the project access address http: / / domain / 100 can be generated.
[0132] The task scheduling service generates a service retrieval response carrying the project access address and responds to the training visualization service retrieval request by returning the response to the front end. The front end can display the project access address as an accessible link, allowing users to initiate a training visualization service access request by clicking the link.
[0133] The user accesses http: / / domain / 100 through a browser. The arrow in the diagram, representing the user's direct access to the TensorBoard Pod, indicates the logical result of this access process. In the actual network forwarding process, the access request first reaches the Ingress controller. The Ingress controller matches the Ingress rule corresponding to project 100 based on the request path / 100 and forwards the access request to the Service tensorboard-100. The Service then selects the TensorBoard Pod corresponding to project 100 based on the project tag and forwards the access request to port 6006 of that TensorBoard Pod.
[0134] Upon receiving an access request, the TensorBoard Pod processes page requests, static resource requests, and data interface requests according to the pre-configured access path prefix, and reads training log data through the project log mount path / mnt / tensorboard-logs / 100. Since this project log mount path maps to the project log subpath tensorboard-logs / 100 in the persistent storage volume, the data read by the TensorBoard Pod belongs to the same project log subpath as the data previously written by the training task.
[0135] TensorBoard Pod parses the read training log data and generates a visualization interface that includes changes in loss value, accuracy, parameter distribution, and computation graphs, which is then returned to the user's browser. For multiple training tasks under Project 100, TensorBoard Pod can aggregate and read training log data from each task's subdirectory based on the project log mount path, thus displaying the training process of multiple training tasks under Project 100 in the same visualization interface.
[0136] For other projects with project identifier 200, the project log subpath tensorboard-logs / 200, project log mount path / mnt / tensorboard-logs / 200, project access path / 200, Service tensorboard-200, and the corresponding TensorBoard Pod can be configured in the same way. Although different projects can share the same basic access address and the same persistent storage volume, they can use different training visualization service instances, project log subpaths, project log mount paths, and project access paths.
[0137] To address the problem in existing technologies where the inability to effectively isolate training log data from different projects leads to mutual visibility, cross-reading, or mixed display of training log data from different projects, this application provides a multi-tenant isolation device for training visualization services. A schematic diagram of the device's specific structure is shown below. Figure 4 As shown, it includes an acquisition module 41, a first determination module 42, a second determination module 43, a third determination module 44, a first configuration module 45, and a second configuration module 46. The functions of each module are as follows: The acquisition module 41 is used to receive a training visualization service acquisition request for the target project and to obtain the project identifier of the target project from the training visualization service acquisition request. The first determining module 42 is used to determine the training visualization service instance corresponding to the target project, the project log sub-path in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project based on the project identifier. Different project identifiers correspond to different training visualization service instances, project log sub-paths, and project access paths. The second determining module 43 is used to determine the project log mount path corresponding to the project log sub-path in the running environment of the training visualization service instance, and to configure the sub-path mount information corresponding to the persistent storage volume based on the project log sub-path. The third determining module 44 is used to mount the persistent storage volume to the project log mount path in the runtime environment of the training visualization service instance according to the sub-path mount information, so that the mount range corresponding to the persistent storage volume in the runtime environment is limited to the data range corresponding to the project log sub-path. The first configuration module 45 is used to configure the log reading path of the training visualization service instance as the project log mounting path, so that the training visualization service instance can read the training log data corresponding to the target project based on the project log mounting path; The second configuration module 36 is used to configure the project access route corresponding to the project access path, so that access requests matching the project access path are forwarded to the corresponding training visualization service instance.
[0138] Optionally, the multi-tenant isolation device for training visualization services also includes: The query module is used to query whether the instance resources, network service resources and access route resources corresponding to the target project exist based on the project identifier, and obtain the resource query results; The creation module is used to create and configure the non-existent resources according to the project identifier when the resource query results indicate that at least one of the instance resources, network service resources, and access route resources does not exist, so that the instance resources, network service resources, and access route resources corresponding to the target project all exist.
[0139] Optionally, the instance resource is the deployment resource in the Kubernetes cluster; if the resource query result indicates that the deployment resource does not exist, a module is created for: Obtain the image address of the training visualization service from the training visualization service retrieval request, and build a service container for running the training visualization service instance based on the training visualization service image address; Configure the service container's log directory parameter to the project log mount path, so that the log reading path of the training visualization service instance is configured to the project log mount path; Build a container group template based on the configured service container, configure the project tag of the container group template according to the project identifier, and configure the tag selector of the deployment resources to match the project tag; Deployment resources are created based on container group templates and configured tag selectors.
[0140] Optionally, the persistent storage volume is a storage volume shared by multiple projects and associated with a persistent storage declaration; the second determining module 43 is used for: Construct a log volume that references the persistent storage declaration; The service container is configured with the sub-path mount information for the log volume, and the mount sub-path in the sub-path mount information is configured as the project log sub-path, and the container mount path in the sub-path mount information is configured as the project log mount path. Configure the subpath mount information in the service container and the log volume in the container group template so that when the service container is running, the project log subpath in the persistent storage volume is mounted to the project log mount path in the runtime environment according to the subpath mount information.
[0141] Optionally, the training visualization service acquisition request may also include a resource pool identifier; the multi-tenant isolation device for the training visualization service may also include: a container group template configuration module; The container group template configuration module is used for: Obtain the resource pool identifier from the training visualization service request, and determine the node scheduling configuration corresponding to the container group template based on the resource pool identifier; Obtain the preset resource configuration for running the training visualization service instance, and determine the resource request volume and resource limit of the service container based on the preset resource configuration; Configure node scheduling, resource request volume, and resource limit in the container group template; Among them, the node scheduling configuration is used to limit the candidate scheduling nodes of the container group generated based on the container group template, the resource request amount is used to determine the computing resources required to schedule the container group, and the resource limit amount is used to limit the maximum computing resources that the service container can occupy.
[0142] Optionally, the network service resource is a service resource in the Kubernetes cluster; if the resource query result indicates that the service resource does not exist, a module is created for: The project tag corresponding to the instance resource is determined based on the project identifier, where the project tag is configured in the container group template of the instance resource; Configure the service resource's tag selector to match the project's tags; Obtain the preset listening port corresponding to the training visualization service, and configure the service port and target port of the service resources according to the preset listening port; Service resources are created based on label selectors, service ports, and target ports. The label selectors associate service resources with container groups that have project labels, and the service endpoints provided by the service resources forward access requests to training visualization service instances.
[0143] Optionally, the access routing resource is the ingress resource in the Kubernetes cluster, and the network service resource is the service resource in the Kubernetes cluster; if the resource query result indicates that the ingress resource does not exist, a module is created for: Configure the request matching path of the entry resource as the project access path, and configure the matching method of the request matching path as prefix matching; Determine the service port of the service resource, configure the backend service of the entry resource as the service resource, and configure the backend port of the backend service as the service port; An entry resource is created based on the request matching path, backend service, and backend port. When the request path of the access request matches the project access path, the access request is forwarded to the service resource through the entry resource, and the service resource forwards the access request to the training visualization service instance. The access path prefix parameter for the training visualization service instance is configured as the project access path.
[0144] Optionally, the multi-tenant isolation device for training visualization services is also used for: Obtain the basic access address for the training visualization service; Based on the base access address and the project access path, generate the project access address corresponding to the target project; Generate a service retrieval response carrying the project access address, and return a service retrieval response in response to the training visualization service retrieval request. The project access address is used to initiate an access request that matches the project access path.
[0145] Optionally, the multi-tenant isolation device for training visualization services is also used for: In response to the training task submission request corresponding to the target project, the project log subpath in the persistent storage volume is determined based on the project identifier, and the project log subpath is created if it does not exist. Mount the persistent storage volume to the training task's runtime environment and determine the corresponding log write path for the project log subpath within the training task's runtime environment. The log write path is passed to the training task so that the training task writes the generated training log data to the project log sub-path according to the log write path, so that the training visualization service instance can read it through the project log mount path.
[0146] Optionally, the multi-tenant isolation device for training visualization services is also used for: Obtain the access token from the request to the training visualization service, and verify the validity of the access token to obtain the token verification result; If the token verification result indicates that the access token is invalid, the request to obtain the training visualization service will be rejected. If the token verification result indicates that the access token is valid, the user identifier is determined based on the access token, and the project member association records are queried based on the user identifier and the project identifier to obtain the member query results; If the member query results do not show any associated records for the project members, the request to obtain the training visualization service will be rejected. If the member query results indicate that there are project member association records, the steps are to determine the training visualization service instance corresponding to the target project, the project log sub-path in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project based on the project identifier.
[0147] The multi-tenant isolation device for training visualization services provided in this application is used to implement any of the foregoing method embodiments. Other optional steps in the foregoing method embodiments can be executed by modules with corresponding functions within this device, and their specific implementation processes will not be repeated.
[0148] Furthermore, the multi-tenant isolation device for training visualization services provided in this application embodiment is based on the same inventive concept as the aforementioned method embodiment, and its implementation principle and technical effect are the same. For details, please refer to the aforementioned method embodiment, which will not be repeated here.
[0149] Figure 5 To illustrate the hardware structure of an electronic device according to various embodiments of this application, the electronic device may include a processor 501 and a memory 502 storing computer program instructions. Specifically, the processor 501 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of this application.
[0150] Memory 502 may include mass storage for data or instructions. For example, and not limitingly, memory 502 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 502 may include removable or non-removable (or fixed) media. Where appropriate, memory 502 may be internal or external to an electronic device. In a particular embodiment, memory 502 may be a non-volatile solid-state memory.
[0151] In one embodiment, memory 502 may be read-only memory (ROM). In one embodiment, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0152] The processor 501 implements any of the multi-tenant isolation methods for training visualization services in the above embodiments by reading and executing computer program instructions stored in the memory 502.
[0153] In one example, the electronic device may also include a communication interface 503 and a bus 510. Wherein, as... Figure 5 As shown, the processor 501, memory 502, and communication interface 503 are connected through bus 510 and complete communication with each other.
[0154] The communication interface 503 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0155] Bus 510 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 510 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0156] Furthermore, in conjunction with the multi-tenant isolation method for training visualization services in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the multi-tenant isolation methods for training visualization services in the above embodiments.
[0157] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0158] The above description is merely a specific implementation example of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0159] Secondly, those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0160] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0161] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0162] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0163] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0164] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0165] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0166] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0167] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A multi-tenant isolation method for training visualization services, characterized in that, include: Receive a request to obtain training visualization service for a target project, and obtain the project identifier of the target project from the request to obtain training visualization service; Based on the project identifier, determine the training visualization service instance corresponding to the target project, the project log sub-path in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project, wherein different project identifiers correspond to different training visualization service instances, project log sub-paths, and project access paths. Determine the project log mount path corresponding to the project log sub-path in the runtime environment of the training visualization service instance, and configure the sub-path mount information corresponding to the persistent storage volume based on the project log sub-path; According to the sub-path mounting information, the persistent storage volume is mounted to the project log mounting path in the runtime environment of the training visualization service instance, so that the mounting range corresponding to the persistent storage volume in the runtime environment is limited to the data range corresponding to the project log sub-path. Configure the log reading path of the training visualization service instance as the project log mounting path, so that the training visualization service instance reads the training log data corresponding to the target project based on the project log mounting path; Configure the project access route corresponding to the project access path so that access requests matching the project access path are forwarded to the corresponding training visualization service instance.
2. The method as described in claim 1, characterized in that, Before determining the training visualization service instance corresponding to the target project based on the project identifier, the method further includes: Based on the project identifier, query whether the instance resources, network service resources and access route resources corresponding to the target project exist, and obtain the resource query results; If the resource query result indicates that at least one of the instance resource, the network service resource, and the access route resource does not exist, the non-existent resources are created and configured according to the project identifier, so that the instance resource, network service resource, and access route resource corresponding to the target project all exist.
3. The method as described in claim 2, characterized in that, The instance resources are deployment resources in a Kubernetes cluster; If the resource query result indicates that the deployment resource does not exist, the step of creating and configuring the non-existent resources according to the project identifier includes: Obtain the training visualization service image address from the training visualization service acquisition request, and construct a service container for running the training visualization service instance based on the training visualization service image address; Configure the log directory parameter of the service container to the project log mount path, so that the log reading path of the training visualization service instance is configured to the project log mount path; Based on the configured service container, a container group template is built, the project tag of the container group template is configured according to the project identifier, and the tag selector of the deployment resource is configured to match the project tag; The deployment resource is created based on the container group template and the configured tag selector.
4. The method as described in claim 3, characterized in that, The persistent storage volume is a storage volume shared by multiple projects and associated with a persistent storage declaration; The step of configuring the subpath mount information corresponding to the persistent storage volume based on the project log subpath includes: Construct a log volume that references the persistent storage declaration; Construct the sub-path mounting information of the service container for the log volume, configure the mount sub-path in the sub-path mounting information as the project log sub-path, and configure the container mount path in the sub-path mounting information as the project log mount path; Configure the sub-path mount information in the service container and configure the log volume in the container group template so that when the service container is running, the project log sub-path in the persistent storage volume is mounted to the project log mount path in the runtime environment according to the sub-path mount information.
5. The method as described in claim 3, characterized in that, The training visualization service acquisition request also includes a resource pool identifier; the method further includes: configuring the container group template; The configuration of the container group template includes: Obtain the resource pool identifier from the training visualization service request, and determine the node scheduling configuration corresponding to the container group template based on the resource pool identifier; Obtain a preset resource configuration for running the training visualization service instance, and determine the resource request amount and resource limit amount of the service container based on the preset resource configuration; Configure the node scheduling configuration, the resource request amount, and the resource limit amount in the container group template; The node scheduling configuration is used to limit the candidate scheduling nodes of the container group generated based on the container group template, the resource request amount is used to determine the computing resources required to schedule the container group, and the resource limit amount is used to limit the maximum computing resources that the service container can occupy.
6. The method as described in claim 2, characterized in that, The network service resources are the service resources in the Kubernetes cluster; If the resource query result indicates that the service resource does not exist, the step of creating and configuring the non-existent resources according to the project identifier includes: The project tag corresponding to the instance resource is determined based on the project identifier, wherein the project tag is configured in the container group template of the instance resource; Configure the tag selector of the service resource to match the project tag; Obtain the preset listening port corresponding to the training visualization service, and configure the service port and target port of the service resource according to the preset listening port; The service resource is created based on the label selector, the service port, and the target port, so as to associate the service resource with the container group with the project label through the label selector, and to forward the access request to the training visualization service instance through the service endpoint provided by the service resource.
7. The method as described in claim 2, characterized in that, The access routing resource is the entry resource in the Kubernetes cluster, and the network service resource is the service resource in the Kubernetes cluster; If the resource query result indicates that the entry resource does not exist, the step of creating and configuring the non-existent resources according to the project identifier includes: Configure the request matching path of the entry resource as the project access path, and configure the matching method of the request matching path as prefix matching; Determine the service port of the service resource, configure the backend service of the entry resource as the service resource, and configure the backend port of the backend service as the service port; The entry resource is created based on the request matching path, the backend service, and the backend port. When the request path of the access request matches the project access path, the access request is forwarded to the service resource through the entry resource, and the service resource forwards the access request to the training visualization service instance. The access path prefix parameter of the training visualization service instance is configured as the project access path.
8. The method as described in claim 1, characterized in that, The method further includes: Obtain the basic access address of the training visualization service; Based on the basic access address and the project access path, generate the project access address corresponding to the target project; Generate a service retrieval response carrying the project access address, and return the service retrieval response in response to the training visualization service retrieval request, wherein the project access address is used to initiate an access request that matches the project access path.
9. The method as described in claim 1, characterized in that, The method further includes: In response to the training task submission request corresponding to the target project, the project log sub-path in the persistent storage volume is determined according to the project identifier, and the project log sub-path is created if the project log sub-path does not exist; Mount the persistent storage volume to the runtime environment of the training task, and determine the log write path corresponding to the project log sub-path in the runtime environment of the training task. The log writing path is passed to the training task so that the training task writes the generated training log data to the project log sub-path according to the log writing path, so that the training visualization service instance can read it through the project log mounting path.
10. The method as described in claim 1, characterized in that, Before determining the training visualization service instance corresponding to the target project, the project log subpath in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project based on the project identifier, the method further includes: Obtain an access token from the training visualization service request, and verify the validity of the access token to obtain the token verification result; If the token verification result indicates that the access token is invalid, the request to obtain the training visualization service is rejected. If the token verification result indicates that the access token is valid, the user identifier is determined based on the access token, and the project member association records are queried based on the user identifier and the project identifier to obtain the member query results; If the member query results indicate that there is no record associated with the project member, the request to obtain the training visualization service is rejected. If the member query results indicate the existence of the project member association record, the steps of determining the training visualization service instance corresponding to the target project, the project log sub-path in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project are performed based on the project identifier.
11. A multi-tenant isolation device for training visualization services, characterized in that, It includes an acquisition module, a first determination module, a second determination module, a third determination module, a first configuration module, and a second configuration module, wherein: The acquisition module is used to receive a training visualization service acquisition request for a target project and to acquire the project identifier of the target project from the training visualization service acquisition request. The first determining module is used to determine, based on the project identifier, the training visualization service instance corresponding to the target project, the project log sub-path in the persistent storage volume corresponding to the target project, and the project access path corresponding to the target project, wherein different project identifiers correspond to different training visualization service instances, project log sub-paths, and project access paths. The second determining module is used to determine the project log mount path corresponding to the project log sub-path in the runtime environment of the training visualization service instance, and to configure the sub-path mount information corresponding to the persistent storage volume based on the project log sub-path. The third determining module is used to mount the persistent storage volume to the project log mounting path in the runtime environment of the training visualization service instance according to the sub-path mounting information, so that the mounting range corresponding to the persistent storage volume in the runtime environment is limited to the data range corresponding to the project log sub-path. The first configuration module is used to configure the log reading path of the training visualization service instance as the project log mounting path, so that the training visualization service instance reads the training log data corresponding to the target project based on the project log mounting path; The second configuration module is used to configure the project access route corresponding to the project access path, so that access requests matching the project access path are forwarded to the corresponding training visualization service instance.
12. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the multi-tenant isolation method for the training visualization service as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the multi-tenant isolation method for the training visualization service as described in any one of claims 1 to 10.
14. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the steps of the multi-tenant isolation method for the training visualization service as described in any one of claims 1 to 10.
