Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ef900b9
Initial helm chart
sunu May 26, 2025
197b012
dont download land and water data yet
sunu Jun 9, 2025
04886f2
fix: make geodini.agents.utils a package
sunu Jun 9, 2025
8531b65
fix: check connection exists before closing
sunu Jun 9, 2025
0cbf73e
try to limit duckdb memory usage
sunu Jun 9, 2025
222845a
fix: import weirdness
sunu Jun 9, 2025
b1cb717
Always recreate the duckdb database
sunu Jun 9, 2025
9eb4c66
option to force overture data download and recreate db
sunu Jun 9, 2025
6102fb8
some tweaks to avoid OOM errors
sunu Jun 9, 2025
57287f8
more clean up
sunu Jun 9, 2025
bee2ed5
one more try to avoid oom error
sunu Jun 9, 2025
fa48b06
one more try to avoid oom error
sunu Jun 9, 2025
e449fd7
A different approach to download the data
sunu Jun 9, 2025
53a0f71
install aws cli
sunu Jun 9, 2025
6039d5d
Refactor duckdb query
sunu Jun 10, 2025
9a876c7
switch to threadpool executor to avoid blocking main thread
sunu Jun 10, 2025
575523f
connect to duckdb in readonly mode
sunu Jun 10, 2025
82f10a8
Switch to 4.1 mini
sunu Jun 10, 2025
c3be4e5
bump up memory limit
sunu Jun 11, 2025
0af7a23
debug slow query on live cluster
sunu Jun 11, 2025
594f387
fix import error
sunu Jun 11, 2025
e21026f
update helm chart
sunu Jun 16, 2025
26ff0b5
Refactor: replace duckdb with postgis
sunu Jun 19, 2025
454c858
skip download if table exists
sunu Jun 19, 2025
4bb524b
increase default limit
sunu Jun 19, 2025
eec012c
update resource allocations
sunu Jun 19, 2025
f28359f
rename helm chart to helm/geodini
sunu Jun 19, 2025
2521b93
publish helm chart
sunu Jun 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 1 addition & 68 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- helm-chart

jobs:
build-and-push-api:
Expand Down Expand Up @@ -40,71 +41,3 @@ jobs:
push: true
tags: ${{ steps.meta-api.outputs.tags }}
labels: ${{ steps.meta-api.outputs.labels }}

build-and-push-duckdb-init:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for DuckDB Init
id: meta-duckdb
uses: docker/metadata-action@v5
with:
images: ghcr.io/sunu/geodini/duckdb-init
tags: |
type=sha
type=raw,value=latest

- name: Build and push DuckDB Init image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.duckdb
push: true
tags: ${{ steps.meta-duckdb.outputs.tags }}
labels: ${{ steps.meta-duckdb.outputs.labels }}

build-and-push-frontend:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Frontend
id: meta-frontend
uses: docker/metadata-action@v5
with:
images: ghcr.io/sunu/geodini/frontend
tags: |
type=sha
type=raw,value=latest

- name: Build and push Frontend image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.frontend
push: true
tags: ${{ steps.meta-frontend.outputs.tags }}
labels: ${{ steps.meta-frontend.outputs.labels }}
45 changes: 45 additions & 0 deletions .github/workflows/helm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish Helm Chart

on:
push:
branches:
- main
- helm-chart
paths:
- 'helm/**'
release:
types: [published]

jobs:
publish-helm-chart:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: '3.13.0'

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Package Helm chart
run: |
helm package helm/geodini --destination ./chart-packages

