Skip to content

Commit 12daa68

Browse files
authored
Merge pull request #4 from sunu/helm-chart
Refactoring: Switch from duckdb to Postgres for storing overture data
2 parents 0749c24 + 2521b93 commit 12daa68

32 files changed

Lines changed: 1647 additions & 469 deletions

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- main
8+
- helm-chart
89

910
jobs:
1011
build-and-push-api:
@@ -40,71 +41,3 @@ jobs:
4041
push: true
4142
tags: ${{ steps.meta-api.outputs.tags }}
4243
labels: ${{ steps.meta-api.outputs.labels }}
43-
44-
build-and-push-duckdb-init:
45-
runs-on: ubuntu-latest
46-
permissions:
47-
contents: read
48-
packages: write
49-
steps:
50-
- name: Checkout repository
51-
uses: actions/checkout@v4
52-
53-
- name: Log in to the Container registry
54-
uses: docker/login-action@v3
55-
with:
56-
registry: ghcr.io
57-
username: ${{ github.actor }}
58-
password: ${{ secrets.GITHUB_TOKEN }}
59-
60-
- name: Extract metadata (tags, labels) for DuckDB Init
61-
id: meta-duckdb
62-
uses: docker/metadata-action@v5
63-
with:
64-
images: ghcr.io/sunu/geodini/duckdb-init
65-
tags: |
66-
type=sha
67-
type=raw,value=latest
68-
69-
- name: Build and push DuckDB Init image
70-
uses: docker/build-push-action@v5
71-
with:
72-
context: .
73-
file: ./Dockerfile.duckdb
74-
push: true
75-
tags: ${{ steps.meta-duckdb.outputs.tags }}
76-
labels: ${{ steps.meta-duckdb.outputs.labels }}
77-
78-
build-and-push-frontend:
79-
runs-on: ubuntu-latest
80-
permissions:
81-
contents: read
82-
packages: write
83-
steps:
84-
- name: Checkout repository
85-
uses: actions/checkout@v4
86-
87-
- name: Log in to the Container registry
88-
uses: docker/login-action@v3
89-
with:
90-
registry: ghcr.io
91-
username: ${{ github.actor }}
92-
password: ${{ secrets.GITHUB_TOKEN }}
93-
94-
- name: Extract metadata (tags, labels) for Frontend
95-
id: meta-frontend
96-
uses: docker/metadata-action@v5
97-
with:
98-
images: ghcr.io/sunu/geodini/frontend
99-
tags: |
100-
type=sha
101-
type=raw,value=latest
102-
103-
- name: Build and push Frontend image
104-
uses: docker/build-push-action@v5
105-
with:
106-
context: .
107-
file: ./Dockerfile.frontend
108-
push: true
109-
tags: ${{ steps.meta-frontend.outputs.tags }}
110-
labels: ${{ steps.meta-frontend.outputs.labels }}

