Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f060122
Update README.md
jedzill4 Jun 4, 2025
5d6e6d3
Update README.md
jedzill4 Jun 4, 2025
285897e
Update README.md
jedzill4 Jun 4, 2025
b82ef88
Update README.md
jedzill4 Jun 4, 2025
47a2013
🐛 bugfix: Fix XML special character escaping in DocAnonymizer
jansaldo Jul 18, 2025
e5d6c64
➕ build(deps): Add python-docx package
jansaldo Aug 4, 2025
02a99fa
✨ feat: Add watermark and hyperlink functionality to document anonymi…
jansaldo Aug 4, 2025
64d29ca
✨ feat: Install Archivo font in Dockerfile
jansaldo Aug 7, 2025
0ae1599
🎨 refactor: Improve Dockerfile structure and comments for clarity
jansaldo Aug 7, 2025
171fb41
⏪ revert: Remove Archivo font installation from Dockerfile
jansaldo Aug 8, 2025
47c8245
🔖 feat: Update aymurai package version to 1.1.11 in uv.lock
jansaldo Aug 8, 2025
695a15f
Merge pull request #54 from AymurAI/feature/document-footer-watermarks
jansaldo Aug 8, 2025
2a03f0a
🐛 Improve get_extension logic to fix document extraction issues on Wi…
jansaldo Sep 12, 2025
c5a03c0
🔧 Update Dockerfile to use 'bullseye' variant for Python images for i…
jansaldo Sep 12, 2025
afbfda9
🔧 Update Makefile targets for improved Docker workflow
jansaldo Sep 12, 2025
fd7579c
🔖 feat: Bump aymurai package version to 1.1.12
jansaldo Sep 12, 2025
b372fda
♻️ Harden get_extension with header scans and zip safeguards
jansaldo Nov 10, 2025
2a34fa0
🔧 Extend document extraction timeout to 30s
jansaldo Nov 10, 2025
070dcc2
Merge pull request #55 from AymurAI/fix/extraction-magic
jansaldo Nov 10, 2025
4196117
🔧 Refactor Docker workflow to build and push images using docker/buil…
jansaldo Nov 10, 2025
2b5a255
🔧 Fix workflow step order to correctly extract tag name before buildi…
jansaldo Nov 10, 2025
b27a70f
🔧 Remove tag extraction step and use github.ref_name directly for Doc…
jansaldo Nov 10, 2025
35faeb9
⏪ Revert Docker workflow to extract tag name and use it for image ve…
jansaldo Nov 10, 2025
5d3c899
Update .github/workflows/build-docker-image.yml
jansaldo Nov 11, 2025
3c4bbb5
Merge pull request #56 from AymurAI/fix/tag-api-version
jansaldo Nov 11, 2025
8c11a0b
Merge branch 'main' of github.com:AymurAI/backend into dev
jansaldo Nov 18, 2025
bc6bf58
✏️ Remove incomplete comment
jansaldo Nov 18, 2025
4d9f99a
Merge branch 'main' of github.com:AymurAI/backend into dev
jansaldo Nov 18, 2025
429cea0
Release/v1.5.0 (#75)
jansaldo Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 6 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.3
ARG UV_VERSION=0.5.10
ARG UV_VERSION=latest
ARG CORE_IMAGE=ubuntu:noble

FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS astral-uv-source
Expand Down Expand Up @@ -88,7 +88,11 @@ RUN apt update && apt install -y \
&& rm -rf /tmp/* /var/tmp/* \
&& rm -rf /var/lib/apt/lists/*


# Node.js & npm for frontend build
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
apt-get install -y nodejs

WORKDIR /tmp

Expand Down
13 changes: 9 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
"name": "aymurai",
// "initializeCommand": "make core-build",
"dockerComposeFile": "docker-compose.yml",
"service": "aymurai-devcontainer-gpu",
"service": "aymurai-devcontainer",
"runServices": [
"aymurai-devcontainer-gpu"
"aymurai-devcontainer"
],
"workspaceFolder": "/workspace",
"mounts": [
"source=codex-data,target=/home/ubuntu/.codex,type=volume"
],
"customizations": {
"vscode": {
"settings": {
Expand Down Expand Up @@ -47,9 +50,11 @@
"cweijan.vscode-database-client2",
"christian-kohler.path-intellisense",
"github.vscode-github-actions",
"seatonjiang.gitmoji-vscode"
"seatonjiang.gitmoji-vscode",
"openai.chatgpt"
]
}
},
"postCreateCommand": "bash /home/ubuntu/entrypoint.sh"
"postCreateCommand": "bash /home/ubuntu/entrypoint.sh",
"postStartCommand": "sudo chown -R ubuntu:ubuntu /home/ubuntu/.codex && sudo chmod -R u+rwX /home/ubuntu/.codex"
}
6 changes: 4 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ x-template: &template
- ..:/workspace:cached
- ../notebooks/:/notebooks
- ../resources/:/resources
- ../test/:/test
- ../tests/:/tests
- $HOME/.ssh/:/home/ubuntu/.ssh
- /var/run/docker.sock:/var/run/docker.sock
env_file:
Expand All @@ -27,7 +27,9 @@ services:
resources:
reservations:
devices:
- capabilities: [ gpu ]
- driver: nvidia
count: all
capabilities: [ gpu ]

aymurai-devcontainer:
<<: *template
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# install dependencies
uv sync --frozen --all-extras
uv sync --frozen --all-extras --all-groups

# configure precommit
uv run pre-commit install
Expand Down
7 changes: 5 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ resources/
!resources/api
!resources/pipelines
!resources/cache/aymurai
!resources/cache/tfhub_modules
notebooks/

*.egg-info/
*.egg-info/

frontend/node_modules/
frontend/out/
frontend-dist/
27 changes: 2 additions & 25 deletions .env.common
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
DATASETS_BASEPATH=/resources/datasets
MODELS_BASEPATH=/resources/models

CACHE_PATH=/resources/cache
AYMURAI_CACHE_BASEPATH=/resources/cache/aymurai

CACHE_PATH=/resources/cache
HF_DATASETS_CACHE=/resources/cache/huggingface/cache
TRANSFORMERS_CACHE=/resources/cache/huggingface/transformers
HF_HOME=/resources/cache/huggingface
TOKENIZERS_PARALLELISM=1

TESSDATA_PREFIX=/usr/local/share/tessdata

AYMURAI_RESTRICTED_DOCUMENT_PDFS_PATH="/resources/data/restricted/ar-juz-pcyf-10/RESOLUCIONES DEL JUZGADO-pdf"
AYMURAI_RESTRICTED_DOCUMENT_DOCS_PATH="/resources/data/restricted/ar-juz-pcyf-10/RESOLUCIONES DEL JUZGADO"

TF_CPP_MIN_LOG_LEVEL=3
TFHUB_CACHE_DIR=/resources/cache/tfhub_modules

TORCH_VERSION=2.0.1
CUDA_VERSION=cu118

CORE_IMAGE_CUDA=registry.gitlab.com/collective.ai/datagenero-public/aymurai-core
CORE_IMAGE_CPU=registry.gitlab.com/collective.ai/datagenero-public/aymurai-core-cpu
API_IMAGE=registry.gitlab.com/collective.ai/datagenero-public/aymurai-api

API_HOST=0.0.0.0
API_PORT=8899

SRC_VOLUME_MOUNT=src:/src
RESOURCES_VOLUME_MOUNT=resources:/resources
NOTEBOOKS_VOLUME_MOUNT=notebooks:/notebooks
87 changes: 87 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: pytest

on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch:

permissions:
contents: read

concurrency:
group: pr-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
pytest:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
name: pytest (${{ matrix.os }}, py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
python-version:
- "3.10"
# - "3.11"
# - "3.12"
# - "3.13"
# - "3.14"
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: latest
enable-cache: true
cache-dependency-glob: uv.lock

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Configure es_AR locale (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --yes locales
sudo locale-gen es_AR.UTF-8
sudo update-locale LANG=es_AR.UTF-8 LC_ALL=es_AR.UTF-8
echo "LANG=es_AR.UTF-8" >> "$GITHUB_ENV"
echo "LC_ALL=es_AR.UTF-8" >> "$GITHUB_ENV"
locale -a

- name: Install dependencies
run: |
uv sync --frozen --python python --no-dev --no-python-downloads --group tests

- name: Run api tests
env:
DISKCACHE_ROOT: /tmp
SQLALCHEMY_DATABASE_URI: sqlite:////tmp/aymurai-test.db
run: uv run --no-sync pytest -q --tb=short --disable-warnings --color=yes --maxfail=5 tests/api

- name: Download pipelines data
env:
DISKCACHE_ROOT: /tmp
RESOURCES_BASEPATH: resources
AYMURAI_CACHE_BASEPATH: resources/cache/aymurai
run: uv run --no-sync pipeline-download

- name: Run pipeline tests
env:
DISKCACHE_ROOT: /tmp
RESOURCES_BASEPATH: resources
AYMURAI_CACHE_BASEPATH: resources/cache/aymurai
run: uv run --no-sync pytest -q --tb=short --disable-warnings --color=yes --maxfail=5 tests/integration/pipelines
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,16 @@ resources
.venv

aymurai/version.py

.agents
.opencode.json
.sisyphus
notebooks/**
!notebooks/**/
!notebooks/**/*.ipynb

# Frontend build output
frontend-dist/

# pnpm local package store
.pnpm-store/
15 changes: 5 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
repos:
- repo: https://github.com/ambv/black
rev: 22.6.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
hooks:
- id: black
language_version: python3.10
- id: ruff
- id: ruff-format

- repo: https://github.com/kynan/nbstripout
rev: 0.6.0
hooks:
- id: nbstripout

# - repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v2.20.0
# hooks:
# - id: flake8
- id: nbstripout
28 changes: 28 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python-envs.defaultEnvManager": "ms-python.python:venv",
"python-envs.pythonProjects": [],
"files.associations": {
".csv": "csv",
".env*": "dotenv",
".json": "json",
".jsonc": "jsonc",
".jsonl": "jsonl",
".md": "markdown"
},
"github.copilot.enable": {
"*": true,
"dotenv": false,
"csv": false,
"json": false,
"jsonc": false,
"jsonl": false,
"markdown": false,
"plaintext": false,
"scminput": false
}
}
45 changes: 39 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,37 @@ export $(shell sed 's/=.*//' .env)
include .env.common
export $(shell sed 's/=.*//' .env.common)

