Commit Graph

6 Commits

Author SHA1 Message Date
Lee Chagolla-Christensen 7547ed6eb3 fix packages, again 2026-01-26 19:16:45 -08:00
Lee Chagolla-Christensen 67f874fcbe python 3.14.2, fix enrichment status bugs 2026-01-14 22:14:41 -08:00
Lee Chagolla-Christensen b5b00ca72a Migrate to uv from poetry (#99)
* initial uv migration

* update github workflows

* use python module not system commands

* remove poetry references

* fix uv in prod images

---------

Co-authored-by: Lee Chagolla-Christensen <lee@localhost>
2026-01-14 15:20:31 -08:00
Lee Chagolla-Christensen 5de5e23a30 Centralize workflow management and improve resource cleanup
Workflow Client Simplification:
- Removed async_workflow_client.py
- Removed taskhub_client.py
- Renamed set_fastapi_loop to set_workflow_runtime_loop

Workflow Purger Enhancement (+354 lines):
- Added configurable timeout detection for workflows
- Implemented database cursor streaming for batches
- Parallelized Dapr purge operations

Database Schema Changes:
- Added TIMEOUT status to workflow enum

Resource Management Refactor:
- Use AsyncExitStack in lifespan function
- Added cancel_task helper for graceful shutdowns
- Registered cleanup callbacks for automatic teardown

File Enrichment Controller:
- Moved event loop setup before FastAPI
- Extracted health endpoint to separate router

Performance Improvements:
- Changed DPAPI monitor interval: 5s to 30s
- Implemented parallel workflow purge operations
- Added DB cursor for workflow purging
- Removed PID logging

New Features:
- Refactored timeout termination for workflows

Configuration Updates:
- MAX_PARALLEL_WORKFLOWS: 2 to 1 (debug)
- WORKFLOW_CLIENT_LOG_LEVEL: INFO to DEBUG
- Enhanced README debugging instructions for file enrichment
- Disabled structlog timestamp processor

Web API Changes:
- Changed TERMINATED to TIMEOUT in queries
- Updated reporting routes for new status

Infrastructure:
- Added jq and iputils-ping to dev Dockerfile
2025-11-11 23:59:43 -08:00
Lee Chagolla-Christensen 5d7b9bb31d Centralized workflow purging/tracking, perf improvements
Infrastructure:
- Enable pg_stat_statements extension for query monitoring
- Increase Postgres max connections and shared buffers
- Bump RabbitMQ prefetchCount to 100
- Add curl/netstat/htop to dev Docker image

Database:
- Add indexes for findings and workflows
- Add workflow status constraint and is_purged column
- Index workflows by object_id for active workflows

Workflow tracking:
- Add WorkflowStatus enum
- Added finalize_workflow activity
- Generate instance IDs with name prefix pattern
  (<name>.<instance>.<object_id>)

Workflow purging:
- Create WorkflowPurger to purge Dapr workflow data (kills perf over
  time)
- added to file_enrichment/document_conversion
- New workflows column to track purge workflows

File linking:
- Optimize upserts to single query (perf)

Configuration:
- PII info in env.example
2025-11-08 16:08:11 -08:00
Lee Christensen 8035a6a168 add code 2025-06-13 11:33:07 +02:00