- name: Push Helm chart to GHCR
run: |
helm push ./chart-packages/*.tgz oci://ghcr.io/sunu/geodini/helm-chart

- name: List packaged charts
run: |
ls -la ./chart-packages/
12 changes: 0 additions & 12 deletions Dockerfile.duckdb

This file was deleted.

80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
# Geodini

A natural language geocoding API.

## Helm Chart Installation

This application can be deployed using the provided Helm chart located in the `geodini-chart` directory.

### Prerequisites

* Kubernetes cluster (e.g., Minikube, Kind, or a cloud provider's K8s service)
* Helm v3 installed
* `kubectl` configured to connect to your cluster

### Installation Steps

1. **Navigate to the chart directory:**
```bash
cd geodini-chart
```

2. **Review and customize values (Optional):**
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.
Key values you might want to override:
* `postgres.password`: **It is highly recommended to change the default PostgreSQL password.**
* `ingress.enabled`: Set to `true` if you have an Ingress controller and want to expose the application via Ingress.
* `ingress.hosts`: Configure your desired hostname(s).
* `ingress.tls`: Configure TLS secrets if using HTTPS.
* `appDataPersistence.size` and `postgres.persistence.size`: Adjust storage sizes as needed.
* Image tags for `api`, `frontend`, and `api.initContainer` if you want to use specific versions.

3. **Install the chart:**
To install the chart with the release name `geodini`:
```bash
helm install geodini .
```
If you have a custom values file:
```bash
helm install geodini . -f my-values.yaml
```
To install into a specific namespace:
```bash
helm install geodini . --namespace geodini-ns --create-namespace
```

4. **Check deployment status:**
```bash
kubectl get pods -n <your-namespace-if-any>
kubectl get svc -n <your-namespace-if-any>
```
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.

### Accessing the Application

* **Via Port-Forward (if Ingress is not enabled):**
The `NOTES.txt` from the Helm installation will provide `kubectl port-forward` commands. Typically:
```bash
# Forward Frontend
kubectl port-forward svc/geodini-frontend 8080:80 # Access at http://localhost:8080
# Forward API (if direct access needed)
kubectl port-forward svc/geodini-api 9000:9000
```
* **Via Ingress (if enabled):**
Access the application via the host and paths configured in your `values.yaml` (e.g., `http://chart-example.local/` or `https://your.domain.com/`).

### Upgrading the Chart

To upgrade an existing release:
```bash
helm upgrade geodini . -f my-values.yaml # Or without -f if no custom values
```

### Uninstalling the Chart

To uninstall/delete the `geodini` release:
```bash
helm uninstall geodini
```
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:
```bash
kubectl delete pvc geodini-app-data geodini-postgres-data
```
(Adjust PVC names based on your release name).
53 changes: 0 additions & 53 deletions docker-compose-prod.yml

This file was deleted.

33 changes: 15 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
services:
init-data:
init-ingest-data:
build:
context: .
dockerfile: Dockerfile.duckdb
dockerfile: Dockerfile.api
volumes:
- ./scripts:/scripts
- ./data:/data
command:
[
"/bin/bash",
"-c",
"chmod +x /scripts/init-data.sh && /scripts/init-data.sh",
]

# This service is for initialization, so no ports are exposed.
# It will run, and upon successful completion, other services depending on it will start.
- ./geodini:/app/geodini
- ./data:/app/data
environment:
- POSTGRES_HOST=database
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=postgres
- DATA_PATH=/app/data
command: ["python", "geodini/ingest.py"]

api:
build:
Expand All @@ -29,13 +28,13 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=postgres
- DATA_PATH=/app/data/overture-unified.duckdb
# Add other environment variables as needed
- DATA_PATH=/app/data
env_file:
- .env
volumes:
- ./geodini:/app/geodini
- ./data:/app/data

command:
[
"uvicorn",
Expand All @@ -49,7 +48,7 @@ services:
depends_on:
database:
condition: service_healthy
init-data:
init-ingest-data:
condition: service_completed_successfully

mcp:
Expand All @@ -75,8 +74,6 @@ services:
depends_on:
database:
condition: service_healthy
init-data:
condition: service_completed_successfully

frontend:
build:
Expand Down
4 changes: 2 additions & 2 deletions geodini/agents/complex_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class RoutingContext:


routing_agent = Agent(
"openai:gpt-4o-mini",
"openai:gpt-4.1-mini",
output_type=RoutingResult,
deps_type=RoutingContext,
system_prompt="""
Expand All @@ -94,7 +94,7 @@ class ComplexQueryContext:


complex_geocode_query_agent = Agent(
"openai:gpt-4o-mini",
"openai:gpt-4.1-mini",
output_type=ComplexGeocodeResult,
deps_type=ComplexQueryContext,
system_prompt="""
Expand Down
Loading