Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit 8a6c5d7

Browse files
authored
Merge pull request #51 from mindvalley/test/try-merge-1
test/try merge 1
2 parents 4a57602 + 28656cc commit 8a6c5d7

File tree

716 files changed

+48951
-24650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

716 files changed

+48951
-24650
lines changed

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Description
2+
[Provide a brief description of the changes in this PR]
3+
4+
5+
## How Has This Been Tested?
6+
[Describe the tests you ran to verify your changes]
7+
8+
9+
## Accepted Risk
10+
[Any know risks or failure modes to point out to reviewers]
11+
12+
13+
## Related Issue(s)
14+
[If applicable, link to the issue(s) this PR addresses]
15+
16+
17+
## Checklist:
18+
- [ ] All of the automated tests pass
19+
- [ ] All PR comments are addressed and marked resolved
20+
- [ ] If there are migrations, they have been rebased to latest main
21+
- [ ] If there are new dependencies, they are added to the requirements
22+
- [ ] If there are new environment variables, they are added to all of the deployment methods
23+
- [ ] If there are new APIs that don't require auth, they are added to PUBLIC_ENDPOINT_SPECS
24+
- [ ] Docker images build and basic functionalities work
25+
- [ ] Author has done a final read through of the PR right before merge

.github/workflows/docker-build-backend-container-on-merge-group.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/docker-build-push-model-server-container-on-tag.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77

88
jobs:
99
build-and-push:
10-
runs-on: ubuntu-latest
10+
runs-on:
11+
group: amd64-image-builders
1112

1213
steps:
1314
- name: Checkout code

.github/workflows/docker-build-web-container-on-merge-group.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/pr-python-checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Python Checks
22

33
on:
4+
merge_group:
45
pull_request:
56
branches: [ main ]
67

.github/workflows/pr-python-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Python Unit Tests
22

33
on:
4+
merge_group:
45
pull_request:
56
branches: [ main ]
67

.github/workflows/pr-quality-checks.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ concurrency:
44
cancel-in-progress: true
55

66
on:
7+
merge_group:
78
pull_request: null
89

910
jobs:
1011
quality-checks:
1112
runs-on: ubuntu-latest
1213
steps:
13-
- uses: actions/checkout@v4
14-
with:
15-
fetch-depth: 0
16-
- uses: actions/setup-python@v5
17-
with:
18-
python-version: '3.11'
19-
- uses: pre-commit/[email protected]
20-
with:
21-
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
- uses: pre-commit/[email protected]
21+
with:
22+
extra_args: ${{ github.event_name == 'pull_request' && format('--from-ref {0} --to-ref {1}', github.event.pull_request.base.sha, github.event.pull_request.head.sha) || '' }}

