|
| 1 | +--- |
| 2 | +name: doris-docker-regression |
| 3 | +description: Run Doris docker-based regression tests from a clean package |
| 4 | +compatibility: opencode |
| 5 | +--- |
| 6 | + |
| 7 | +## Purpose |
| 8 | + |
| 9 | +Run Doris docker-based regression tests from a clean package, avoiding contamination from local `conf/` or startup script modifications. |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +### Python Environment |
| 14 | + |
| 15 | +Requires Python 3. Install dependencies from `docker/runtime/doris-compose/requirements.txt`: |
| 16 | + |
| 17 | +```bash |
| 18 | +python -m pip install --user -r docker/runtime/doris-compose/requirements.txt |
| 19 | +``` |
| 20 | + |
| 21 | +If installation fails (especially PyYAML conflicts), use specific versions: |
| 22 | +```bash |
| 23 | +python -m pip install --user pyyaml==5.3.1 docker==6.1.3 |
| 24 | +python -m pip install --user -r docker/runtime/doris-compose/requirements.txt |
| 25 | +``` |
| 26 | + |
| 27 | +Alternatively, use a virtual environment: |
| 28 | +```bash |
| 29 | +python -m venv doris-compose-env |
| 30 | +source doris-compose-env/bin/activate |
| 31 | +pip install -r docker/runtime/doris-compose/requirements.txt |
| 32 | +``` |
| 33 | + |
| 34 | +### Docker Environment |
| 35 | + |
| 36 | +```bash |
| 37 | +docker run hello-world # Docker works |
| 38 | +docker compose version # Compose v2 |
| 39 | +docker-compose version # Should resolve to Compose v2 |
| 40 | +``` |
| 41 | + |
| 42 | +If `docker-compose` shows `TypeError: kwargs_from_env()`, make sure it is indeed Docker Compose V2; if not, you need to install and point to the correct version. |
| 43 | + |
| 44 | +Check port availability: |
| 45 | +```bash |
| 46 | +lsof -nP -iTCP:8030,8040,8050,8060,8070,9010,9020,9030,9050,9060 -sTCP:LISTEN |
| 47 | +``` |
| 48 | +If there is a conflict, ask the user how to handle it. |
| 49 | + |
| 50 | +## Build |
| 51 | + |
| 52 | +```bash |
| 53 | +./build.sh --fe --be -j<parallel_jobs> --output <output_directory> |
| 54 | +``` |
| 55 | + |
| 56 | +## Prepare Clean Package |
| 57 | + |
| 58 | +Sanitize configs from git HEAD: |
| 59 | + |
| 60 | +```bash |
| 61 | +git show HEAD:conf/fe.conf > <output_directory>/fe/conf/fe.conf |
| 62 | +git show HEAD:conf/be.conf > <output_directory>/be/conf/be.conf |
| 63 | +git show HEAD:bin/start_fe.sh > <output_directory>/fe/bin/start_fe.sh |
| 64 | +chmod 755 <output_directory>/fe/bin/start_fe.sh |
| 65 | +``` |
| 66 | + |
| 67 | +Verify clean configs use **default ports**: |
| 68 | +- `fe.conf`: 8030, 9020, 9030, 9010, 8070 |
| 69 | +- `be.conf`: 9060, 8040, 9050, 8060, 8050 |
| 70 | +- `start_fe.sh`: no `-agentlib:jdwp` debug agent |
| 71 | + |
| 72 | +## Build Docker Image |
| 73 | + |
| 74 | +```bash |
| 75 | +docker build \ |
| 76 | + --build-arg OUTPUT_PATH=<output_directory> \ |
| 77 | + -f docker/runtime/doris-compose/Dockerfile \ |
| 78 | + -t <image_name>:latest \ |
| 79 | + . |
| 80 | +``` |
| 81 | + |
| 82 | +## Configure Regression |
| 83 | + |
| 84 | +Create `regression-test/conf/regression-conf-custom.groovy`: |
| 85 | + |
| 86 | +```groovy |
| 87 | +image = "<image_name>:latest" |
| 88 | +excludeDockerTest = false |
| 89 | +testGroups = "docker" |
| 90 | +``` |
| 91 | + |
| 92 | +## Run Regression |
| 93 | + |
| 94 | +```bash |
| 95 | +./run-regression-test.sh --run -d <directory> -s <suite_name> |
| 96 | +``` |
| 97 | + |
| 98 | +## Troubleshooting |
| 99 | + |
| 100 | +| Symptom | Cause | Fix | |
| 101 | +|---------|-------|-----| |
| 102 | +| 0 suites | `excludeDockerTest=true` or missing `testGroups="docker"` | Check `regression-conf-custom.groovy` | |
| 103 | +| JDWP error | `start_fe.sh` has debug agent | Re-sanitize from `git show HEAD:bin/start_fe.sh` | |
| 104 | +| Wrong ports | Configs have local edits | Re-sanitize from `git show HEAD:conf/fe.conf` / `be.conf` | |
| 105 | +| Port conflict | Processes using default ports | `lsof` then kill | |
| 106 | + |
| 107 | +## Debug Logs |
| 108 | + |
| 109 | +Runtime cluster at `/tmp/doris/<suite_name>/`: |
| 110 | +- `fe-1/log/fe.log`, `fe.warn.log`, `fe.out`, `health.out` |
| 111 | +- `be-1/log/be.INFO`, `be.WARNING`, `be.out`, `health.out` |
| 112 | +- `doris-compose.log` |
| 113 | + |
| 114 | +## Full Command Sequence |
| 115 | + |
| 116 | +```bash |
| 117 | +# 1. Check environment |
| 118 | +python --version |
| 119 | +docker run hello-world |
| 120 | +docker compose version |
| 121 | +lsof -nP -iTCP:8030,8040,8050,8060,8070,9010,9020,9030,9050,9060 -sTCP:LISTEN |
| 122 | + |
| 123 | +# 2. Build |
| 124 | +./build.sh --fe --be -j60 |
| 125 | + |
| 126 | +# 3. Sanitize package configs |
| 127 | +git show HEAD:conf/fe.conf > <output_directory>/fe/conf/fe.conf |
| 128 | +git show HEAD:conf/be.conf > <output_directory>/be/conf/be.conf |
| 129 | +git show HEAD:bin/start_fe.sh > <output_directory>/fe/bin/start_fe.sh |
| 130 | +chmod 755 <output_directory>/fe/bin/start_fe.sh |
| 131 | + |
| 132 | +# 4. Build image |
| 133 | +docker build --build-arg OUTPUT_PATH=<output_directory> -f docker/runtime/doris-compose/Dockerfile -t <image_name>:latest . |
| 134 | + |
| 135 | +# 5. Configure (create regression-conf-custom.groovy) |
| 136 | +# 6. Run |
| 137 | +./run-regression-test.sh --run -d <directory> -s <suite_name> |
| 138 | +``` |
0 commit comments