From d10c9160f334248ba0b48eac4fad1b7ca3f1e566 Mon Sep 17 00:00:00 2001 From: Francwa Date: Wed, 24 Dec 2025 08:09:26 +0100 Subject: [PATCH] infra: renamed broken references to alfred --- .env.example | 8 ++++---- .gitea/workflows/ci.yml | 1 - Dockerfile | 24 ++++++++++++------------ Makefile | 8 ++++---- docker-compose.yml | 18 ++++++++---------- librechat/librechat.yaml | 18 +++++++++--------- pyproject.toml | 2 +- tests/conftest.py | 3 ++- 8 files changed, 40 insertions(+), 42 deletions(-) diff --git a/.env.example b/.env.example index 2ea651e..7a4ccd0 100644 --- a/.env.example +++ b/.env.example @@ -41,10 +41,10 @@ RAG_EMBEDDINGS_MODEL=text-embedding-3-small # OpenAI API Key (required for RAG embeddings) OPENAI_API_KEY=your-openai-api-key-here -# Deepseek API Key (for LLM in agent-brain) +# Deepseek API Key (for LLM in alfred) DEEPSEEK_API_KEY=your-deepseek-api-key-here -# Agent Brain Configuration +# Alfred Configuration # LLM Provider (deepseek or ollama) LLM_PROVIDER=deepseek @@ -52,8 +52,8 @@ LLM_PROVIDER=deepseek # Memory storage directory (inside container) MEMORY_STORAGE_DIR=/data/memory -# API Key for agent-brain (used by LibreChat custom endpoint) -AGENT_BRAIN_API_KEY=agent-brain-secret-key +# API Key for alfred (used by LibreChat custom endpoint) +ALFRED_API_KEY=alfred-secret-key # External Services (Optional) # TMDB API Key (for movie metadata) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index eb544f8..ee4a02c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -63,7 +63,6 @@ jobs: uses: docker/build-push-action@v5 with: context: . - file: ./brain/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 8de8721..2a01337 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \ WORKDIR /tmp # Copy dependency files -COPY brain/pyproject.toml brain/poetry.lock* brain/uv.lock* Makefile ./ +COPY pyproject.toml poetry.lock* uv.lock* Makefile ./ # Install dependencies as root (to avoid permission issues with system packages) RUN --mount=type=cache,target=/root/.cache/pip \ @@ -59,12 +59,12 @@ RUN --mount=type=cache,target=/root/.cache/pip \ uv pip install --system -e .[dev]; \ fi -COPY brain/agent/ ./agent/ -COPY brain/application/ ./application/ -COPY brain/domain/ ./domain/ -COPY brain/infrastructure/ ./infrastructure/ -COPY brain/tests/ ./tests/ -COPY brain/app.py . +COPY alfred/agent/ ./agent/ +COPY alfred/application/ ./application/ +COPY alfred/domain/ ./domain/ +COPY alfred/infrastructure/ ./infrastructure/ +COPY alfred/tests/ ./tests/ +COPY alfred/app.py . # =========================================== # Stage 3: Runtime @@ -103,11 +103,11 @@ COPY --from=builder /usr/local/lib/python${PYTHON_VERSION_SHORT}/site-packages / COPY --from=builder /usr/local/bin /usr/local/bin # Copy application code (already owned by appuser) -COPY --chown=appuser:appuser brain/agent/ ./agent/ -COPY --chown=appuser:appuser brain/application/ ./application/ -COPY --chown=appuser:appuser brain/domain/ ./domain/ -COPY --chown=appuser:appuser brain/infrastructure/ ./infrastructure/ -COPY --chown=appuser:appuser brain/app.py . +COPY --chown=appuser:appuser alfred/agent/ ./agent/ +COPY --chown=appuser:appuser alfred/application/ ./application/ +COPY --chown=appuser:appuser alfred/domain/ ./domain/ +COPY --chown=appuser:appuser alfred/infrastructure/ ./infrastructure/ +COPY --chown=appuser:appuser alfred/app.py . # Create volumes for persistent data VOLUME ["/data/memory", "/data/logs"] diff --git a/Makefile b/Makefile index 1097bf1..a0c3ac7 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,14 @@ .DEFAULT_GOAL := help # --- SETTINGS --- -CORE_DIR = brain -IMAGE_NAME = agent_media +CORE_DIR = alfred +IMAGE_NAME = alfred_media_organizer # renovate: datasource=docker depName=python PYTHON_VERSION = $(shell grep "python" $(CORE_DIR)/pyproject.toml | head -n 1 | sed -E 's/.*[=<>^~"]+ *([0-9]+\.[0-9]+(\.[0-9]+)?).*/\1/') PYTHON_VERSION_SHORT = $(shell echo $(PYTHON_VERSION) | cut -d. -f1,2) # Change to 'uv' when ready. RUNNER ?= poetry -SERVICE_NAME = agent_media +SERVICE_NAME = alfred export IMAGE_NAME export PYTHON_VERSION @@ -157,7 +157,7 @@ init-dotenv: @sed -i.bak "s|CREDS_KEY=.*|CREDS_KEY=$$(openssl rand -hex 16)|" .env @sed -i.bak "s|CREDS_IV=.*|CREDS_IV=$$(openssl rand -hex 8)|" .env @sed -i.bak "s|MEILI_MASTER_KEY=.*|MEILI_MASTER_KEY=$$(openssl rand -base64 32)|" .env - @sed -i.bak "s|AGENT_BRAIN_API_KEY=.*|AGENT_BRAIN_API_KEY=$$(openssl rand -base64 24)|" .env + @sed -i.bak "s|ALFRED_API_KEY=.*|ALFRED_API_KEY=$$(openssl rand -base64 24)|" .env @rm -f .env.bak @echo "$(G)✅ .env created with generated secrets!$(R)" @echo "$(T)⚠️ Don't forget to add your API keys:$(R)" diff --git a/docker-compose.yml b/docker-compose.yml index b5d87af..731310e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,12 @@ version: "3.4" services: - # Da brain - agent-brain: + alfred: build: - context: ./brain - dockerfile: Dockerfile + context: . args: RUNNER: ${RUNNER} # Get it from Makefile - container_name: agent-brain + container_name: alfred restart: unless-stopped env_file: .env ports: @@ -18,7 +16,7 @@ services: - agent-memory:/data/memory - agent-logs:/data/logs # Development: mount code for hot reload (comment out in production) - # - ./brain:/app + # - ./alfred:/app environment: # LLM Configuration LLM_PROVIDER: ${LLM_PROVIDER:-deepseek} @@ -46,7 +44,7 @@ services: - mongodb - meilisearch - rag_api - - agent-brain + - alfred env_file: .env environment: # MongoDB connection (no auth, matching LibreChat default) @@ -80,8 +78,8 @@ services: # Endpoints ENDPOINTS: custom - # Custom endpoint pointing to agent-brain - CUSTOM_API_KEY: ${AGENT_BRAIN_API_KEY:-agent-brain-secret-key} + # Custom endpoint pointing to alfred + CUSTOM_API_KEY: ${ALFRED_API_KEY:-alfred-secret-key} # Debug (optional) DEBUG_LOGGING: ${DEBUG_LOGGING:-false} @@ -195,7 +193,7 @@ volumes: librechat-logs: driver: local - # Agent Brain data + # Alfred data agent-memory: driver: local agent-logs: diff --git a/librechat/librechat.yaml b/librechat/librechat.yaml index 196c08d..2691484 100644 --- a/librechat/librechat.yaml +++ b/librechat/librechat.yaml @@ -22,7 +22,7 @@ endpoints: manifest: schema: type: openapi - url: "http://agent-brain:8000/manifests/find_media_imdb_id.json" + url: "http://alfred:8000/manifests/find_media_imdb_id.json" auth: type: none @@ -32,7 +32,7 @@ endpoints: manifest: schema: type: openapi - url: "http://agent-brain:8000/manifests/find_torrent.json" + url: "http://alfred:8000/manifests/find_torrent.json" auth: type: none @@ -42,7 +42,7 @@ endpoints: manifest: schema: type: openapi - url: "http://agent-brain:8000/manifests/add_torrent_by_index.json" + url: "http://alfred:8000/manifests/add_torrent_by_index.json" auth: type: none @@ -52,7 +52,7 @@ endpoints: manifest: schema: type: openapi - url: "http://agent-brain:8000/manifests/set_language.json" + url: "http://alfred:8000/manifests/set_language.json" auth: type: none @@ -60,7 +60,7 @@ endpoints: # Backend Local Agent - name: "Local Agent" apiKey: "dummy_key" - baseURL: "http://agent-brain:8000/v1" + baseURL: "http://alfred:8000/v1" models: default: ["local-deepseek-agent"] fetch: false @@ -75,7 +75,7 @@ endpoints: manifest: schema: type: openapi - url: "http://agent-brain:8000/manifests/find_media_imdb_id.json" + url: "http://alfred:8000/manifests/find_media_imdb_id.json" auth: type: none @@ -85,7 +85,7 @@ endpoints: manifest: schema: type: openapi - url: "http://agent-brain:8000/manifests/find_torrent.json" + url: "http://alfred:8000/manifests/find_torrent.json" auth: type: none @@ -95,7 +95,7 @@ endpoints: manifest: schema: type: openapi - url: "http://agent-brain:8000/manifests/add_torrent_by_index.json" + url: "http://alfred:8000/manifests/add_torrent_by_index.json" auth: type: none @@ -105,6 +105,6 @@ endpoints: manifest: schema: type: openapi - url: "http://agent-brain:8000/manifests/set_language.json" + url: "http://alfred:8000/manifests/set_language.json" auth: type: none diff --git a/pyproject.toml b/pyproject.toml index 69b6eaa..32de1a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "agent-media" +name = "alfred" version = "0.1.6" description = "AI agent for managing a local media library" authors = ["Francwa "] diff --git a/tests/conftest.py b/tests/conftest.py index c1448e4..67c6932 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,8 +3,9 @@ import sys from pathlib import Path +#TODO: Moved directory, should not be necessary anymore but need to check !! # Ajouter le dossier parent (brain) au PYTHONPATH -sys.path.insert(0, str(Path(__file__).parent.parent)) +# sys.path.insert(0, str(Path(__file__).parent.parent)) import shutil import tempfile