Skip to content

Commit 592f27d

Browse files
committed
Update architecture diagram and refactor the main workflow into multiple ones.
1 parent 895a470 commit 592f27d

File tree

5 files changed

+59
-216
lines changed

5 files changed

+59
-216
lines changed

.env.example

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
OPENAI_API_KEY=...
2-
# API Keys
3-
WEAVIATE_URL=http://weaviate:8080
4-
WEAVIATE_API_KEY=
1+
# OpenAI configuration
2+
OPENAI_API_KEY=your_openai_api_key_here
53

6-
# Weaviate Configuration
7-
WEAVIATE_HOST=localhost
8-
WEAVIATE_PORT=8082 # External port for local access
9-
WEAVIATE_SCHEMA_CLASS=Articles
4+
# Weaviate configuration
5+
WEAVIATE_URL=http://weaviate:8080
6+
# WEAVIATE_API_KEY=your_weaviate_api_key_here
107

11-
# Application Settings
8+
# API configuration
129
API_HOST=0.0.0.0
1310
API_PORT=8000
11+
12+
# Demo app configuration
1413
DEMO_PORT=8501
14+
API_URL=http://search_server:8000
15+
16+
# Application settings
1517
LOG_LEVEL=INFO
18+
LOAD_SAMPLE_DATA=true
19+
20+
# Embedding configuration
21+
OPENAI_EMBEDDING_MODEL=text-embedding-3-small
22+
OPENAI_COMPLETION_MODEL=gpt-3.5-turbo
23+
OPENAI_TEMPERATURE=0.7
24+
OPENAI_MAX_TOKENS=1000
25+
26+
# Weaviate Configuration
27+
WEAVIATE_HOST=localhost
28+
WEAVIATE_PORT=8082 # External port for local access
29+
WEAVIATE_SCHEMA_CLASS=Articles
1630

1731
# Kubernetes Settings (for production)
1832
K8S_NAMESPACE=semantic-search

.github/workflows/docker-build-push.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ jobs:
2727

2828
- name: Set up .env file
2929
run: |
30-
# Copy the example file first
31-
cp .env.example .env
32-
# No need to add secrets here, they'll be passed at runtime via Docker secrets
30+
# Create .env file directly since .env.example might not exist
31+
cat << EOF > .env
32+
OPENAI_API_KEY=dummy-key-for-ci
33+
WEAVIATE_URL=http://weaviate:8080
34+
API_HOST=0.0.0.0
35+
API_PORT=8000
36+
DEMO_PORT=8501
37+
LOG_LEVEL=INFO
38+
LOAD_SAMPLE_DATA=true
39+
EOF
40+
echo ".env file created successfully"
3341
3442
- name: Create secret files for build context
3543
run: |

.github/workflows/main.yml

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

.github/workflows/test-deployment.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,27 @@ jobs:
2424
echo "${{ secrets.OPENAI_API_KEY }}" > openai_api_key.txt
2525
echo "${{ secrets.WEAVIATE_API_KEY }}" > weaviate_api_key.txt
2626
27+
- name: Create .env file
28+
run: |
29+
cat << EOF > .env
30+
OPENAI_API_KEY=dummy-key-for-ci
31+
WEAVIATE_URL=http://weaviate:8080
32+
API_HOST=0.0.0.0
33+
API_PORT=8000
34+
DEMO_PORT=8501
35+
LOG_LEVEL=INFO
36+
LOAD_SAMPLE_DATA=true
37+
EOF
38+
echo ".env file created successfully"
39+
2740
- name: Pull latest images
2841
run: |
2942
docker pull tuandung12092002/semantic-search-server:latest
3043
docker pull tuandung12092002/semantic-search-demo:latest
3144
3245
- name: Deploy with Docker Compose
3346
run: |
34-
docker compose -f docker/docker-compose.full.yml up -d
47+
docker compose --env-file .env -f docker/docker-compose.full.yml up -d
3548
3649
- name: Wait for services to start
3750
run: |
@@ -53,5 +66,5 @@ jobs:
5366
5467
- name: Clean up
5568
run: |
56-
docker compose -f docker/docker-compose.full.yml down
69+
docker compose --env-file .env -f docker/docker-compose.full.yml down
5770
rm openai_api_key.txt weaviate_api_key.txt

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ A production-ready semantic search application that combines vector embeddings a
2222

2323
```mermaid
2424
flowchart TB
25-
subgraph "Demo Frontend (Streamlit)"
25+
subgraph Frontend["Demo Frontend (Streamlit)"]
2626
DocUI["Document Upload UI"]
2727
QuesUI["Question Input UI"]
2828
ResUI["Results Display UI"]
2929
end
3030
31-
subgraph "Search Server (FastAPI)"
31+
subgraph Server["Search Server (FastAPI)"]
3232
TextProc["TextProcessor<br>Clean & Chunk Text"]
3333
EmbMgr["EmbeddingManager<br>Create & Cache Embeddings"]
3434
GenSearch["GenerativeSearch<br>Answer Gen. with Context"]
@@ -37,7 +37,7 @@ flowchart TB
3737
EmbMgr --> GenSearch
3838
end
3939
40-
subgraph "External Services"
40+
subgraph External["External Services"]
4141
VecDB["Vector Database<br>(Weaviate)"]
4242
OpenAI["OpenAI API"]
4343
SampleData["Sample Data<br>Text Samples & Metadata"]
@@ -51,9 +51,13 @@ flowchart TB
5151
EmbMgr <-- Vectors --> VecDB
5252
GenSearch <-- Prompts --> OpenAI
5353
54-
style Demo%20Frontend%20\(Streamlit\) fill:#e6f7ff,stroke:#0099cc
55-
style Search%20Server%20\(FastAPI\) fill:#e6ffe6,stroke:#00cc66
56-
style External%20Services fill:#fff0e6,stroke:#ff9933
54+
classDef frontend fill:#e6f7ff,stroke:#0099cc
55+
classDef server fill:#e6ffe6,stroke:#00cc66
56+
classDef external fill:#fff0e6,stroke:#ff9933
57+
58+
class Frontend frontend
59+
class Server server
60+
class External external
5761
```
5862

5963
### Core Components and Data Flow

0 commit comments

Comments
 (0)