×
Community Blog Test Environment and Routing - Alibaba DevOps Practice Guide Part 14

Test Environment and Routing - Alibaba DevOps Practice Guide Part 14

Part 14 of this 27-part series explains the importance of environment-based and routing model-based test environment solutions.

This article is from Alibaba DevOps Practice Guide written by Alibaba Cloud Yunxiao Team

Alibaba's governance solution for internal test environments has evolved over the past few years with multiple trial and error processes. The early iteration process of test environment governance is relatively long because the updates of test environment solutions involve a wide range of areas. This involves the overall policy adjustment of the full-procedure microservices and the overall changes of various middleware protocols (HTTP, RPC, and message) that affect the routing isolation capability. The implementation of the overall large-scale updates of a test environment solution may take years.

At the same time, as new technologies make it convenient to launch a test environment, the solution for the business side to use test environments is gradually becoming more multi-functional and diversified.

We need to keep pace with the evolution of business test environment solutions, accelerate the iteration of test environment governance, and reduce trial and error costs. To this goal, it is necessary to abstract the traffic routing of test environments to adapt to and meet the demands of various scenarios.

Solutions

Several layers must be abstracted based on scenarios in which test environments are used and traffic routing. Routing protocols must be added to support routing orchestration and decoupled from business scenarios. The data layer and control layer are extended and implemented based on a unified routing protocol. The data layer provides extended routing capabilities (such as HTTP, RPC, message, and DB). The control layer offers environment-oriented and routing tools, provides orchestration capabilities for configuration management-oriented environment solutions on the user side, and enables developer-oriented environment use capabilities.

1

Routing and Test Environment

Concept

  • An Isolated Domain is a collection that provides the same layer of services. Inter-service calls are preferred to perform in an isolated domain, and inter-domain routing is isolated by default. You can define a fallback degradation call policy for isolated domains at the routing layer.
  • An Isolation Unit (Environment) is the minimum unit for identification in an isolated domain. It is a resource collection of an application in an isolated domain. Usually, a DevOps platform uses the environment of an application to carry isolation units for developers.

How Does Routing Modeling Work in a Domain?

The traffic routing capability is the basis for parallel testing scenarios. The capability can create a private, isolated domain for multiple roles, such as developers and testers. Self-services can call commissioning traffic inside their private, isolated domains while traffic between isolated domains is separated and does not interfere with each other.

Next, let’s look at specific business scenarios to see what a routing model is.

2

The routing model consists of an isolated domain, degradation policy, and degradation conditions:

  • The isolated domain defines the isolation units in the domain.
  • The isolated domain degradation policy defines the fallback mechanism between isolated domains.
  • Degradation conditions involve various scenarios, such as scenarios where there are isolation units with no instance, instances with no services, or no isolation units.

We can orchestrate and define the routing for a specific business scenario by combining the preceding three elements.

How Does Environment Modeling Work in a Domain?

Environment Category

After analyzing Alibaba’s previous use cases of test environments, we can divide the environments into two categories: static environments and dynamic environments.

Static Environment

Static environments have fixed isolated domains. After an isolated domain is defined, the domain attributes will not be changed. Generally, the only actions are adding or deleting isolation units. Such isolated domains are relatively large in scale, providing backup service support with higher stability requirements. Developers need to maintain the stability of this type of environment, such as basic environments (backup environments that support the development and joint commissioning in microservice scenarios).

Failure Impact Factors of Production Environments Failure Impact Factors of Static Environments
User public opinion, capital loss, and decline rate Application importance (dependent), R&D public opinions, upstream R&D activity, and affected joint commissioning traffic

User public opinion, capital loss, and decline rate Application importance (dependent), R&D public opinions, upstream R&D activity, and affected joint commissioning traffic

Dynamic Environment

The isolated domain to which a dynamic environment belongs is not stable, and it is often aggregated or split depending on the joint commissioning target. This kind of isolated domain is usually small in scale and used for temporary development, commissioning, and testing. They must adhere to the principle of applying on-demand and abandoning after use.

The core indicators of dynamic environments are the ability to activate with one click, activation success rate, and activation speed.

Implementing One-Click Access to Terminals

Activating multiple versions of test environments with multiple isolated domains costs developers in call access a lot. Therefore, developers must be able to access isolated domains from the development machines or terminals (PC browser or APP) with one click.

Access Test Environment through Development Machines

The development machine replaces and labels cloud resources in one click and routes call traffic to the local host. This allows developers to perform local joint commissioning. After the commissioning, the development machine can be removed with one click. The joint commissioning traffic returns to cloud resources.

3

Access Test Environment through Terminals

You can access isolated domains through terminals, such as browsers and mobile terminals, in one click without configuration in a test environment, with multiple isolated domains. This way, massive configuration tasks, such as binding local domains with hosts, can be eliminated, and the development efficiency can be improved.

The mobile terminal can scan the QR code of an isolated domain to tag the route, achieving one-click access to the corresponding isolated domain. The PC browser can open the webpage address of the corresponding isolated domain to tag the route, achieving one-click access to the corresponding isolated domain.

4

Summary

In Alibaba, as the businesses are expanding and technology stacks are updating, the original pattern of using test environments on the business side has gradually been broken, becoming more multi-scenario, multi-functional, and diversified. How can we keep up with business development and meet the business requirements for new test environment scenarios? The key is the environment-based and routing model-based test environment solution.

0 0 0
Share on

Alibaba Cloud Community

1,011 posts | 247 followers

You may also like

Comments