Skip to content

Commit

Permalink
Merge pull request #2402 from Agenta-AI/chore/remove-mongodb
Browse files Browse the repository at this point in the history
Remove MongoDB
  • Loading branch information
aybruhm authored Jan 23, 2025
2 parents 0989e7d + 1df7b40 commit 0c2967f
Show file tree
Hide file tree
Showing 39 changed files with 24 additions and 7,755 deletions.
11 changes: 0 additions & 11 deletions agenta-backend/agenta_backend/apis/fastapi/observability/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ class ObservabilityRouter:
def __init__(
self,
observability_service: ObservabilityService,
observability_legacy_receiver: Optional[Callable] = None,
):
self.service = observability_service

self.legacy_receiver = observability_legacy_receiver

self.router = APIRouter()

### OTLP
Expand Down Expand Up @@ -140,14 +137,6 @@ async def otlp_receiver(

otlp_stream = await request.body()

### LEGACY ###
if self.legacy_receiver:
await self.legacy_receiver(
project_id=request.state.project_id,
otlp_stream=otlp_stream,
)
### LEGACY ###

otel_span_dtos = parse_otlp_stream(otlp_stream)

span_dtos = [
Expand Down
2 changes: 0 additions & 2 deletions agenta-backend/agenta_backend/dbs/postgres/shared/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

DATABASE_MODE = os.environ.get("DATABASE_MODE", "v2")
POSTGRES_URI = os.environ.get("POSTGRES_URI")
MONGODB_URI = os.environ.get("MONGODB_URI")
11 changes: 1 addition & 10 deletions agenta-backend/agenta_backend/dbs/postgres/shared/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
async_scoped_session,
)

from agenta_backend.dbs.postgres.shared.config import (
POSTGRES_URI,
DATABASE_MODE,
MONGODB_URI,
)
from agenta_backend.dbs.postgres.shared.config import POSTGRES_URI


class Engine:
Expand All @@ -36,11 +32,6 @@ def __init__(self) -> None:
scopefunc=current_task,
)

### LEGACY CODE ###
self.mode = DATABASE_MODE
self.mongo_uri = MONGODB_URI
### ----------- ###

async def open(self):
raise NotImplementedError()

Expand Down
18 changes: 2 additions & 16 deletions agenta-backend/agenta_backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ async def lifespan(application: FastAPI, cache=True):
cache: A boolean value that indicates whether to use the cached data or not.
"""

if isCloudEE():
from agenta_backend.cloud.db.mongo_engine import initialize_mongodb

await initialize_mongodb()

await check_for_new_migrations()
if await check_if_templates_table_exist():
await templates_manager.update_and_sync_templates(cache=cache)
Expand Down Expand Up @@ -130,19 +125,10 @@ async def lifespan(application: FastAPI, cache=True):
app.include_router(configs_router.router, prefix="/configs", tags=["Configs"])


observability_legacy_receiver = None
if isCloudEE():
import agenta_backend.cloud.main as cloud

observability_legacy_receiver = cloud.observability_legacy_receiver

observability = ObservabilityRouter(
ObservabilityService(ObservabilityDAO()),
observability_legacy_receiver=observability_legacy_receiver,
)
observability = ObservabilityRouter(ObservabilityService(ObservabilityDAO()))

app.include_router(
router=observability.router, prefix="/observability/v1", tags=["Observability [v1]"]
router=observability.router, prefix="/observability/v1", tags=["Observability"]
)

if isCloudEE():
Expand Down
33 changes: 0 additions & 33 deletions agenta-backend/agenta_backend/migrations/mongo/backup.py

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0c2967f

Please sign in to comment.