Developer access system, developer access method, and program product
By introducing load balancer resources and controllers, authentication proxy containers, and initialization containers into the development machine access system, port allocation conflicts and security issues were resolved, enabling flexible port management and secure authentication, adapting to multi-cloud platform environments, and improving system reliability and efficiency.
Patent Information
- Application Number
- CN202510900629.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-31
AI Technical Summary
Existing development machine access technologies are prone to port allocation conflicts when handling concurrent requests, especially when multiple clients access the site simultaneously. The problem of insufficient port numbers leading to allocation conflicts has not been effectively resolved.
By introducing load balancer resource instances and load balancer controllers from the container orchestration platform cluster, target ports are allocated from the available port pool using a predefined port allocation algorithm, and the ports are recycled back to the available pool after release. Combined with authentication proxy containers and initialization containers to optimize the access process, flexible port management and secure authentication are achieved.
It resolves port allocation conflicts, enables more flexible resource management and enhanced security, improves the reliability and efficiency of development machine access to the system, and adapts to multi-cloud platform environments.
Smart Images

Figure CN120880700A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a development machine access system, development machine access method, and program product. Background Technology
[0002] Currently, development machine access technology typically allocates ports through database query ports and storage ports. However, this method has significant limitations when handling concurrent requests. For example, when multiple clients access the development machine, if multiple access requests arrive simultaneously and the number of available ports is insufficient, port allocation conflicts may occur. Summary of the Invention
[0003] In view of this, embodiments of this application provide a development machine access system, a development machine access method, and a program product.
[0004] In a first aspect, one embodiment of this application provides a development machine access system, including a container orchestration platform cluster, the container orchestration platform cluster including: a load balancer resource instance configured to declare a port allocation request for a load balancing service; a load balancer controller configured to allocate a target port from the available port pool of the load balancer based on the port allocation request declared by the load balancer resource instance, using a predefined port allocation algorithm, and marking the state of the target port as occupied; and after the target port is released, to reclaim the target port to the available port pool.
[0005] In conjunction with the first aspect, in some implementations of the first aspect, the load balancer controller is also configured to: write back the state of the marked target port to the load balancer resource instance so as to store the state of the target port in the database of the container orchestration platform cluster; and / or parse the Layer 4 transport protocol common fields declared in the load balancer resource instance, and generate a Layer 4 load balancer configuration adapted to the target cloud platform based on the Layer 4 transport protocol common fields.
[0006] In conjunction with the first aspect, in some implementations of the first aspect, the development machine access system also includes a development machine Pod, which includes a main container and an authentication proxy container that runs in parallel with the main container in a sidecar mode. The authentication proxy container is configured to receive external access requests to the development machine, perform an authentication process on the access requests, and forward the authenticated access requests to the main container.
[0007] In conjunction with the first aspect, in some implementations of the first aspect, the development machine Pod also includes an initialization container that runs in sidecar mode before the main container starts. The initialization container is configured to perform pre-configuration operations on the development machine environment and exit upon completion.
[0008] In conjunction with the first aspect, in some implementations of the first aspect, the main container is configured to run code services and provide a web page access interface via a layer 7 network protocol so that users can perform code development on web pages and / or execute command-line operations through web terminal functions.
[0009] In conjunction with the first aspect, in some implementations of the first aspect, the development machine access system also includes a machine learning platform server, which is configured to: create a development machine resource instance; encapsulate the configuration rules of the seven-layer application layer routing in the development machine resource instance; and drive the container orchestration platform cluster to generate seven-layer Ingress resources independent of the cloud platform through the configuration rules.
[0010] In conjunction with the first aspect, in some implementations of the first aspect, the development machine access system further includes a development machine controller configured to: listen to development machine resource instances; create and maintain target associated resources in response to state changes of development machine resource instances; and reconstruct the target associated resources based on the expected state defined by the development machine resource instances when it is detected that the target associated resources have been deleted or modified, wherein the state changes include creation and / or updating; the target associated resources include at least one of development machine Pods, SSH service discovery resources, web terminal service discovery resources, and Ingress resources.
[0011] Secondly, one embodiment of this application provides a development machine access method, comprising: sending a development machine access request to a development machine access system through a client, wherein the development machine access system obtains the request based on the method of the first aspect; and accessing a target development machine using the development machine access system based on the development machine access request.
[0012] Thirdly, one embodiment of this application provides a computer-readable storage medium storing a computer program for executing the development machine access method of the second aspect.
[0013] Fourthly, one embodiment of this application provides an electronic device, the electronic device comprising: a processor; a memory for storing processor-executable instructions; the processor being configured to execute the development machine access method of the second aspect.
[0014] Fifthly, one embodiment of this application provides a computer program product including instructions that, when executed on an electronic device, cause the electronic device to implement the development machine access method of the second aspect.
[0015] In this application, on the one hand, a load balancer resource instance is created to define the load balancing strategy of the load balancing service. Users can customize the resource type, realizing more flexible resource management. On the other hand, the load balancer controller can allocate load balancer ports based on a predefined port allocation algorithm to solve the problem of port conflict of the load balancer when multiple port allocation requests are concurrent. It can also recycle the target port to the available port pool after the target port is released, realizing port reuse. Attached Figure Description
[0016] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0017] Figure 1 The diagram shown is a schematic diagram of the structure of a development machine access system provided in an embodiment of this application.
[0018] Figure 2 The diagram shown is a schematic diagram of the structure of a development machine access system provided in another embodiment of this application.
[0019] Figure 3 The diagram shown is a schematic diagram of the structure of a development machine access system provided in another embodiment of this application.
[0020] Figure 4 The diagram shown is a schematic diagram of the structure of a development machine access system provided in another embodiment of this application.
[0021] Figure 5 The diagram shown is a schematic diagram of the structure of a development machine access system provided in another embodiment of this application.
[0022] Figure 6 The diagram shown is a schematic diagram of the structure of a development machine access system provided in another embodiment of this application.
[0023] Figure 7 The diagram shown is a flowchart illustrating a method for creating a development machine access system according to an embodiment of this application.
[0024] Figure 8 The diagram shown is a flowchart of a development machine access method provided in an embodiment of this application.
[0025] Figure 9 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] Figure 1 The diagram shown is a structural schematic of a development machine access system provided in an embodiment of this application. Figure 1 As shown, the development machine access system 10 includes a container orchestration platform cluster 110, which includes a load balancer resource instance 1101 and a load balancer controller 1102.
[0028] Specifically, load balancer resource instance 1101 is configured to declare port allocation requests for the load balancing service. Load balancer controller 1102 is configured to allocate a target port from the available port pool of the load balancer based on the port allocation request declared by load balancer resource instance 1101, using a predefined port allocation algorithm, and mark the target port as occupied; and after the target port is released, return the target port to the available port pool.
[0029] The container orchestration platform cluster 110 is a system that supports automated deployment, scaling, and application containerization management. Optionally, the container orchestration platform cluster 110 is a cluster composed of multiple nodes; in this embodiment, the container orchestration platform cluster 110 is a Kubernetes cluster.
[0030] Load balancer resource instance 1101 is a resource object in the container orchestration platform cluster 110. It defines the port resources required by the load balancing service and is used to declare and manage port allocation requests for the load balancing service. For example, to perform port allocation based on a Kubernetes cluster, a Kubernetes Service can be created. For instance, a Service CR (Custom Resource) can be created in the Kubernetes cluster to define the load balancing policy, port mapping, and other configuration information for the load balancing service, serving as load balancer resource instance 1101.
[0031] The load balancer controller 1102 is a controller component in the container orchestration platform cluster 110, responsible for managing and configuring the behavior of the load balancer. Optionally, the load balancer controller 1102 can listen for declarations of the load balancer resource instance 1101 and perform corresponding operations based on these declarations. In this embodiment, the load balancer controller 1102 is responsible for handling port allocation requests from the load balancer resource instance 1101 and managing the allocation and reclamation of ports.
[0032] The target port is the specific port assigned to the load balancing service, which forwards traffic based on the target port. In this embodiment, the load balancing service forwards received traffic to the backend server corresponding to the target port. For example, when the load balancing service receives a client request, it forwards the client request to another service in the Kubernetes cluster corresponding to the target port based on the target port. After the backend server processes the client request, it returns the response to the load balancer, which then forwards the response back to the client.
[0033] The port allocation algorithm is used to select a suitable port from the available port pool as the target port. Optionally, the port allocation algorithm selects a suitable port from the available port pool for allocation based on at least one of port range, port usage, and load balancing requirements. For example, the port allocation algorithm randomly selects a port from the available port pool as the target port. Furthermore, when the target port is no longer in use, it is marked as available and added back to the available port pool so that it can be reassigned later.
[0034] A development machine refers to a computer or server used by developers to develop, test, and deploy applications. In this embodiment, the development machine is a big data platform used by developers; for example, it could be a development machine container within a Kubernetes cluster that is connected to the big data platform.
[0035] In one implementation, when an access request from the development machine arrives at the container orchestration platform cluster 110, the load balancer resource instance 1101 in the container orchestration platform cluster 110 declares the required port resources through a configuration file, generates a port allocation request, and sends the port allocation request to the load balancer controller 1102. The load balancer controller 1102 receives the port allocation request and then selects a target port from the available port pool based on a predefined port allocation algorithm. Next, it allocates the target port to the load balancing service and marks the target port as occupied. When the load balancing service no longer needs the target port, the load balancer controller 1102 marks the port status as available and returns the target port to the available port pool.
[0036] Understandably, after the target port is assigned, the load balancing service forwards the request to other services in the Kubernetes cluster that correspond to the target port. After the backend server of that service processes the request, it returns the response to the load balancer, which then forwards the response back to the user client.
[0037] In this embodiment, on the one hand, a load balancer resource instance is created to define the load balancing strategy of the load balancing service. Users can customize resource types, realizing more flexible resource management. On the other hand, the load balancer controller can allocate load balancer ports based on a predefined port allocation algorithm to solve the problem of port conflicts of the load balancer when multiple port allocation requests are concurrent. It can also recycle the target port to the available port pool after the target port is released, realizing port reuse.
[0038] To enhance the flexibility and scalability of the development machine's access to system 10, the port allocation process can be further optimized. Furthermore, to better adapt to different cloud platform environments, communication settings for the container orchestration platform cluster 110 can be configured. Specifically, the load balancer controller 1102 is also configured to write back the status of the tagged target port to the load balancer resource instance 1101, so that the status of the target port is stored in the database of the container orchestration platform cluster 110; and / or, parse the Layer 4 transport protocol common fields declared in the load balancer resource instance 1101, and generate a Layer 4 load balancer configuration adapted to the target cloud platform based on the Layer 4 transport protocol common fields.
[0039] In this embodiment, after the load balancer controller 1102 allocates a target port from the available port pool, it updates the status (occupancy or availability) of the target port to the load balancer resource instance 1101, ensuring that the port status recorded in the load balancer resource instance 1101 is up-to-date. Furthermore, the load balancer controller 1102 also synchronizes the status of the load balancer resource instance 1101 to the database of the container orchestration platform cluster 110. Even if the load balancer controller 1102 restarts or fails, the development machine accessing the system 10 can recover the port status from the database.
[0040] Optionally, to avoid data synchronization issues caused by external database storage, the internal storage system of the container orchestration platform cluster 110 can be used as the database for the container orchestration platform cluster 110. For example, in this embodiment, in the Kubernetes cluster, the state of the target port is stored in the etcd database to ensure the persistence of state storage. Specifically, etcd is a scalable distributed key-value store system used to store critical resource instances (CRs). For example, for development machine CRs, etcd can store development machine configurations (such as images, resource quotas), service discovery rules, etc. For Service CRs, etcd can store the port allocation state of the load balancer.
[0041] Optionally, the Layer 4 transport protocol includes the TCP protocol. The common fields of the Layer 4 transport protocol define configuration information related to the transport layer protocol, such as port number and protocol type, which are part of the declaration in the load balancer resource instance 1101. For example, in this embodiment, the common fields of the Layer 4 transport protocol include load balancing protocol type, session hold timeout, health check path, and response timeout threshold. The load balancing protocol type is mainly used to define the transport layer protocol type (such as TCP), the session hold timeout is used to maintain a long-lived connection between the client and the same backend, the health check path is used for the Layer 4 protocol service liveness detection path, and the response timeout threshold is the maximum time to wait for a health check response.
[0042] The target cloud platform is the cloud platform environment in which the load balancing service needs to be deployed, such as AWS, Azure, Google Cloud, Alibaba Cloud, etc. For example, if the target cloud platform is AWS, the load balancer controller 1102 will generate the corresponding load balancer configuration according to the AWS API (Application Programming Interface) specification, including security group rules, listener configuration, etc.
[0043] In this embodiment, by optimizing the port allocation process, persistent storage of port states is achieved, avoiding data synchronization issues caused by external database storage. Furthermore, by generating a universal load balancer configuration for different cloud platforms, configuration differences between platforms are masked, ensuring that the load balancing service can run on various cloud platforms. This achieves adaptability to different cloud platform environments, thereby further improving the overall performance and reliability of the development machine accessing the system.
[0044] Considering that in some scenarios the development environment is quite complex, relying solely on the functions of a load balancer controller is insufficient. To further enhance the security and isolation of the development machine's access to system 10, and to ensure that access requests from the development machine undergo a strict authentication process, this embodiment introduces a development machine Pod and sidecar mode, which implements authentication management of access requests, thereby providing stronger security protection for the development machine's access to system 10.
[0045] Specifically, Figure 2 The diagram shown is a structural schematic of a development machine access system provided in another embodiment of this application. Figure 2 As shown, the development machine access system 10 also includes a development machine Pod 120, which includes a main container 1201 and an authentication proxy container 1202 that runs in parallel with the main container 1201 in a sidecar mode. The authentication proxy container 1202 is configured to receive external access requests to the development machine, perform an authentication process on the access requests, and forward successfully authenticated access requests to the main container 1201.
[0046] Specifically, development Pod 120 is the smallest deployment unit in the container orchestration platform cluster 110, and can contain one or more containers. Development Pod 120 is a Pod running a development environment to support developers' development tasks. The main container 1201 is the core container in development Pod 120, used to run the main functions of the development machine, such as development tools, compilation environment, and testing framework. The sidecar pattern is a container design pattern used to extend the functionality of the main container without modifying its code. In this embodiment, the sidecar container runs in parallel with the main container 1201, sharing the same network namespace and storage volume.
[0047] In this embodiment, the authentication proxy container 1202 is a sidecar container used to handle external access requests to the development machine, execute the authentication process, and forward successfully authenticated requests to the main container 1201. Specifically, the authentication process refers to the process of verifying the legitimacy of the access request, and the authentication method may include at least one of username / password verification, OAuth2.0, and JWT (JSON Web Token) verification.
[0048] For example, in this embodiment, the authentication proxy container 1202 listens for external access requests to the development machine, which may originate from other development machines, testing tools, or external networks. Then, the authentication proxy container 1202 performs an authentication process on the received development machine access request based on a pre-set authentication method. If authentication fails, the authentication proxy container 1202 returns an error response; if authentication succeeds, the authentication proxy container 1202 forwards the development machine access request to the main container 1201. Further, the main container 1201 receives the development machine access request forwarded by the authentication proxy container 1202, performs the corresponding operation, and returns the result.
[0049] Further assuming that a developer accesses a service on the development machine via a browser, generating a corresponding development machine access request, this request first reaches the authentication proxy container 1202 in the container orchestration platform cluster 110. The authentication proxy container 1202 verifies the validity of the JWT token attached to the request. If the token is valid, authentication is considered successful, and the development machine access request is forwarded to the main container 1201. The main container 1201 receives the development machine access request forwarded by the authentication proxy container 1202, performs the corresponding operation, and returns the result.
[0050] In this embodiment, on the one hand, by introducing an authentication proxy container into the development machine Pod to authenticate access requests from the development machine, unauthorized access can be effectively prevented, improving data security. On the other hand, the authentication logic is decoupled from the business logic of the main container, allowing developers to independently update the authentication proxy container without modifying the main container's code, thus improving the flexibility and maintainability of the development machine's access to the system. Furthermore, for multi-tenant environments, this solution can achieve isolation between different tenants based on the authentication proxy container 1202, ensuring data security.
[0051] In some scenarios, the startup and operation of a development machine often rely on a series of complex environment pre-configuration operations, such as installing dependencies, configuring the network, and setting environment variables. If these pre-configuration operations are performed after the main container starts, it may cause delays in the initialization of the development environment, affecting development efficiency. Therefore, in order to further optimize the startup process of the development machine and ensure that the development environment can be put into use quickly and stably, this embodiment introduces an initialization container 1203, which performs necessary environment pre-configuration operations before the main container 1201 starts, laying the foundation for the efficient operation of the development machine.
[0052] Specifically, Figure 3 The diagram shown is a structural schematic of a development machine access system provided in another embodiment of this application. Figure 3As shown, the development machine Pod120 also includes an initialization container 1203 that runs in sidecar mode before the main container starts. The initialization container 1203 is configured to perform environment pre-configuration operations on the development machine and exit upon completion.
[0053] Understandably, the initialization container 1203 is a special sidecar container that runs before the main container 1201 starts.
[0054] Environment pre-configuration refers to a series of preparatory tasks that need to be completed before the main container 1201 starts, ensuring that the development environment is fully configured when the main container 1201 starts. For example, in this embodiment, environment pre-configuration includes installing dependencies, configuring the network, configuring environment variables, and checking whether dependent services are ready. Specifically, installing dependencies includes installing software dependencies required for the development environment, such as compilers and runtime environments; configuring the network includes setting network parameters, such as setting proxy servers and configuring DNS; configuring environment variables includes configuring environment variables required for the development environment, such as database connection information and API keys; dependent services include databases and message queues; checking readiness includes fixing file system permission issues. Optionally, initializing container 1203 can run a script to install necessary dependencies and configure relevant environment variables.
[0055] In one implementation, the container orchestration platform cluster 110 will detect the exit status of the initialization container 1203. Only after the initialization container 1203 successfully exits will the main container 1201 and the authentication agent container 1202 be started.
[0056] In this embodiment, the container orchestration platform cluster detects the status of the initialized container. Only after the initialized container successfully exits will the main container and the authentication agent container be started. This ensures that the development environment is fully configured when the main container starts. This not only reduces the startup delay of the main container and optimizes the startup process of the development machine, but also avoids runtime errors caused by pre-configuration failures, thereby improving the overall efficiency and reliability of the development machine accessing the system.
[0057] To further improve development efficiency and enhance the functionality of the development machine, this application expands its functional scope to better meet the needs of developers. Specifically, in this embodiment, the main container 1201 is configured to run code services and provide a web page access interface via a Layer 7 network protocol, enabling users to perform code development on a web page and / or execute command-line operations through a web terminal function.
[0058] Specifically, the code service is an application running within the main container, providing code editing, debugging, version control, and other functionalities, allowing users to develop code within a web page. Optionally, the code service includes a web-based version of VS Code (such as Theia or VS Code Server), providing a complete development environment. Layer 7 network protocols refer to application layer protocols, exemplarily including HTTP / HTTPS protocols.
[0059] A web access interface refers to a web application interface accessed through a browser. For example, in this embodiment, the main container 1201 provides web access interfaces via HTTP / HTTPS. Users access these web access interfaces through a browser to develop code or execute command-line operations. For instance, a user accesses these web access interfaces through a browser to enter the VS Code Server's web interface.
[0060] A web terminal function refers to a command-line terminal accessed through a browser. Users can open a terminal window in a web page and perform various command-line operations. For example, in this embodiment, the main container 1201 runs a web-based terminal service (e.g., ttyd or web-terminal), allowing users to access the command line through a browser.
[0061] In one implementation, the user enters a target domain name in a browser. The load balancer controller 1102 determines the target port corresponding to the target domain name based on a pre-configured mapping between multiple domain names and multiple ports, and presents a web interface in the browser based on the code services provided by the target port. Alternatively, the user enters a target domain name in a browser, the load balancer controller 1102 determines the target port corresponding to the target domain name based on the pre-configured mapping between multiple domain names and multiple ports, and opens a terminal window based on the target port. The user can then execute various command-line operations in the terminal window, such as running scripts or installing dependencies.
[0062] In this embodiment, a web page access interface is provided through a seven-layer network protocol. The main container can be easily integrated into existing development processes and toolchains to provide a complete code development environment and web terminal functionality. On the one hand, this supports multiple programming languages and tools, meeting the diverse needs of developers and improving development efficiency; on the other hand, the main container can be extended and customized according to requirements, making the configuration and management of the development environment more flexible.
[0063] In some scenarios, especially in multi-cloud environments or large-scale deployment scenarios, in order to efficiently manage and configure development machine resources and ensure that the network access policy of the development machine can flexibly adapt to different cloud platforms, this application embodiment introduces a machine learning platform server, thereby providing stronger adaptability and scalability for the development machine to access system 10.
[0064] Specifically, Figure 4 The diagram shown is a structural schematic of a development machine access system provided in another embodiment of this application. Figure 4 As shown, the development machine access system 10 also includes a machine learning platform server 130, which is configured to create development machine resource instances; encapsulate the configuration rules of the seven-layer application layer routing in the development machine resource instances; and drive the container orchestration platform cluster 110 to generate seven-layer Ingress resources that are independent of the cloud platform through the configuration rules.
[0065] Specifically, the machine learning platform server 130 is a system component that centrally manages development machine resources. It is responsible for creating development machine resource instances and managing the lifecycle of these instances. In this embodiment, when a user needs a new development environment, the machine learning platform server 130 creates a development machine resource instance according to the user's requirements. For example, the machine learning platform server 130 is an ml-server. The user sends a development machine resource instance creation request through the ml-server client, and the ml-server forwards the request to the Kubernetes cluster to create a development machine resource instance in the Kubernetes cluster.
[0066] In some embodiments, when the machine learning platform server 130 creates a development machine resource instance, it encapsulates Layer 7 application layer routing configuration rules within that instance. These rules define how to route external traffic to the development machine's web access interface and web terminal functionality. For example, the configuration rules specify how to route HTTP / HTTPS requests to specific services within the container orchestration platform cluster 110. These rules may include domain name mapping paths, TLS certificate selectors, and HTTP / HTTPS redirection strategies.
[0067] Optionally, the domain name mapping path includes domain name mapping and path mapping. Domain name mapping defines how to map external domain names to internal services; for example, this can be achieved through the `host` field in the Ingress resource. Path mapping defines how to route specific paths to different backend services; for example, this can be achieved through the `path` field in the Ingress resource. The TLS certificate selector, based on TLS certificate selector and certificate management, is used to specify the TLS certificate used in HTTPS connections; for example, this can be achieved through the `tls` field in the Ingress resource. Certificate management is used to specify the certificate's origin (such as a Kubernetes Secret) to ensure the security of HTTPS connections. Redirection policies define how to redirect HTTP requests to HTTPS to ensure all traffic is transmitted over encrypted HTTPS connections; for example, this can be achieved through annotations in the Ingress resource.
[0068] For example, the routing from the first domain name to the first target port and the routing from the second domain name to the second target port are pre-configured in the development machine resource instance. When a user accesses the first domain name through the machine learning platform server 130, the traffic is routed to the first target port of the main container; when accessing the second domain name, the traffic is routed to the second target port of the main container 1201.
[0069] Ingress is a resource within a container orchestration platform cluster used to manage Layer 7 application-layer (e.g., HTTP / HTTPS) routing for external access to services within the cluster. Understandably, different cloud platforms (e.g., AWS, Azure, Google Cloud) may have different requirements for Ingress resources in some scenarios. For example, AWS uses ALB (Application Load Balancer) as the Ingress controller; Azure uses Azure LoadBalancer or NGINX Ingress Controller; and Google Cloud uses GCE Ingress Controller. These different Ingress resources can complicate the deployment of the development machine access system 10 (e.g., development machine resource instances). Therefore, in this embodiment, by configuring rules to generate cloud platform-independent Ingress resources, the development machine access system 10 can flexibly adapt to different cloud platform environments without requiring separate routing rules for each cloud platform.
[0070] Specifically, users define configuration rules for the development machine through the interface provided by the machine learning platform server 130, such as the port for the code service, the port for the web terminal, and the network access interface, and encapsulate these configuration rules into a development machine resource instance. The container orchestration platform cluster 110, based on the development machine resource instance, parses the configuration rules and generates a generic Layer 7 Ingress resource definition according to the characteristics of the target cloud platform. This allows the container orchestration platform cluster 110 to automatically configure network routing based on the definition of the Ingress resource, enabling access from the development machine.
[0071] It should be noted that although this Layer 7 Ingress resource is independent of the cloud platform, it can be correctly parsed and applied by different cloud platforms. That is, the Layer 7 Ingress resource is a universal Layer 7 Ingress resource for a single cloud platform. For example, in this embodiment, the machine learning platform server 130 is an ml-server. After generating a cloud platform-independent Layer 7 Ingress resource, the cloud platform's Ingress controller (such as AWS ALB Ingress Controller, Azure Ingress Controller, etc.) converts it into a configuration specific to that cloud platform. The advantage of this is that users do not need to concern themselves with the specific implementation details of the underlying cloud platform; they only need to request development machine resources through the interface provided by the ml-server. The ml-server can handle all configuration differences related to the cloud platform, allowing users to focus on their main development work.
[0072] Optionally, configuration rules are also used to specify how terminal requests are routed to the web terminal function. For example, configuration rules can specify information such as the source, destination, path, and port of traffic. For instance, when a user accesses a target domain name through a browser, the development machine resource instance forwards the request to the target port corresponding to that target domain name according to the pre-configured Layer 7 application layer routing configuration rules. After receiving the request, the web terminal function provides the user with an interactive command-line interface.
[0073] In this embodiment, on the one hand, the machine learning platform server provides a centralized management interface that can dynamically create and manage development machine resource instances, facilitating unified management of development machine resources and routing configurations for users, and enabling flexible adjustment of resource allocation according to user needs. On the other hand, by encapsulating the configuration rules of the seven-layer application layer routing, it can flexibly adapt to different cloud platform environments without needing to configure routing rules separately for each cloud platform. Furthermore, the seven-layer Ingress resources of the container orchestration platform cluster are independent of the cloud platform, enabling the development machine access system to seamlessly migrate to different cloud platforms, improving the portability and scalability of the development machine access system.
[0074] To further enhance the reliability and automation of the development machine access system 10 and ensure the stability and consistency of development machine resources and their related resources, this application embodiment introduces a development machine controller, which is used to monitor the state changes of development machine resource instances and automatically create, maintain and rebuild target associated resources, thereby achieving highly automated resource management.
[0075] Specifically, Figure 5 The diagram shown is a structural schematic of a development machine access system provided in another embodiment of this application. Figure 5 As shown, the development machine access system 10 also includes a development machine controller 140, which is configured to: listen to development machine resource instances; create and maintain target associated resources in response to state changes of development machine resource instances; and reconstruct target associated resources based on the expected state defined by the development machine resource instance when it is detected that the target associated resources have been deleted or modified.
[0076] Specifically, the development machine controller 140 is a system component that typically runs in controller mode within the container orchestration platform cluster 110. In this embodiment, the development machine controller 140 periodically polls the Kubernetes API to listen for and manage state changes of development machine resource instances (e.g., state changes include creation and / or updates), and automatically manages the lifecycle of related resources based on these changes. The Kubernetes API is used to manage various resources within the container orchestration platform cluster 110 (e.g., development machine Pods, SSH service discovery resources, web terminal service discovery resources, and Ingress resources).
[0077] For example, the development machine controller 140 monitors state changes of development machine resource instances using methods including the Watch API and / or event handling. Optionally, the container orchestration platform cluster 110 provides a Watch API, allowing the development machine controller 140 to subscribe to state change events of development machine resource instances. The development machine controller can use the Watch API to monitor in real time at least one of the creation, update, and deletion of development machine resource instances. Alternatively, when the development machine controller 140 detects a state change event, it triggers corresponding event handling logic, such as creating, updating, or rebuilding the target associated resource.
[0078] The target associated resource is a specific resource related to the development machine resource instance. In this embodiment, the target associated resources include the development machine Pod, SSH service discovery resources, web terminal service discovery resources, and Ingress resources. Specifically, the SSH service discovery resource is a resource used to support remote SSH access; the web terminal service discovery resource is a resource used to support web terminal functionality; and the Ingress resource is an HTTP / HTTPS routing resource used to manage external access.
[0079] In some embodiments, if the development machine controller 140 detects that a target associated resource has been deleted or modified, it automatically reconstructs these target associated resources according to the expected state defined in the development machine resource instance. For example, if a development machine Pod is accidentally deleted, the development machine controller 140 will recreate the development machine Pod according to the definition of the development machine resource instance, ensuring the stability and consistency of the development machine's access to system 10.
[0080] In one implementation, when a user requests the creation of a new development machine resource instance through the machine learning platform server 130, the development machine controller 140 receives a state change event. Then, the development machine controller 140 automatically creates target associated resources based on the definition of the development machine resource instance. These target associated resources ensure that the development machine's code services and web terminal functions can be accessed through a unified domain name.
[0081] Understandably, while the development controller 140 itself does not obtain state change information by listening on a specific port, it may use the port to provide other functions. For example, the development controller 140 might run an HTTP service to listen on a port to provide a management interface or health check functionality to ensure that the development controller 140 itself is in a healthy state.
[0082] In this embodiment, on the one hand, the development machine controller can automatically monitor state changes of development machine resource instances and create, maintain, and rebuild target associated resources according to the defined desired state, reducing manual intervention. On the other hand, by introducing a reconstruction mechanism for target associated resources, the system can quickly recover even if resources are accidentally deleted or modified. This not only achieves dynamic management and automated maintenance of development machine resources but also further improves the reliability and flexibility of the development machine access system.
[0083] The above embodiments illustrate in detail the architecture and corresponding functions of the development machine access system. The following will combine... Figure 6 and Figure 7 This section details the specific process of accessing the system from the development machine in a machine learning scenario.
[0084] Figure 6 The diagram shown is a structural schematic of a development machine access system provided in another embodiment of this application. Figure 6 As shown, the development machine access system includes: a Kubernetes cluster, a user client, and a machine learning platform.
[0085] Optionally, the machine learning platform includes a machine learning platform client (ml web) and a machine learning platform server (mlserver). User clients include a code-server web and an SSH client. Specifically, the code-server web provides the entry point for users to access the development machine via a web interface. The SSH client provides the entry point for users to remotely log in to the development machine via an SSH client.
[0086] Furthermore, in a Kubernetes cluster, Kubernetes etcd is used to store the cluster's configuration and status information. A Kubernetes service includes code-server ingress, load balancer service, nodeport service, load balancer controller, and serviceCR. The code-server ingress manages the code-server entry point and is responsible for routing external requests to the appropriate Kubernetes service. The load balancer service distributes traffic to backend Pods (development Pods). The nodeport service is a NodePort service that allows external access to the service through a node's port. The load balancer controller manages the load balancer and handles the service's load balancing configuration. The serviceCR is a custom resource used to define the load balancer's configuration.
[0087] Optionally, the user first initiates a request to create a development machine through the machine learning platform's user interface (ml-web), sending the request to the backend machine learning platform server (ml-server). Then, the ml-server creates the development machine's custom resource (CR), the user's public key configmap, and the login password (secret). For example, after receiving the request, the backend service (ml-server) creates the development machine's custom resource (CR), the configuration map for the SSH public key (configmap), and the login password (secret). At this point, the development machine controller listens for changes to the development machine's CR. Next, a pod is created, mounting the public key configmap and the login password (passwordsecret). Additionally, the development machine, proxy sidecar container, and initcontainer are created to perform initialization tasks based on the initcontainer and authentication tasks based on the proxy sidecar container. Finally, a service is created to associate with the created pod, and further, a nodeportservice and serviceCR are created to allow users to remotely log in and use the development machine.
[0088] Optionally, user access to the development machine via the code-server web involves the following steps: The user initiates a development machine access request (such as an HTTP request) via the code-server web. This request first reaches the load balancer (cloud platform load balancer) used to receive external traffic. Then, the load balancer parses the development machine access request according to a predefined port allocation algorithm and forwards the traffic to the code-server ingress resource. Further, the ingress routes the development machine access request to the code-serverService according to preset rules (such as domain name). Finally, the user enters the code-server development environment container (i.e., the development machine pod) and begins development work.
[0089] Alternatively, users can access the development machine via an SSH client in the following two ways.
[0090] The first method involves users accessing the development machine via the NodePort service. This includes the following steps: The user initiates a TCP request to access the development machine using an SSH client. This request first reaches the NodeHost outside the Kubernetes cluster. The NodeHost receives external traffic and is connected to the worker nodes in the Kubernetes cluster. Then, the NodePort service forwards the request to the target worker node in the Kubernetes cluster according to pre-configured port mapping rules. Based on this target worker node, the service associates the request with the development machine pod, thus enabling access to the development machine.
[0091] The second method involves users accessing the development machine via a load balancer. This includes the following steps: The user initiates a TCP request to access the development machine via an SSH client. This request first reaches the load balancer (the cloud platform's load balancer) that receives external traffic. The load balancer then forwards the request to the load balancer service in the Kubernetes cluster. The load balancer controller is a custom load balancer used to dynamically configure routes based on the rules defined in the service CR. Finally, the load balancer service routes the request to the main container (the development machine container) within the development machine pod in the Kubernetes cluster, thus enabling access to the development machine.
[0092] Optionally, the development machine CR is a custom resource used to define the configuration and state of the development machine. The development machine controller is responsible for managing the development machine's lifecycle, listening for changes in the development machine CR, and executing corresponding operations.
[0093] Optionally, the development machine Pod includes a development machine container, a proxy, and an init container. The development machine container is the main container running the development machine environment. The proxy is an authentication proxy container configured to receive external access requests to the development machine, perform authentication on the requests, and forward successfully authenticated requests to the development machine container. The init container runs in sidecar mode before the development machine container starts, is configured to perform pre-configuration operations on the development machine environment, and exits upon completion.
[0094] Optionally, the storage is external to the cluster and is used to store the data and configuration of the development machine.
[0095] Specifically, users initiate access requests to the development machine via the code-server web or SSH client. These requests are routed to the appropriate load balancer via the ingress or nodeport service in the Kubernetes Service. The load balancer distributes traffic to the backend Pods according to the load balancer controller's configuration. The development machine controller listens for state changes in the development machine's CR (Control Record) and performs creation, updates, and deletion of the development machine based on these changes.
[0096] Figure 7 The diagram shown is a flowchart illustrating a method for creating a development machine access system according to an embodiment of this application. Figure 7 As shown, the method for creating the development machine access system includes:
[0097] A development machine is created on the ml-web side. For example, a user initiates a request to create a development machine through the machine learning platform's user interface (ml-web), and sends this request to the backend machine learning platform server (ml-server). The ml-server then creates the development machine's custom resource (CR), the user's public key configmap, and the login password (secret). For instance, after receiving the request, the backend service (ml-server) creates the development machine's custom resource (CR), the configuration map for the SSH public key (configmap), and the login password (secret). At this point, the development machine controller listens for changes to the development machine's CR.
[0098] Next, create a pod, mounting the public key configmap and login password secret. For example, based on the development machine's CR configuration, create a pod containing the necessary containers, and mount the public key configmap and login password secret. Then, create an init container to copy startup scripts and files. For example, create an initialization container (initcontainer) within the pod to copy startup scripts and necessary files to the development machine container. Additionally, create the development machine and proxy sidecar containers, using the startup files and scripts copied by the initcontainer to initialize and start the SSH and code-server services on the development machine, and use the proxy to proxy the code-server service. For example, create a development machine container and a proxy container (proxy sidecar container), use the files and scripts copied by the initcontainer to initialize the development machine, start the SSH and code-server services, and use the proxy to proxy the code-server service in sidecar mode.
[0099] Finally, the service is associated with the created pod, and then a nodeport service or serviceCR is created.
[0100] The process of creating service discovery based on a NodePort service includes: creating the NodePort service, which involves defining the service configuration. Then, host port forwarding is implemented in the Kubernetes cluster to route traffic to the Kubernetes service. Finally, SSH TCP remote login to the development machine is enabled.
[0101] The process of creating service discovery based on a service CR includes: creating a service CR to define the service configuration; then, the load balancer controller listens on the service CR and assigns a load balancer listening port; next, the load balancer service is created; and finally, load balancer port forwarding is performed. This means that the load balancer allocates ports and forwards traffic to the backend service, allowing users to remotely log in and use the development machine via a TCP-based SSH client.
[0102] The process of creating Ingress-based service discovery includes: creating an Ingress instance to manage external access; then, performing load balancing forwarding, i.e., allocating ports and forwarding traffic through a load balancer to route traffic to the code-server; finally, the code-server web client remotely logs in to the development machine using HTTPS.
[0103] It should be noted that in this embodiment, pod creation and service discovery can be performed simultaneously.
[0104] This embodiment provides a cloud-native development machine login implementation solution that adapts to multiple clouds. It can solve port conflict and concurrent allocation problems based on the port allocation algorithm of the load balancer, and can reuse the port of the load balancer to avoid data synchronization caused by the database querying the load balancer port data. It also shields the resource configuration differences between multiple cloud platforms by listening to the service CR of the load balancer controller.
[0105] Figure 8 The diagram shown is a flowchart illustrating a development machine access method according to an embodiment of this application. Figure 8 As shown, the development machine access method includes the following steps.
[0106] Step S810: Send a development machine access request to the development machine access system through the client.
[0107] Optionally, the clients include a code-server web interface and an SSH client. The code-server web interface provides users with an entry point to access the development machine via a web interface. The SSH client provides users with an entry point to remotely log in to the development machine via an SSH client.
[0108] The development machine access system is obtained from any of the foregoing embodiments of this application. Optionally, the development machine access system includes a container orchestration platform cluster, which includes: a load balancer resource instance configured to declare a port allocation request for the load balancing service; a load balancer controller configured to allocate a target port from the available port pool of the load balancer based on the port allocation request declared by the load balancer resource instance, using a predefined port allocation algorithm, and marking the target port as occupied; and to reclaim the target port from the available port pool after the target port is released.
[0109] Step S820: Based on the development machine access request, access the target development machine using the development machine access system.
[0110] The development machine access request is a request specific to the development machine. Specifically, the development machine access request first reaches the container orchestration platform cluster. The load balancer resource instance in the container orchestration platform cluster declares the required port resources through its configuration file, generates a port allocation request, and sends this request to the load balancer controller. The load balancer controller receives the port allocation request. Based on a predefined port allocation algorithm, it selects a target port from the available port pool. The target port is assigned to the load balancing service, and its status is marked as occupied. When the load balancing service no longer needs the target port, the controller marks the port status as available and returns the target port to the available port pool.
[0111] In this application, on the one hand, a load balancer resource instance is created to define the load balancing strategy of the load balancing service. Users can customize the resource type, realizing more flexible resource management. On the other hand, the load balancer controller can allocate load balancer ports based on a predefined port allocation algorithm to solve the problem of port conflict of the load balancer when multiple port allocation requests are concurrent. It can also recycle the target port to the available port pool after the target port is released, realizing port reuse.
[0112] Below, for reference Figure 9 This describes an electronic device according to embodiments of the present application. Figure 9 The diagram shown is a structural schematic of an electronic device provided in an exemplary embodiment of this application.
[0113] like Figure 9 As shown, the electronic device 90 includes one or more processors 901 and memory 902.
[0114] The processor 901 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the electronic device 90 to perform desired functions.
[0115] The memory 902 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 901 may execute the program instructions to implement the development machine access methods of the various embodiments of this application described above and / or other desired functions. The computer-readable storage medium may also store various contents such as port allocation algorithms, load balancer resource instances, development machine resource instances, etc.
[0116] In one example, the electronic device 90 may also include an input device 903 and an output device 904, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0117] The input device 903 may include, for example, a keyboard, a mouse, etc.
[0118] The output device 904 can output various information to the outside, including port allocation algorithms, load balancer resource instances, development machine resource instances, etc. The output device 904 may include, for example, a display, speaker, printer, and communication networks and their connected remote output devices, etc.
[0119] Of course, for the sake of simplicity, Figure 9 Only some of the components of the electronic device 90 relevant to this application are shown in this illustration; components such as buses, input / output interfaces, etc., are omitted. In addition, the electronic device 90 may include any other suitable components depending on the specific application.
[0120] In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the development machine access methods according to various embodiments of this application described above.
[0121] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0122] Furthermore, embodiments of this application may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the development machine access methods according to various embodiments of this application described above.
[0123] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0124] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the aforementioned specific details for implementation.
[0125] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0126] It should also be noted that in the apparatus, equipment, and methods of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.
[0127] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0128] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A development machine access system, characterized in that, The system includes a container orchestration platform cluster, which includes: A load balancer resource instance is configured to declare port allocation requests for the load balancing service. The load balancer controller is configured to allocate a target port from the available port pool of the load balancer based on the port allocation request declared by the load balancer resource instance, using a predefined port allocation algorithm, and mark the target port as occupied; and after the target port is released, reclaim the target port to the available port pool.
2. The system according to claim 1, characterized in that, The load balancer controller is also configured to: The status of the marked target port is written back to the load balancer resource instance so that the status of the target port is stored in the database of the container orchestration platform cluster; And / or, parse the Layer 4 transport protocol common fields declared in the load balancer resource instance, and generate a Layer 4 load balancer configuration adapted to the target cloud platform based on the Layer 4 transport protocol common fields.
3. The system according to claim 1, characterized in that, The system also includes a development Pod, which includes a main container and an authentication proxy container that runs in parallel with the main container in a sidecar mode. The authentication proxy container is configured to receive external access requests to the development Pod and perform an authentication process on the access requests. The authenticated access request is forwarded to the main container.
4. The system according to claim 3, characterized in that, The development machine Pod also includes an initialization container that runs in sidecar mode before the main container starts. The initialization container is configured to perform environment pre-configuration operations on the development machine and exit upon completion.
5. The system according to claim 3, characterized in that, The main container is configured to run code services and provide a web page access interface via a layer 7 network protocol, so that users can develop code on the web page and / or execute command line operations through the web terminal function.
6. The system according to claim 1, characterized in that, The system also includes a machine learning platform server, configured to: create development machine resource instances; encapsulate seven-layer application layer routing configuration rules in the development machine resource instances; and drive the container orchestration platform cluster to generate cloud platform-independent seven-layer Ingress resources through the configuration rules.
7. The system according to claim 1, characterized in that, The system also includes a development machine controller configured to: monitor development machine resource instances; create and maintain target associated resources in response to state changes of the development machine resource instances; and reconstruct the target associated resources based on the desired state defined by the development machine resource instances when the target associated resources are detected to be deleted or modified, wherein the state change includes creation and / or updating; the target associated resources include at least one of development machine Pods, SSH service discovery resources, web terminal service discovery resources, and Ingress resources.
8. A development machine access method, characterized in that, include: The client sends a development machine access request to the development machine access system, wherein the development machine access system is obtained based on any one of claims 1-7; Based on the development machine access request, the target development machine is accessed using the development machine access system.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which is used to execute the development machine access method as described in claim 8.
10. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is used to execute the development machine access method as described in claim 8.
11. A computer program product, characterized in that, The computer program product includes instructions that, when executed on an electronic device, cause the electronic device to implement the development machine access method of claim 8.