# Select which API service to control (override with API_SERVICE=aymurai-api-gpu)
API_SERVICE ?= aymurai-api
# Select which full API service to control (override with API_FULL_SERVICE=aymurai-api-full-gpu)
API_FULL_SERVICE ?= aymurai-api-full


api-build:
docker compose build aymurai-api
docker compose build $(API_SERVICE)
api-run:
docker compose run --service-ports aymurai-api
docker compose run --service-ports $(API_SERVICE)
api-up:
docker compose up -d $(API_SERVICE)
api-stop:
docker compose stop $(API_SERVICE)
api-logs:
docker compose logs -f $(API_SERVICE)
api-pull:
docker compose pull aymurai-api
docker compose pull $(API_SERVICE)

api-full-build:
docker compose build aymurai-api-full
docker compose build $(API_FULL_SERVICE)
api-full-run:
docker compose run --service-ports aymurai-api-full
docker compose run --service-ports $(API_FULL_SERVICE)
api-full-up:
docker compose up -d $(API_FULL_SERVICE)
api-full-stop:
docker compose stop $(API_FULL_SERVICE)
api-full-logs:
docker compose logs -f $(API_FULL_SERVICE)
api-full-pull:
docker compose pull aymurai-api-full
docker compose pull $(API_FULL_SERVICE)

stress-test:
locust -f locustfile.py --host http://localhost:8899
Expand All @@ -27,3 +44,19 @@ alembic-regenerate:
cd aymurai && \
uv run alembic revision --autogenerate -m "Create database" && \
uv run alembic upgrade head

# --- Frontend build ---
FRONTEND_DIR=frontend
FRONTEND_DIST_DIR=frontend-dist

frontend-install:
cd $(FRONTEND_DIR) && pnpm install

frontend-build: frontend-install
cd $(FRONTEND_DIR) && pnpm run build:web
# Copy build output to frontend-dist
rm -rf $(FRONTEND_DIST_DIR)
cp -r $(FRONTEND_DIR)/out/renderer $(FRONTEND_DIST_DIR)

frontend-clean:
rm -rf $(FRONTEND_DIST_DIR)
Loading
Loading