Skip to content

Commit

Permalink
test forwards with round-robin nginx.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun authored and cdmikechen committed Oct 29, 2024
1 parent 3c89d13 commit 498a504
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup_databend_cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
shell: bash
run: |
docker run -d --network host --name nginx-lb \
-v ${{ github.workspace }}/scripts/ci/nginx.conf:/etc/nginx/nginx.conf:ro \
-v ${{ github.workspace }}/scripts/ci/nginx_rr.conf:/etc/nginx/nginx.conf:ro \
nginx
- name: Download binary and extract into target directory
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/test_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,28 @@ jobs:
- uses: ./.github/actions/setup_databend_cluster
timeout-minutes: 15
with:
version: '1.2.629-nightly'
version: '1.2.647-nightly'
target: 'x86_64-unknown-linux-gnu'

- name: Test with conn to node 1
run: mvn test -DexcludedGroups=FLAKY
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: View Nginx logs
run: docker logs nginx-lb

- name: check nginx
run: |
curl -u 'databend:databend' -X POST "http://localhost:8010/v1/query" \
-H 'Content-Type: application/json' \
-d '{"sql": "select 1", "pagination": { "wait_time_secs": 5 }}' || true
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: View Nginx logs
run: docker logs nginx-lb

- name: Test with conn to nginx
run: mvn test -DexcludedGroups=FLAKY
env:
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions scripts/ci/nginx_rr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
events {
worker_connections 1024;
}

http {
upstream backend {
server 127.0.0.1:8000;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
}

server {
listen 8010;

location / {
proxy_pass http://backend;
proxy_set_header X-Databend-Relative-Path $http_x_databend_relative_path;
proxy_set_header X-Databend-Stage-Name $http_x_databend_stage_name;
proxy_set_header X-Databend-Sticky-Node $http_x_databend_sticky_node;
}
}
}

0 comments on commit 498a504

Please sign in to comment.