Commit 3cc859b1 authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

Merge branch 'develop' into 'main'

fix: allow AI2 without login and stop mcp_use OAuth discovery

See merge request !7
parents 58403fca de66ac36
Loading
Loading
Loading
Loading
Loading
+6 −0
Changes for .gitignore: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -50,3 +50,9 @@ certs/*.crt
patch*

ai2_proxy*

*.tgz
charts/*.tgz

.agents
.codex

.gitlab-ci.yml

0 → 100644
+112 −0
Changes for .gitlab-ci.yml: 112 added lines, 0 removed lines.
Original line number Diff line number Diff line
default:
  image: python:3.12-slim
  cache:
    paths:
      - .cache/pip
  before_script:
    - cd "$CI_PROJECT_DIR"
    - python -m pip install -r mcp_module/requirements.txt -r ai_agent/requirements.txt
    - python -m pip install mypy pytest ruff import-linter
    - python -m pip check
    - export PYTHONPATH="$CI_PROJECT_DIR:$PYTHONPATH"

stages:
  - type
  - architecture
  - lint
  - format
  - test
  - build

variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  SOURCE_DIRS: "mcp_module/ ai_agent/"
  TEST_DIRS: "tests/"

include:
  - template: Security/SAST.gitlab-ci.yml

sast:
  stage: test
  before_script: []

type:
  stage: type
  script:
    - mypy $SOURCE_DIRS

architecture:
  stage: architecture
  script:
    - |
      if [ -f "$CI_PROJECT_DIR/.importlinter" ] || \
         [ -f "$CI_PROJECT_DIR/.importlinter.ini" ] || \
         [ -f "$CI_PROJECT_DIR/pyproject.toml" ] || \
         [ -f "$CI_PROJECT_DIR/setup.cfg" ]; then
        lint-imports
      else
        echo "No import-linter config found; skipping architecture check."
      fi

lint:
  stage: lint
  script:
    - ruff check $SOURCE_DIRS $TEST_DIRS

format:
  stage: format
  script:
    - ruff format --check $SOURCE_DIRS $TEST_DIRS

test:
  stage: test
  script:
    - pytest

.variables-template:
  image: docker:cli
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_TLS_CERTDIR: ""
  services:
    - docker:dind
  before_script:
    - docker info
    - echo "$CI_REGISTRY_PASSWORD" | docker login --username "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
    - |
      if [ -n "$CI_COMMIT_TAG" ]; then
        export IMAGE_TAG="$CI_COMMIT_TAG"
      elif [ "$CI_COMMIT_REF_NAME" = "main" ]; then
        export IMAGE_TAG="latest"
      elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then
        export IMAGE_TAG="develop"
      else
        export IMAGE_TAG="$(echo "$CI_COMMIT_REF_NAME" | tr '/' '-')"
      fi
      echo "Using image tag: $IMAGE_TAG"

build-ai-agent:
  stage: build
  extends: .variables-template
  variables:
    IMAGE_NAME: "ai_agent"
  script:
    - echo "Building ${IMAGE_NAME} image..."
    - docker buildx build --provenance=false --network=host -t "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" -f "$CI_PROJECT_DIR/$IMAGE_NAME/Dockerfile" --push "$CI_PROJECT_DIR/$IMAGE_NAME"
  only:
    - main
    - develop
    - tags

build-mcp-module:
  stage: build
  extends: .variables-template
  variables:
    IMAGE_NAME: "mcp_module"
  script:
    - echo "Building ${IMAGE_NAME} image..."
    - docker buildx build --provenance=false --network=host -t "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" -f "$CI_PROJECT_DIR/$IMAGE_NAME/Dockerfile" --push "$CI_PROJECT_DIR/$IMAGE_NAME"
  only:
    - main
    - develop
    - tags
+1 −1
Changes for README.md: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ The MCP Module implements an MCP server that exposes **CAMARA-compliant APIs** v


### 2. AI Agent
AI Agent is a lightweight, modular backend built with [`Quart`](https://quart.palletsprojects.com/en/latest/) that exposes REST API endpoints for interacting with multiple AI sub-agents. 
AI Agent is a lightweight, modular backend built with **[`FastAPI`](https://fastapi.tiangolo.com/)** that exposes REST API endpoints for interacting with multiple AI sub-agents. 

It is designed to be easily extensible with support for different LLMs and OpenOP MCP servers.

ai_agent/.dockerignore

0 → 100644
+10 −0
Changes for ai_agent/.dockerignore: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
__pycache__/
*.py[cod]
*.pyo
.pytest_cache/
.venv/
.env
.idea/
.git/
*.log
+3 −2
Changes for ai_agent/Dockerfile: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
FROM python:3.11-slim
FROM python:3.12-slim

ENV APP_HOST=0.0.0.0
ENV APP_PORT=9013
@@ -12,10 +12,11 @@ WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir \
    --trusted-host pypi.org \
    --default-timeout=120 \
    --trusted-host pypi.python.org \
    --trusted-host files.pythonhosted.org \
    -r requirements.txt

COPY . /app/ai_agent

CMD ["python", "-m", "ai_agent.app"]
CMD ["sh", "-c", "uvicorn ai_agent.app:app --host ${APP_HOST:-0.0.0.0} --port ${APP_PORT:-9013}"]
Loading