.github/workflows/run-it.yml

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
name: Run Integration Tests
2+
concurrency:
3+
group: Run-Integration-Tests-${{ github.head_ref }}
4+
cancel-in-progress: true
5+
6+
on:
7+
merge_group:
8+
pull_request:
9+
branches: [ main ]
10+
11+
env:
12+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
13+
14+
jobs:
15+
integration-tests:
16+
runs-on:
17+
group: 'arm64-image-builders'
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Login to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_TOKEN }}
30+
31+
- name: Build Web Docker image
32+
uses: docker/build-push-action@v5
33+
with:
34+
context: ./web
35+
file: ./web/Dockerfile
36+
platforms: linux/arm64
37+
pull: true
38+
push: true
39+
load: true
40+
tags: danswer/danswer-web-server:it
41+
cache-from: type=registry,ref=danswer/danswer-web-server:it
42+
cache-to: |
43+
type=registry,ref=danswer/danswer-web-server:it,mode=max
44+
type=inline
45+
46+
- name: Build Backend Docker image
47+
uses: docker/build-push-action@v5
48+
with:
49+
context: ./backend
50+
file: ./backend/Dockerfile
51+
platforms: linux/arm64
52+
pull: true
53+
push: true
54+
load: true
55+
tags: danswer/danswer-backend:it
56+
cache-from: type=registry,ref=danswer/danswer-backend:it
57+
cache-to: |
58+
type=registry,ref=danswer/danswer-backend:it,mode=max
59+
type=inline
60+
61+
- name: Build Model Server Docker image
62+
uses: docker/build-push-action@v5
63+
with:
64+
context: ./backend
65+
file: ./backend/Dockerfile.model_server
66+
platforms: linux/arm64
67+
pull: true
68+
push: true
69+
load: true
70+
tags: danswer/danswer-model-server:it
71+
cache-from: type=registry,ref=danswer/danswer-model-server:it
72+
cache-to: |
73+
type=registry,ref=danswer/danswer-model-server:it,mode=max
74+
type=inline
75+
76+
- name: Build integration test Docker image
77+
uses: docker/build-push-action@v5
78+
with:
79+
context: ./backend
80+
file: ./backend/tests/integration/Dockerfile
81+
platforms: linux/arm64
82+
pull: true
83+
push: true
84+
load: true
85+
tags: danswer/integration-test-runner:it
86+
cache-from: type=registry,ref=danswer/integration-test-runner:it
87+
cache-to: |
88+
type=registry,ref=danswer/integration-test-runner:it,mode=max
89+
type=inline
90+
91+
- name: Start Docker containers
92+
run: |
93+
cd deployment/docker_compose
94+
ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=true \
95+
IMAGE_TAG=it \
96+
docker compose -f docker-compose.dev.yml -p danswer-stack up -d --build
97+
id: start_docker
98+
99+
- name: Wait for service to be ready
100+
run: |
101+
echo "Starting wait-for-service script..."
102+
103+
start_time=$(date +%s)
104+
timeout=300 # 5 minutes in seconds
105+
106+
while true; do
107+
current_time=$(date +%s)
108+
elapsed_time=$((current_time - start_time))
109+
110+
if [ $elapsed_time -ge $timeout ]; then
111+
echo "Timeout reached. Service did not become ready in 5 minutes."
112+
exit 1
113+
fi
114+
115+
# Use curl with error handling to ignore specific exit code 56
116+
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health || echo "curl_error")
117+
118+
if [ "$response" = "200" ]; then
119+
echo "Service is ready!"
120+
break
121+
elif [ "$response" = "curl_error" ]; then
122+
echo "Curl encountered an error, possibly exit code 56. Continuing to retry..."
123+
else
124+
echo "Service not ready yet (HTTP status $response). Retrying in 5 seconds..."
125+
fi
126+
127+
sleep 5
128+
done
129+
echo "Finished waiting for service."
130+
131+
- name: Run integration tests
132+
run: |
133+
echo "Running integration tests..."
134+
docker run --rm --network danswer-stack_default \
135+
-e POSTGRES_HOST=relational_db \
136+
-e POSTGRES_USER=postgres \
137+
-e POSTGRES_PASSWORD=password \
138+
-e POSTGRES_DB=postgres \
139+
-e VESPA_HOST=index \
140+
-e API_SERVER_HOST=api_server \
141+
-e OPENAI_API_KEY=${OPENAI_API_KEY} \
142+
danswer/integration-test-runner:it
143+
continue-on-error: true
144+
id: run_tests
145+
146+
- name: Check test results
147+
run: |
148+
if [ ${{ steps.run_tests.outcome }} == 'failure' ]; then
149+
echo "Integration tests failed. Exiting with error."
150+
exit 1
151+
else
152+
echo "All integration tests passed successfully."
153+
fi
154+
155+
- name: Save Docker logs
156+
if: success() || failure()
157+
run: |
158+
cd deployment/docker_compose
159+
docker compose -f docker-compose.dev.yml -p danswer-stack logs > docker-compose.log
160+
mv docker-compose.log ${{ github.workspace }}/docker-compose.log
161+
162+
- name: Upload logs
163+
if: success() || failure()
164+
uses: actions/upload-artifact@v3
165+
with:
166+
name: docker-logs
167+
path: ${{ github.workspace }}/docker-compose.log
168+
169+
- name: Stop Docker containers
170+
run: |
171+
cd deployment/docker_compose
172+
docker compose -f docker-compose.dev.yml -p danswer-stack down -v

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/deployment/data/nginx/app.conf
88
.vscode/launch.json
99
*.sw?
10+
/backend/tests/regression/answer_quality/search_test_config.yaml

.vscode/env_template.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LOG_LEVEL=debug
1515

1616
# This passes top N results to LLM an additional time for reranking prior to answer generation
1717
# This step is quite heavy on token usage so we disable it for dev generally
18-
DISABLE_LLM_CHUNK_FILTER=True
18+
DISABLE_LLM_DOC_RELEVANCE=True
1919

2020

2121
# Useful if you want to toggle auth on/off (google_oauth/OIDC specifically)

0 commit comments

Comments
 (0)