.github/workflows/helm-publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Helm Chart
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- helm-chart
8+
paths:
9+
- 'helm/**'
10+
release:
11+
types: [published]
12+
13+
jobs:
14+
publish-helm-chart:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Install Helm
24+
uses: azure/setup-helm@v4
25+
with:
26+
version: '3.13.0'
27+
28+
- name: Log in to the Container registry
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Package Helm chart
36+
run: |
37+
helm package helm/geodini --destination ./chart-packages
38+
39+
- name: Push Helm chart to GHCR
40+
run: |
41+
helm push ./chart-packages/*.tgz oci://ghcr.io/sunu/geodini/helm-chart
42+
43+
- name: List packaged charts
44+
run: |
45+
ls -la ./chart-packages/

Dockerfile.duckdb

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

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,83 @@
11
# Geodini
22

33
A natural language geocoding API.
4+
5+
## Helm Chart Installation
6+
7+
This application can be deployed using the provided Helm chart located in the `geodini-chart` directory.
8+
9+
### Prerequisites
10+
11+
* Kubernetes cluster (e.g., Minikube, Kind, or a cloud provider's K8s service)
12+
* Helm v3 installed
13+
* `kubectl` configured to connect to your cluster
14+
15+
### Installation Steps
16+
17+
1. **Navigate to the chart directory:**
18+
```bash
19+
cd geodini-chart
20+
```
21+
22+
2. **Review and customize values (Optional):**
23+
Before installing, you might want to customize the deployment by overriding default values. Create a `my-values.yaml` file or inspect `values.yaml` for available options.
24+
Key values you might want to override:
25+
* `postgres.password`: **It is highly recommended to change the default PostgreSQL password.**
26+
* `ingress.enabled`: Set to `true` if you have an Ingress controller and want to expose the application via Ingress.
27+
* `ingress.hosts`: Configure your desired hostname(s).
28+
* `ingress.tls`: Configure TLS secrets if using HTTPS.
29+
* `appDataPersistence.size` and `postgres.persistence.size`: Adjust storage sizes as needed.
30+
* Image tags for `api`, `frontend`, and `api.initContainer` if you want to use specific versions.
31+
32+
3. **Install the chart:**
33+
To install the chart with the release name `geodini`:
34+
```bash
35+
helm install geodini .
36+
```
37+
If you have a custom values file:
38+
```bash
39+
helm install geodini . -f my-values.yaml
40+
```
41+
To install into a specific namespace:
42+
```bash
43+
helm install geodini . --namespace geodini-ns --create-namespace
44+
```
45+
46+
4. **Check deployment status:**
47+
```bash
48+
kubectl get pods -n <your-namespace-if-any>
49+
kubectl get svc -n <your-namespace-if-any>
50+
```
51+
Wait for all pods to be in the `Running` state. The `NOTES.txt` output from the Helm install command will also provide useful information on how to access the application.
52+
53+
### Accessing the Application
54+
55+
* **Via Port-Forward (if Ingress is not enabled):**
56+
The `NOTES.txt` from the Helm installation will provide `kubectl port-forward` commands. Typically:
57+
```bash
58+
# Forward Frontend
59+
kubectl port-forward svc/geodini-frontend 8080:80 # Access at http://localhost:8080
60+
# Forward API (if direct access needed)
61+
kubectl port-forward svc/geodini-api 9000:9000
62+
```
63+
* **Via Ingress (if enabled):**
64+
Access the application via the host and paths configured in your `values.yaml` (e.g., `http://chart-example.local/` or `https://your.domain.com/`).
65+
66+
### Upgrading the Chart
67+
68+
To upgrade an existing release:
69+
```bash
70+
helm upgrade geodini . -f my-values.yaml # Or without -f if no custom values
71+
```
72+
73+
### Uninstalling the Chart
74+
75+
To uninstall/delete the `geodini` release:
76+
```bash
77+
helm uninstall geodini
78+
```
79+
This will remove all Kubernetes components associated with the chart. PersistentVolumeClaims (PVCs) might need to be deleted manually if you want to remove the persisted data:
80+
```bash
81+
kubectl delete pvc geodini-app-data geodini-postgres-data
82+
```
83+
(Adjust PVC names based on your release name).

docker-compose-prod.yml

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

docker-compose.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
services:
2-
init-data:
2+
init-ingest-data:
33
build:
44
context: .
5-
dockerfile: Dockerfile.duckdb
5+
dockerfile: Dockerfile.api
66
volumes:
7-
- ./scripts:/scripts
8-
- ./data:/data
9-
command:
10-
[
11-
"/bin/bash",
12-
"-c",
13-
"chmod +x /scripts/init-data.sh && /scripts/init-data.sh",
14-
]
15-
16-
# This service is for initialization, so no ports are exposed.
17-
# It will run, and upon successful completion, other services depending on it will start.
7+
- ./geodini:/app/geodini
8+
- ./data:/app/data
9+
environment:
10+
- POSTGRES_HOST=database
11+
- POSTGRES_PORT=5432
12+
- POSTGRES_USER=postgres
13+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
14+
- POSTGRES_DB=postgres
15+
- DATA_PATH=/app/data
16+
command: ["python", "geodini/ingest.py"]
1817

1918
api:
2019
build:
@@ -29,13 +28,13 @@ services:
2928
- POSTGRES_USER=postgres
3029
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
3130
- POSTGRES_DB=postgres
32-
- DATA_PATH=/app/data/overture-unified.duckdb
33-
# Add other environment variables as needed
31+
- DATA_PATH=/app/data
3432
env_file:
3533
- .env
3634
volumes:
3735
- ./geodini:/app/geodini
3836
- ./data:/app/data
37+
3938
command:
4039
[
4140
"uvicorn",
@@ -49,7 +48,7 @@ services:
4948
depends_on:
5049
database:
5150
condition: service_healthy
52-
init-data:
51+
init-ingest-data:
5352
condition: service_completed_successfully
5453

5554
mcp:
@@ -75,8 +74,6 @@ services:
7574
depends_on:
7675
database:
7776
condition: service_healthy
78-
init-data:
79-
condition: service_completed_successfully
8077

8178
frontend:
8279
build:

geodini/agents/complex_agents.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class RoutingContext:
7272

7373

7474
routing_agent = Agent(
75-
"openai:gpt-4o-mini",
75+
"openai:gpt-4.1-mini",
7676
output_type=RoutingResult,
7777
deps_type=RoutingContext,
7878
system_prompt="""
@@ -94,7 +94,7 @@ class ComplexQueryContext:
9494

9595

9696
complex_geocode_query_agent = Agent(
97-
"openai:gpt-4o-mini",
97+
"openai:gpt-4.1-mini",
9898
output_type=ComplexGeocodeResult,
9999
deps_type=ComplexQueryContext,
100100
system_prompt="""

0 commit comments

Comments
 (0)