aegis-stack 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aegis-stack might be problematic. Click here for more details.
- aegis/__init__.py +5 -0
- aegis/__main__.py +374 -0
- aegis/core/CLAUDE.md +365 -0
- aegis/core/__init__.py +6 -0
- aegis/core/components.py +115 -0
- aegis/core/dependency_resolver.py +119 -0
- aegis/core/template_generator.py +163 -0
- aegis/templates/CLAUDE.md +306 -0
- aegis/templates/cookiecutter-aegis-project/cookiecutter.json +27 -0
- aegis/templates/cookiecutter-aegis-project/hooks/post_gen_project.py +172 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/.dockerignore +71 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/.env.example.j2 +70 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/.gitignore +127 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/Dockerfile +53 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/Makefile +211 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/README.md.j2 +196 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/__init__.py +5 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/cli/__init__.py +6 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/cli/health.py +321 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/cli/load_test.py +638 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/cli/main.py +41 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/__init__.py +0 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/api/__init__.py +0 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/api/health.py +134 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/api/models.py.j2 +247 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/api/routing.py.j2 +14 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/api/tasks.py.j2 +596 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/hooks.py +133 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/main.py +16 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/middleware/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/middleware/cors.py +20 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/shutdown/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/shutdown/cleanup.py +14 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/startup/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/backend/startup/component_health.py.j2 +190 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/frontend/__init__.py +0 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/frontend/core/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/frontend/core/theme.py +46 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/frontend/main.py +687 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/scheduler/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/scheduler/main.py +138 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/CLAUDE.md +213 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/__init__.py +6 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/constants.py.j2 +30 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/pools.py +78 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/queues/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/queues/load_test.py +48 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/queues/media.py +41 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/queues/system.py +36 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/registry.py +139 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/tasks/__init__.py +119 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/tasks/load_tasks.py +526 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/tasks/simple_system_tasks.py +32 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/components/worker/tasks/system_tasks.py +279 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/core/config.py.j2 +119 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/core/constants.py +60 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/core/db.py +67 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/core/log.py +85 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/entrypoints/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/entrypoints/webserver.py +40 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/entrypoints/{% if cookiecutter.include_scheduler == /"yes/" %}scheduler.py{% endif %}" +21 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/integrations/__init__.py +0 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/integrations/main.py +61 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/py.typed +0 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/load_test.py +661 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/load_test_models.py +269 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/shared/__init__.py +15 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/shared/models.py +26 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/system/__init__.py +52 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/system/alerts.py +94 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/system/health.py.j2 +1105 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/system/models.py +169 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/app/services/system/ui.py +52 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/docker-compose.yml.j2 +195 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/docs/api.md +191 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/docs/components/scheduler.md +414 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/docs/development.md +215 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/docs/health.md +240 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/docs/javascripts/mermaid-config.js +62 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/docs/stylesheets/mermaid.css +95 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/mkdocs.yml.j2 +62 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/pyproject.toml.j2 +156 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/scripts/entrypoint.sh +87 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/scripts/entrypoint.sh.j2 +104 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/scripts/gen_docs.py +16 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/api/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/api/test_health_endpoints.py.j2 +239 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/components/test_scheduler.py +76 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/conftest.py.j2 +81 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/services/__init__.py +1 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/services/test_component_integration.py.j2 +376 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/services/test_health_logic.py.j2 +633 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/services/test_load_test_models.py +665 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/services/test_load_test_service.py +602 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/services/test_system_service.py +96 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/services/test_worker_health_registration.py.j2 +224 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/tests/test_core.py +50 -0
- aegis/templates/cookiecutter-aegis-project/{{cookiecutter.project_slug}}/uv.lock +1673 -0
- aegis_stack-0.1.0.dist-info/METADATA +114 -0
- aegis_stack-0.1.0.dist-info/RECORD +103 -0
- aegis_stack-0.1.0.dist-info/WHEEL +4 -0
- aegis_stack-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
|
|
24
|
+
# Virtual environments - don't mount host venv into container
|
|
25
|
+
.venv/
|
|
26
|
+
.env/
|
|
27
|
+
venv/
|
|
28
|
+
ENV/
|
|
29
|
+
|
|
30
|
+
# Testing
|
|
31
|
+
.pytest_cache/
|
|
32
|
+
.coverage
|
|
33
|
+
htmlcov/
|
|
34
|
+
.tox/
|
|
35
|
+
.nox/
|
|
36
|
+
|
|
37
|
+
# IDE
|
|
38
|
+
.vscode/
|
|
39
|
+
.idea/
|
|
40
|
+
*.swp
|
|
41
|
+
*.swo
|
|
42
|
+
*~
|
|
43
|
+
|
|
44
|
+
# OS
|
|
45
|
+
.DS_Store
|
|
46
|
+
.DS_Store?
|
|
47
|
+
._*
|
|
48
|
+
.Spotlight-V100
|
|
49
|
+
.Trashes
|
|
50
|
+
ehthumbs.db
|
|
51
|
+
Thumbs.db
|
|
52
|
+
|
|
53
|
+
# Logs
|
|
54
|
+
*.log
|
|
55
|
+
|
|
56
|
+
# Temporary files
|
|
57
|
+
*.tmp
|
|
58
|
+
*.temp
|
|
59
|
+
|
|
60
|
+
# Git
|
|
61
|
+
.git/
|
|
62
|
+
.gitignore
|
|
63
|
+
|
|
64
|
+
# Documentation build
|
|
65
|
+
site/
|
|
66
|
+
docs/_build/
|
|
67
|
+
|
|
68
|
+
# Cache
|
|
69
|
+
.cache/
|
|
70
|
+
.mypy_cache/
|
|
71
|
+
.ruff_cache/
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Aegis Stack Environment Variables Example
|
|
2
|
+
# Copy this file to .env and customize for your environment
|
|
3
|
+
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# APPLICATION SETTINGS
|
|
6
|
+
# =============================================================================
|
|
7
|
+
|
|
8
|
+
# Environment: dev, qa, stg, prod
|
|
9
|
+
APP_ENV=dev
|
|
10
|
+
|
|
11
|
+
# Port to run the webserver on
|
|
12
|
+
PORT=8000
|
|
13
|
+
|
|
14
|
+
# Logging level: DEBUG, INFO, WARNING, ERROR
|
|
15
|
+
LOG_LEVEL=INFO
|
|
16
|
+
|
|
17
|
+
# Auto-reload server on code changes (development only)
|
|
18
|
+
AUTO_RELOAD=true
|
|
19
|
+
|
|
20
|
+
# =============================================================================
|
|
21
|
+
# DOCKER SETTINGS
|
|
22
|
+
# =============================================================================
|
|
23
|
+
|
|
24
|
+
# Docker image tag (used by docker-compose)
|
|
25
|
+
AEGIS_STACK_TAG=aegis-stack:latest
|
|
26
|
+
|
|
27
|
+
# Version tag for builds
|
|
28
|
+
AEGIS_STACK_VERSION=dev
|
|
29
|
+
|
|
30
|
+
# Environment file to use (defaults to .env)
|
|
31
|
+
# AEGIS_STACK_ENV_FILE=.env
|
|
32
|
+
|
|
33
|
+
# =============================================================================
|
|
34
|
+
# COMPONENT SETTINGS
|
|
35
|
+
# =============================================================================
|
|
36
|
+
|
|
37
|
+
{% if cookiecutter.include_database == "yes" %}
|
|
38
|
+
# Database settings
|
|
39
|
+
# DATABASE_URL=sqlite:///./data/app.db # SQLite database (default)
|
|
40
|
+
# DATABASE_ENGINE_ECHO=false # Set to true to log all SQL queries (debugging)
|
|
41
|
+
{% endif %}
|
|
42
|
+
|
|
43
|
+
{% if cookiecutter.include_redis == "yes" or cookiecutter.include_cache == "yes" %}
|
|
44
|
+
# Redis settings
|
|
45
|
+
# REDIS_URL=redis://localhost:6379
|
|
46
|
+
# REDIS_HOST=localhost
|
|
47
|
+
# REDIS_PORT=6379
|
|
48
|
+
# REDIS_PASSWORD=
|
|
49
|
+
{% endif %}
|
|
50
|
+
|
|
51
|
+
{% if cookiecutter.include_scheduler == "yes" %}
|
|
52
|
+
# Scheduler settings
|
|
53
|
+
# SCHEDULER_TIMEZONE=UTC
|
|
54
|
+
# SCHEDULER_MAX_WORKERS=10
|
|
55
|
+
{% endif %}
|
|
56
|
+
|
|
57
|
+
# API Keys and Secrets (add as needed)
|
|
58
|
+
# SECRET_KEY=your-super-secret-key-here
|
|
59
|
+
# API_KEY=your-api-key-here
|
|
60
|
+
|
|
61
|
+
# =============================================================================
|
|
62
|
+
# DEVELOPMENT OVERRIDES
|
|
63
|
+
# =============================================================================
|
|
64
|
+
|
|
65
|
+
# Worker auto-reload settings
|
|
66
|
+
# WORKER_WATCH=false # Disable worker auto-reload (useful for debugging)
|
|
67
|
+
|
|
68
|
+
# Override for local development
|
|
69
|
+
# Use this to point to local services instead of Docker services
|
|
70
|
+
# DATABASE_HOST=host.docker.internal # For connecting to host DB from container
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.so
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
# Usually these files are written by a python script from a template
|
|
30
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.nox/
|
|
42
|
+
.coverage
|
|
43
|
+
.coverage.*
|
|
44
|
+
.cache
|
|
45
|
+
nosetests.xml
|
|
46
|
+
coverage.xml
|
|
47
|
+
*.cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
.pytest_cache/
|
|
50
|
+
|
|
51
|
+
# Translations
|
|
52
|
+
*.mo
|
|
53
|
+
*.pot
|
|
54
|
+
|
|
55
|
+
# Django stuff:
|
|
56
|
+
*.log
|
|
57
|
+
local_settings.py
|
|
58
|
+
db.sqlite3
|
|
59
|
+
|
|
60
|
+
# Flask stuff:
|
|
61
|
+
instance/
|
|
62
|
+
.webassets-cache
|
|
63
|
+
|
|
64
|
+
# Scrapy stuff:
|
|
65
|
+
.scrapy
|
|
66
|
+
|
|
67
|
+
# Sphinx documentation
|
|
68
|
+
docs/_build/
|
|
69
|
+
|
|
70
|
+
# PyBuilder
|
|
71
|
+
target/
|
|
72
|
+
|
|
73
|
+
# Jupyter Notebook
|
|
74
|
+
.ipynb_checkpoints
|
|
75
|
+
|
|
76
|
+
# IPython
|
|
77
|
+
profile_default/
|
|
78
|
+
ipython_config.py
|
|
79
|
+
|
|
80
|
+
# pyenv
|
|
81
|
+
.python-version
|
|
82
|
+
|
|
83
|
+
# celery beat schedule file
|
|
84
|
+
celerybeat-schedule
|
|
85
|
+
|
|
86
|
+
# SageMath parsed files
|
|
87
|
+
*.sage.py
|
|
88
|
+
|
|
89
|
+
# Environments
|
|
90
|
+
.env
|
|
91
|
+
.venv
|
|
92
|
+
env/
|
|
93
|
+
venv/
|
|
94
|
+
ENV/
|
|
95
|
+
env.bak/
|
|
96
|
+
venv.bak/
|
|
97
|
+
|
|
98
|
+
# Spyder project settings
|
|
99
|
+
.spyderproject
|
|
100
|
+
.spyproject
|
|
101
|
+
|
|
102
|
+
# Rope project settings
|
|
103
|
+
.ropeproject
|
|
104
|
+
|
|
105
|
+
# mkdocs documentation
|
|
106
|
+
/site
|
|
107
|
+
|
|
108
|
+
# mypy
|
|
109
|
+
.mypy_cache/
|
|
110
|
+
.dmypy.json
|
|
111
|
+
dmypy.json
|
|
112
|
+
|
|
113
|
+
# IDE
|
|
114
|
+
.vscode/
|
|
115
|
+
.idea/
|
|
116
|
+
*.swp
|
|
117
|
+
*.swo
|
|
118
|
+
*~
|
|
119
|
+
|
|
120
|
+
# OS generated files
|
|
121
|
+
.DS_Store
|
|
122
|
+
.DS_Store?
|
|
123
|
+
._*
|
|
124
|
+
.Spotlight-V100
|
|
125
|
+
.Trashes
|
|
126
|
+
ehthumbs.db
|
|
127
|
+
Thumbs.db
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
FROM python:3.11-slim
|
|
2
|
+
|
|
3
|
+
# Install system dependencies and clean up
|
|
4
|
+
RUN apt-get update -y && \
|
|
5
|
+
apt-get install -y --no-install-recommends \
|
|
6
|
+
build-essential \
|
|
7
|
+
ca-certificates \
|
|
8
|
+
curl \
|
|
9
|
+
&& \
|
|
10
|
+
apt-get clean && \
|
|
11
|
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
12
|
+
|
|
13
|
+
# Install uv with specific version for reproducibility
|
|
14
|
+
RUN pip install --no-cache-dir uv==0.4.18
|
|
15
|
+
|
|
16
|
+
# Set environment variables
|
|
17
|
+
ENV PYTHONUNBUFFERED=1 \
|
|
18
|
+
PYTHONPATH=/code \
|
|
19
|
+
UV_CACHE_DIR=/tmp/uv-cache
|
|
20
|
+
|
|
21
|
+
WORKDIR /code
|
|
22
|
+
|
|
23
|
+
# Copy dependency files and README (needed by pyproject.toml)
|
|
24
|
+
COPY pyproject.toml uv.lock README.md /code/
|
|
25
|
+
|
|
26
|
+
# Install dependencies
|
|
27
|
+
RUN uv sync --all-extras && \
|
|
28
|
+
rm -rf /tmp/uv-cache
|
|
29
|
+
|
|
30
|
+
# Copy application code
|
|
31
|
+
COPY . /code
|
|
32
|
+
|
|
33
|
+
# Make entrypoint executable
|
|
34
|
+
RUN chmod +x /code/scripts/entrypoint.sh
|
|
35
|
+
|
|
36
|
+
# Set default port as an environment variable
|
|
37
|
+
ARG PORT=8000
|
|
38
|
+
ENV PORT=$PORT
|
|
39
|
+
|
|
40
|
+
# Expose the port
|
|
41
|
+
EXPOSE $PORT
|
|
42
|
+
|
|
43
|
+
# Add health check
|
|
44
|
+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
|
45
|
+
CMD curl -f http://localhost:$PORT/health || exit 1
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# Labels for better container management
|
|
49
|
+
LABEL maintainer="contact@aegis-stack.dev" \
|
|
50
|
+
version="0.1.0" \
|
|
51
|
+
description="Aegis Stack - Production-ready async Python foundation"
|
|
52
|
+
|
|
53
|
+
ENTRYPOINT ["uv", "run", "/code/scripts/entrypoint.sh"]
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# {{ cookiecutter.project_name }} - Aegis Stack Project
|
|
2
|
+
# Developer-friendly commands for Docker workflow
|
|
3
|
+
|
|
4
|
+
#=============================================================================
|
|
5
|
+
# CORE DOCKER COMMANDS
|
|
6
|
+
#=============================================================================
|
|
7
|
+
|
|
8
|
+
build: ## Build all Docker images (safe, sequential)
|
|
9
|
+
@echo "๐จ Building Docker images..."
|
|
10
|
+
@docker compose build
|
|
11
|
+
|
|
12
|
+
serve: ## Run all services (assumes images are built)
|
|
13
|
+
@echo "๐ Starting services... (Press Ctrl+C to stop)"
|
|
14
|
+
@docker compose --profile dev up
|
|
15
|
+
|
|
16
|
+
serve-bg: ## Run all services in background
|
|
17
|
+
@echo "๐ Starting services in background..."
|
|
18
|
+
@docker compose --profile dev up -d
|
|
19
|
+
|
|
20
|
+
stop: ## Gracefully stop all services
|
|
21
|
+
@echo "โน๏ธ Stopping services..."
|
|
22
|
+
@docker compose --profile dev down
|
|
23
|
+
|
|
24
|
+
clean: ## Nuclear cleanup - remove containers, networks, and images
|
|
25
|
+
@echo "๐งน Nuclear cleanup - removing everything..."
|
|
26
|
+
@docker compose down --remove-orphans --volumes --rmi all 2>/dev/null || true
|
|
27
|
+
@docker system prune -f
|
|
28
|
+
|
|
29
|
+
#=============================================================================
|
|
30
|
+
# DEVELOPER WORKFLOW COMMANDS (the ones you'll actually use)
|
|
31
|
+
#=============================================================================
|
|
32
|
+
|
|
33
|
+
rebuild: build serve ## Build images and start services
|
|
34
|
+
|
|
35
|
+
refresh: clean build serve ## Nuclear reset - clean everything and rebuild
|
|
36
|
+
|
|
37
|
+
restart: stop serve ## Quick restart (no rebuild)
|
|
38
|
+
|
|
39
|
+
#=============================================================================
|
|
40
|
+
# DEBUGGING AND LOGS
|
|
41
|
+
#=============================================================================
|
|
42
|
+
|
|
43
|
+
logs: ## Follow logs from all services
|
|
44
|
+
@echo "๐ Following all service logs..."
|
|
45
|
+
@docker compose logs -f
|
|
46
|
+
|
|
47
|
+
logs-web: ## Follow webserver logs only
|
|
48
|
+
@echo "๐ Following webserver logs..."
|
|
49
|
+
@docker compose logs -f webserver
|
|
50
|
+
|
|
51
|
+
logs-worker: ## Follow worker logs only
|
|
52
|
+
@echo "๐ Following worker logs..."
|
|
53
|
+
@docker compose logs -f worker-system worker-load-test
|
|
54
|
+
|
|
55
|
+
logs-redis: ## Follow Redis logs only
|
|
56
|
+
@echo "๐ Following Redis logs..."
|
|
57
|
+
@docker compose logs -f redis{% if cookiecutter.include_scheduler == "yes" %}
|
|
58
|
+
|
|
59
|
+
logs-scheduler: ## Follow scheduler logs only
|
|
60
|
+
@echo "๐ Following scheduler logs..."
|
|
61
|
+
@docker compose logs -f scheduler{% endif %}
|
|
62
|
+
|
|
63
|
+
shell: ## Open shell in webserver container
|
|
64
|
+
@echo "๐ Opening shell in webserver container..."
|
|
65
|
+
@docker compose exec webserver /bin/bash
|
|
66
|
+
|
|
67
|
+
shell-worker: ## Open shell in worker container
|
|
68
|
+
@echo "๐ Opening shell in worker container..."
|
|
69
|
+
@docker compose exec worker-system /bin/bash
|
|
70
|
+
|
|
71
|
+
ps: ## Show running containers
|
|
72
|
+
@echo "๐ Docker containers status:"
|
|
73
|
+
@docker compose ps
|
|
74
|
+
|
|
75
|
+
#=============================================================================
|
|
76
|
+
# REDIS DEBUGGING
|
|
77
|
+
#=============================================================================
|
|
78
|
+
|
|
79
|
+
redis-cli: ## Connect to Redis CLI
|
|
80
|
+
@echo "๐ง Connecting to Redis CLI..."
|
|
81
|
+
@docker compose exec redis redis-cli
|
|
82
|
+
|
|
83
|
+
redis-stats: ## Show Redis memory and stats
|
|
84
|
+
@echo "๐ Redis statistics:"
|
|
85
|
+
@docker compose exec redis redis-cli info memory
|
|
86
|
+
|
|
87
|
+
redis-keys: ## Show all Redis keys
|
|
88
|
+
@echo "๐ Redis keys:"
|
|
89
|
+
@docker compose exec redis redis-cli keys "*"
|
|
90
|
+
|
|
91
|
+
redis-reset: ## Clear all Redis data
|
|
92
|
+
@echo "๐ Clearing all Redis data..."
|
|
93
|
+
@docker compose exec redis redis-cli flushall
|
|
94
|
+
|
|
95
|
+
#=============================================================================
|
|
96
|
+
# HEALTH AND TESTING
|
|
97
|
+
#=============================================================================
|
|
98
|
+
|
|
99
|
+
health: ## Check system health status
|
|
100
|
+
@echo "๐ฉบ Checking system health..."
|
|
101
|
+
@uv run {{ cookiecutter.project_slug }} health status
|
|
102
|
+
|
|
103
|
+
health-detailed: ## Detailed system health information
|
|
104
|
+
@echo "๐ฉบ Detailed system health..."
|
|
105
|
+
@uv run {{ cookiecutter.project_slug }} health status --detailed
|
|
106
|
+
|
|
107
|
+
health-json: ## System health as JSON
|
|
108
|
+
@uv run {{ cookiecutter.project_slug }} health status --json
|
|
109
|
+
|
|
110
|
+
health-probe: ## Health probe (exits 1 if unhealthy)
|
|
111
|
+
@uv run {{ cookiecutter.project_slug }} health probe
|
|
112
|
+
|
|
113
|
+
test: ## Run tests locally
|
|
114
|
+
@echo "๐งช Running tests..."
|
|
115
|
+
@uv run pytest
|
|
116
|
+
|
|
117
|
+
test-verbose: ## Run tests with verbose output
|
|
118
|
+
@echo "๐งช Running tests (verbose)..."
|
|
119
|
+
@uv run pytest -v
|
|
120
|
+
|
|
121
|
+
#=============================================================================
|
|
122
|
+
# CODE QUALITY (local development tools)
|
|
123
|
+
#=============================================================================
|
|
124
|
+
|
|
125
|
+
lint: ## Check code style with ruff
|
|
126
|
+
@echo "๐ Running linting..."
|
|
127
|
+
@uv run ruff check .
|
|
128
|
+
|
|
129
|
+
fix: ## Auto-fix linting and formatting issues
|
|
130
|
+
@echo "๐ง Auto-fixing code issues..."
|
|
131
|
+
@uv run ruff check . --fix
|
|
132
|
+
@uv run ruff format .
|
|
133
|
+
|
|
134
|
+
format: ## Format code with ruff
|
|
135
|
+
@echo "๐ Formatting code..."
|
|
136
|
+
@uv run ruff format .
|
|
137
|
+
|
|
138
|
+
typecheck: ## Run type checking with mypy
|
|
139
|
+
@echo "๐ Running type checking..."
|
|
140
|
+
@uv run mypy app/ --no-error-summary
|
|
141
|
+
|
|
142
|
+
check: lint typecheck test ## Run all code quality checks
|
|
143
|
+
@echo "โ
All checks completed successfully!"
|
|
144
|
+
|
|
145
|
+
#=============================================================================
|
|
146
|
+
# PROJECT MANAGEMENT
|
|
147
|
+
#=============================================================================
|
|
148
|
+
|
|
149
|
+
install: ## Install/sync dependencies with uv
|
|
150
|
+
@echo "๐ฆ Installing dependencies..."
|
|
151
|
+
@uv sync --all-extras
|
|
152
|
+
|
|
153
|
+
deps-update: ## Update dependencies
|
|
154
|
+
@echo "๐ฆ Updating dependencies..."
|
|
155
|
+
@uv sync --upgrade
|
|
156
|
+
|
|
157
|
+
clean-cache: ## Clean Python cache files
|
|
158
|
+
@echo "๐งน Cleaning Python cache files..."
|
|
159
|
+
@find . -type d -name "__pycache__" -exec rm -rf {} +
|
|
160
|
+
@find . -type f -name "*.pyc" -delete
|
|
161
|
+
|
|
162
|
+
#=============================================================================
|
|
163
|
+
# DOCUMENTATION
|
|
164
|
+
#=============================================================================
|
|
165
|
+
|
|
166
|
+
docs-serve: ## Serve documentation locally (http://localhost:8001)
|
|
167
|
+
@echo "๐ Serving documentation on http://localhost:8001"
|
|
168
|
+
@uv run mkdocs serve --dev-addr 0.0.0.0:8001
|
|
169
|
+
|
|
170
|
+
docs-build: ## Build static documentation
|
|
171
|
+
@echo "๐ Building documentation..."
|
|
172
|
+
@uv run mkdocs build
|
|
173
|
+
|
|
174
|
+
#=============================================================================
|
|
175
|
+
# WORKER DEBUGGING (arq)
|
|
176
|
+
#=============================================================================
|
|
177
|
+
|
|
178
|
+
worker-test: ## Test workers in burst mode (process and exit)
|
|
179
|
+
@echo "๐งช Testing system worker in burst mode..."
|
|
180
|
+
@uv run python -m arq app.components.worker.queues.system.WorkerSettings --burst
|
|
181
|
+
|
|
182
|
+
#=============================================================================
|
|
183
|
+
# HELP AND INFO
|
|
184
|
+
#=============================================================================
|
|
185
|
+
|
|
186
|
+
status: ## Show current system status
|
|
187
|
+
@echo "๐ Current system status:"
|
|
188
|
+
@echo
|
|
189
|
+
@echo "๐ณ Docker containers:"
|
|
190
|
+
@docker compose ps || echo "No containers running"
|
|
191
|
+
@echo
|
|
192
|
+
@echo "๐ฆ Dependencies:"
|
|
193
|
+
@uv pip list | head -20 || echo "Dependencies not installed"
|
|
194
|
+
|
|
195
|
+
help: ## Show this help message
|
|
196
|
+
@echo "{{ cookiecutter.project_name }} development commands:"
|
|
197
|
+
@echo
|
|
198
|
+
@echo "๐ WORKFLOW COMMANDS (start here):"
|
|
199
|
+
@echo " make refresh - Nuclear reset (clean + build + serve)"
|
|
200
|
+
@echo " make rebuild - Build and serve"
|
|
201
|
+
@echo " make restart - Quick restart"
|
|
202
|
+
@echo
|
|
203
|
+
@echo "๐ง CORE COMMANDS:"
|
|
204
|
+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
|
205
|
+
@echo
|
|
206
|
+
@echo "๐ก TIP: Use 'make refresh' when everything is broken!"
|
|
207
|
+
|
|
208
|
+
.PHONY: build serve stop clean rebuild refresh restart logs logs-web logs-worker logs-redis{% if cookiecutter.include_scheduler == "yes" %} logs-scheduler{% endif %} shell shell-worker ps redis-cli redis-stats redis-keys redis-reset health health-detailed health-json health-probe test test-verbose lint fix format typecheck check install deps-update clean-cache docs-serve docs-build worker-test status help
|
|
209
|
+
|
|
210
|
+
# Default target - show help
|
|
211
|
+
.DEFAULT_GOAL := help
|