django-ray 0.1.0__tar.gz

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.
Files changed (116) hide show
  1. django_ray-0.1.0/.dockerignore +62 -0
  2. django_ray-0.1.0/.github/workflows/ci.yml +109 -0
  3. django_ray-0.1.0/.github/workflows/release.yml +139 -0
  4. django_ray-0.1.0/.gitignore +28 -0
  5. django_ray-0.1.0/.python-version +1 -0
  6. django_ray-0.1.0/Dockerfile +99 -0
  7. django_ray-0.1.0/Dockerfile.dev +49 -0
  8. django_ray-0.1.0/Dockerfile.ray +34 -0
  9. django_ray-0.1.0/LICENSE +29 -0
  10. django_ray-0.1.0/Makefile +171 -0
  11. django_ray-0.1.0/PKG-INFO +303 -0
  12. django_ray-0.1.0/README.md +272 -0
  13. django_ray-0.1.0/docker-entrypoint.sh +109 -0
  14. django_ray-0.1.0/docs/architecture.md +217 -0
  15. django_ray-0.1.0/docs/changelog.md +55 -0
  16. django_ray-0.1.0/docs/configuration.md +118 -0
  17. django_ray-0.1.0/docs/contributing.md +203 -0
  18. django_ray-0.1.0/docs/deployment/docker.md +167 -0
  19. django_ray-0.1.0/docs/deployment/kubernetes.md +308 -0
  20. django_ray-0.1.0/docs/deployment/tls.md +237 -0
  21. django_ray-0.1.0/docs/getting-started.md +160 -0
  22. django_ray-0.1.0/docs/index.md +43 -0
  23. django_ray-0.1.0/docs/queues.md +232 -0
  24. django_ray-0.1.0/docs/reference/api.md +71 -0
  25. django_ray-0.1.0/docs/reference/cli.md +95 -0
  26. django_ray-0.1.0/docs/reference/settings.md +246 -0
  27. django_ray-0.1.0/docs/retry.md +297 -0
  28. django_ray-0.1.0/docs/tasks.md +269 -0
  29. django_ray-0.1.0/docs/worker-modes.md +178 -0
  30. django_ray-0.1.0/k8s/README.md +292 -0
  31. django_ray-0.1.0/k8s/base/configmap.yaml +19 -0
  32. django_ray-0.1.0/k8s/base/django-ray-worker.yaml +77 -0
  33. django_ray-0.1.0/k8s/base/django-setup-job.yaml +56 -0
  34. django_ray-0.1.0/k8s/base/django-web.yaml +134 -0
  35. django_ray-0.1.0/k8s/base/kustomization.yaml +29 -0
  36. django_ray-0.1.0/k8s/base/monitoring.yaml +859 -0
  37. django_ray-0.1.0/k8s/base/namespace.yaml +8 -0
  38. django_ray-0.1.0/k8s/base/postgres.yaml +84 -0
  39. django_ray-0.1.0/k8s/base/ray-cluster.yaml +242 -0
  40. django_ray-0.1.0/k8s/base/ray-tls-secret.yaml +42 -0
  41. django_ray-0.1.0/k8s/base/ray_data_dashboard.json +0 -0
  42. django_ray-0.1.0/k8s/base/ray_default_dashboard.json +0 -0
  43. django_ray-0.1.0/k8s/base/secret.yaml +23 -0
  44. django_ray-0.1.0/k8s/overlays/dev/kustomization.yaml +67 -0
  45. django_ray-0.1.0/k8s/overlays/dev/worker-all-queues.yaml +60 -0
  46. django_ray-0.1.0/k8s/overlays/dev/worker-ml.yaml +62 -0
  47. django_ray-0.1.0/k8s/overlays/dev-tls/kustomization.yaml +133 -0
  48. django_ray-0.1.0/k8s/overlays/dev-tls/ray-tls-secret.yaml +30 -0
  49. django_ray-0.1.0/k8s/overlays/local/kustomization.yaml +172 -0
  50. django_ray-0.1.0/locustfile.py +614 -0
  51. django_ray-0.1.0/mk/docker.mk +25 -0
  52. django_ray-0.1.0/mk/k8s.mk +111 -0
  53. django_ray-0.1.0/mk/loadtest.mk +24 -0
  54. django_ray-0.1.0/mk/tls.mk +24 -0
  55. django_ray-0.1.0/pyproject.toml +124 -0
  56. django_ray-0.1.0/scripts/generate-ray-tls-certs.sh +127 -0
  57. django_ray-0.1.0/scripts/import_dashboards.py +74 -0
  58. django_ray-0.1.0/scripts/test_ray_cluster.py +217 -0
  59. django_ray-0.1.0/src/django_ray/__init__.py +6 -0
  60. django_ray-0.1.0/src/django_ray/admin.py +461 -0
  61. django_ray-0.1.0/src/django_ray/apps.py +23 -0
  62. django_ray-0.1.0/src/django_ray/backends.py +313 -0
  63. django_ray-0.1.0/src/django_ray/conf/__init__.py +10 -0
  64. django_ray-0.1.0/src/django_ray/conf/defaults.py +27 -0
  65. django_ray-0.1.0/src/django_ray/conf/settings.py +67 -0
  66. django_ray-0.1.0/src/django_ray/logging.py +148 -0
  67. django_ray-0.1.0/src/django_ray/management/__init__.py +1 -0
  68. django_ray-0.1.0/src/django_ray/management/commands/__init__.py +1 -0
  69. django_ray-0.1.0/src/django_ray/management/commands/django_ray_worker.py +1186 -0
  70. django_ray-0.1.0/src/django_ray/migrations/0001_initial.py +214 -0
  71. django_ray-0.1.0/src/django_ray/migrations/__init__.py +1 -0
  72. django_ray-0.1.0/src/django_ray/models.py +217 -0
  73. django_ray-0.1.0/src/django_ray/runner/__init__.py +14 -0
  74. django_ray-0.1.0/src/django_ray/runner/base.py +100 -0
  75. django_ray-0.1.0/src/django_ray/runner/cancellation.py +64 -0
  76. django_ray-0.1.0/src/django_ray/runner/leasing.py +155 -0
  77. django_ray-0.1.0/src/django_ray/runner/ray_core.py +324 -0
  78. django_ray-0.1.0/src/django_ray/runner/ray_job.py +117 -0
  79. django_ray-0.1.0/src/django_ray/runner/reconciliation.py +101 -0
  80. django_ray-0.1.0/src/django_ray/runner/retry.py +92 -0
  81. django_ray-0.1.0/src/django_ray/runtime/__init__.py +16 -0
  82. django_ray-0.1.0/src/django_ray/runtime/distributed.py +300 -0
  83. django_ray-0.1.0/src/django_ray/runtime/entrypoint.py +85 -0
  84. django_ray-0.1.0/src/django_ray/runtime/import_utils.py +51 -0
  85. django_ray-0.1.0/src/django_ray/runtime/serialization.py +46 -0
  86. django_ray-0.1.0/testproject/__init__.py +1 -0
  87. django_ray-0.1.0/testproject/api.py +965 -0
  88. django_ray-0.1.0/testproject/apps/__init__.py +20 -0
  89. django_ray-0.1.0/testproject/apps/cluster_tasks/__init__.py +18 -0
  90. django_ray-0.1.0/testproject/apps/cluster_tasks/tasks.py +375 -0
  91. django_ray-0.1.0/testproject/apps/local_ray/__init__.py +13 -0
  92. django_ray-0.1.0/testproject/apps/local_ray/tasks.py +480 -0
  93. django_ray-0.1.0/testproject/apps/ml_pipeline/__init__.py +19 -0
  94. django_ray-0.1.0/testproject/apps/ml_pipeline/tasks.py +351 -0
  95. django_ray-0.1.0/testproject/apps/sync_tasks/__init__.py +13 -0
  96. django_ray-0.1.0/testproject/apps/sync_tasks/tasks.py +103 -0
  97. django_ray-0.1.0/testproject/asgi.py +9 -0
  98. django_ray-0.1.0/testproject/manage.py +37 -0
  99. django_ray-0.1.0/testproject/settings.py +154 -0
  100. django_ray-0.1.0/testproject/tasks.py +118 -0
  101. django_ray-0.1.0/testproject/urls.py +11 -0
  102. django_ray-0.1.0/testproject/wsgi.py +9 -0
  103. django_ray-0.1.0/tests/__init__.py +1 -0
  104. django_ray-0.1.0/tests/conftest.py +60 -0
  105. django_ray-0.1.0/tests/integration/__init__.py +1 -0
  106. django_ray-0.1.0/tests/integration/test_api.py +305 -0
  107. django_ray-0.1.0/tests/integration/test_task_execution.py +219 -0
  108. django_ray-0.1.0/tests/integration/test_worker.py +400 -0
  109. django_ray-0.1.0/tests/unit/__init__.py +1 -0
  110. django_ray-0.1.0/tests/unit/test_distributed.py +171 -0
  111. django_ray-0.1.0/tests/unit/test_import_utils.py +39 -0
  112. django_ray-0.1.0/tests/unit/test_leasing.py +363 -0
  113. django_ray-0.1.0/tests/unit/test_logging.py +84 -0
  114. django_ray-0.1.0/tests/unit/test_serialization.py +48 -0
  115. django_ray-0.1.0/tests/unit/test_settings.py +55 -0
  116. django_ray-0.1.0/uv.lock +2416 -0
@@ -0,0 +1,62 @@
1
+ # Docker ignore file for django-ray
2
+ # Exclude files not needed in Docker builds
3
+
4
+ # Git
5
+ .git/
6
+ .gitignore
7
+ .github/
8
+
9
+ # IDE
10
+ .idea/
11
+ .vscode/
12
+ *.swp
13
+ *.swo
14
+
15
+ # Python cache
16
+ __pycache__/
17
+ *.py[cod]
18
+ *$py.class
19
+ *.so
20
+ .Python
21
+
22
+ # Virtual environments
23
+ .venv/
24
+ venv/
25
+ ENV/
26
+
27
+ # Build artifacts
28
+ *.egg-info/
29
+ dist/
30
+ build/
31
+ .eggs/
32
+
33
+ # Testing
34
+ .pytest_cache/
35
+ .coverage
36
+ htmlcov/
37
+ coverage.xml
38
+ *.cover
39
+
40
+ # Linting/Type checking
41
+ .ruff_cache/
42
+ .mypy_cache/
43
+
44
+ # Database (use volume mount or external DB in production)
45
+ *.sqlite3
46
+
47
+ # Documentation
48
+ docs/_build/
49
+ adr/
50
+
51
+ # Scripts (not needed in container)
52
+ scripts/
53
+
54
+ # Lock file included for reproducible builds
55
+ # uv.lock
56
+
57
+ # Kubernetes manifests
58
+ k8s/
59
+
60
+ # CI/CD
61
+ .github/
62
+
@@ -0,0 +1,109 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Lint & Format
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v4
18
+ with:
19
+ version: "latest"
20
+
21
+ - name: Set up Python
22
+ run: uv python install 3.12
23
+
24
+ - name: Install dependencies
25
+ run: uv sync --frozen
26
+
27
+ - name: Check formatting
28
+ run: uv run ruff format --check .
29
+
30
+ - name: Check linting
31
+ run: uv run ruff check .
32
+
33
+ typecheck:
34
+ name: Type Check
35
+ runs-on: ubuntu-latest
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: Install uv
40
+ uses: astral-sh/setup-uv@v4
41
+ with:
42
+ version: "latest"
43
+
44
+ - name: Set up Python
45
+ run: uv python install 3.12
46
+
47
+ - name: Install dependencies
48
+ run: uv sync --frozen
49
+
50
+ - name: Type check
51
+ run: uv run ty check
52
+
53
+ test:
54
+ name: Test (Python ${{ matrix.python-version }})
55
+ runs-on: ubuntu-latest
56
+ strategy:
57
+ fail-fast: false
58
+ matrix:
59
+ python-version: ["3.12", "3.13"]
60
+ steps:
61
+ - uses: actions/checkout@v4
62
+
63
+ - name: Install uv
64
+ uses: astral-sh/setup-uv@v4
65
+ with:
66
+ version: "latest"
67
+
68
+ - name: Set up Python ${{ matrix.python-version }}
69
+ run: uv python install ${{ matrix.python-version }}
70
+
71
+ - name: Install dependencies
72
+ run: uv sync --frozen
73
+
74
+ - name: Run tests
75
+ run: uv run pytest --cov=src --cov-report=xml --cov-report=term -v
76
+
77
+ - name: Upload coverage to Codecov
78
+ if: matrix.python-version == '3.12'
79
+ uses: codecov/codecov-action@v4
80
+ with:
81
+ files: ./coverage.xml
82
+ fail_ci_if_error: false
83
+ env:
84
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
85
+
86
+ build:
87
+ name: Build Package
88
+ runs-on: ubuntu-latest
89
+ needs: [lint, typecheck, test]
90
+ steps:
91
+ - uses: actions/checkout@v4
92
+
93
+ - name: Install uv
94
+ uses: astral-sh/setup-uv@v4
95
+ with:
96
+ version: "latest"
97
+
98
+ - name: Set up Python
99
+ run: uv python install 3.12
100
+
101
+ - name: Build package
102
+ run: uv build
103
+
104
+ - name: Upload dist artifacts
105
+ uses: actions/upload-artifact@v4
106
+ with:
107
+ name: dist
108
+ path: dist/
109
+
@@ -0,0 +1,139 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ version:
10
+ description: "Version to release (e.g., 0.1.0)"
11
+ required: true
12
+ type: string
13
+
14
+ jobs:
15
+ build:
16
+ name: Build Package
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+ with:
24
+ version: "latest"
25
+
26
+ - name: Set up Python
27
+ run: uv python install 3.12
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --frozen
31
+
32
+ - name: Build package
33
+ run: uv build
34
+
35
+ - name: Upload dist artifacts
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: dist
39
+ path: dist/
40
+
41
+ test:
42
+ name: Test Built Package
43
+ runs-on: ubuntu-latest
44
+ needs: build
45
+ strategy:
46
+ matrix:
47
+ python-version: ["3.12", "3.13"]
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+
51
+ - name: Install uv
52
+ uses: astral-sh/setup-uv@v4
53
+ with:
54
+ version: "latest"
55
+
56
+ - name: Set up Python ${{ matrix.python-version }}
57
+ run: uv python install ${{ matrix.python-version }}
58
+
59
+ - name: Download dist artifacts
60
+ uses: actions/download-artifact@v4
61
+ with:
62
+ name: dist
63
+ path: dist/
64
+
65
+ - name: Create venv and install built package
66
+ run: |
67
+ uv venv --python ${{ matrix.python-version }}
68
+ uv pip install dist/*.whl
69
+
70
+ - name: Verify import
71
+ run: |
72
+ uv run python -c "import django_ray; print('django-ray imported successfully')"
73
+
74
+ publish-testpypi:
75
+ name: Publish to TestPyPI
76
+ runs-on: ubuntu-latest
77
+ needs: [build, test]
78
+ if: github.event_name == 'workflow_dispatch'
79
+ environment:
80
+ name: testpypi
81
+ url: https://test.pypi.org/p/django-ray
82
+ permissions:
83
+ id-token: write
84
+ steps:
85
+ - name: Download dist artifacts
86
+ uses: actions/download-artifact@v4
87
+ with:
88
+ name: dist
89
+ path: dist/
90
+
91
+ - name: Publish to TestPyPI
92
+ uses: pypa/gh-action-pypi-publish@release/v1
93
+ with:
94
+ repository-url: https://test.pypi.org/legacy/
95
+
96
+ publish-pypi:
97
+ name: Publish to PyPI
98
+ runs-on: ubuntu-latest
99
+ needs: [build, test]
100
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
101
+ environment:
102
+ name: pypi
103
+ url: https://pypi.org/p/django-ray
104
+ permissions:
105
+ id-token: write
106
+ steps:
107
+ - name: Download dist artifacts
108
+ uses: actions/download-artifact@v4
109
+ with:
110
+ name: dist
111
+ path: dist/
112
+
113
+ - name: Publish to PyPI
114
+ uses: pypa/gh-action-pypi-publish@release/v1
115
+
116
+ github-release:
117
+ name: Create GitHub Release
118
+ runs-on: ubuntu-latest
119
+ needs: publish-pypi
120
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
121
+ permissions:
122
+ contents: write
123
+ steps:
124
+ - uses: actions/checkout@v4
125
+
126
+ - name: Download dist artifacts
127
+ uses: actions/download-artifact@v4
128
+ with:
129
+ name: dist
130
+ path: dist/
131
+
132
+ - name: Create GitHub Release
133
+ uses: softprops/action-gh-release@v1
134
+ with:
135
+ files: dist/*
136
+ generate_release_notes: true
137
+ draft: false
138
+ prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
139
+
@@ -0,0 +1,28 @@
1
+ # Django-Ray Development Files
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ .env
9
+ .venv
10
+ venv/
11
+ .pytest_cache/
12
+ .ruff_cache/
13
+ .mypy_cache/
14
+ .pyright/
15
+ *.log
16
+ .coverage
17
+ coverage.xml
18
+ htmlcov/
19
+ .idea/
20
+ .vscode/
21
+
22
+ # Django development database
23
+ db.sqlite3
24
+ *.sqlite3
25
+
26
+ # UV lock (optional - uncomment if you don't want to commit lock file)
27
+ # uv.lock
28
+
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,99 @@
1
+ # syntax=docker/dockerfile:1
2
+ # Django-Ray Docker Image
3
+ # Multi-stage build for optimized production image
4
+ #
5
+ # Usage:
6
+ # docker run django-ray web # Production web server (gunicorn)
7
+ # docker run django-ray web-dev # Development web server
8
+ # docker run django-ray worker # Django-Ray task worker (local Ray)
9
+ # docker run django-ray worker-cluster # Worker connecting to Ray cluster
10
+ # docker run django-ray migrate # Run migrations
11
+ # docker run django-ray shell # Django shell
12
+
13
+ ARG PYTHON_VERSION=3.12
14
+
15
+ # =============================================================================
16
+ # Stage 1: Build stage - install dependencies
17
+ # =============================================================================
18
+ FROM python:${PYTHON_VERSION}-slim AS builder
19
+
20
+ # Install uv for fast dependency management
21
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
22
+
23
+ # Set environment variables
24
+ ENV PYTHONDONTWRITEBYTECODE=1 \
25
+ PYTHONUNBUFFERED=1 \
26
+ UV_COMPILE_BYTECODE=1 \
27
+ UV_LINK_MODE=copy
28
+
29
+ WORKDIR /app
30
+
31
+ # Copy dependency files
32
+ COPY pyproject.toml uv.lock ./
33
+
34
+ # Install dependencies with postgres support
35
+ # Note: We include dev dependencies because testproject requires django-ninja and whitenoise
36
+ RUN --mount=type=cache,target=/root/.cache/uv \
37
+ uv sync --frozen --no-install-project --extra postgres
38
+
39
+ # Copy source code
40
+ COPY src/ src/
41
+ COPY testproject/ testproject/
42
+ COPY README.md ./
43
+
44
+ # Install the project itself
45
+ RUN --mount=type=cache,target=/root/.cache/uv \
46
+ uv sync --frozen --extra postgres
47
+
48
+ # Install gunicorn for production
49
+ RUN --mount=type=cache,target=/root/.cache/uv \
50
+ uv pip install gunicorn
51
+
52
+ # =============================================================================
53
+ # Stage 2: Runtime stage - minimal production image
54
+ # =============================================================================
55
+ FROM python:${PYTHON_VERSION}-slim AS runtime
56
+
57
+ # Create non-root user for security
58
+ RUN groupadd --gid 1000 django && \
59
+ useradd --uid 1000 --gid django --shell /bin/bash --create-home django
60
+
61
+ # Set environment variables
62
+ ENV PYTHONDONTWRITEBYTECODE=1 \
63
+ PYTHONUNBUFFERED=1 \
64
+ PATH="/app/.venv/bin:$PATH" \
65
+ DJANGO_SETTINGS_MODULE="testproject.settings"
66
+
67
+ WORKDIR /app
68
+
69
+ # Copy virtual environment from builder
70
+ COPY --from=builder --chown=django:django /app/.venv /app/.venv
71
+
72
+ # Copy application code
73
+ COPY --chown=django:django src/ src/
74
+ COPY --chown=django:django testproject/ testproject/
75
+
76
+ # Create staticfiles directory with proper permissions
77
+ RUN mkdir -p /app/staticfiles && chown django:django /app/staticfiles
78
+
79
+ # Copy and set up entrypoint script
80
+ COPY --chown=django:django docker-entrypoint.sh /app/
81
+ RUN chmod +x /app/docker-entrypoint.sh
82
+
83
+ # Switch to non-root user
84
+ USER django
85
+
86
+ # Expose ports
87
+ # 8000 - Django web server
88
+ EXPOSE 8000
89
+
90
+ # Health check
91
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
92
+ CMD python -c "import django; django.setup()" || exit 1
93
+
94
+ # Entrypoint handles different modes
95
+ ENTRYPOINT ["/app/docker-entrypoint.sh"]
96
+
97
+ # Default mode is production web server
98
+ CMD ["web"]
99
+
@@ -0,0 +1,49 @@
1
+ # Django-Ray Docker Image (Development)
2
+ # Includes dev dependencies and tools for testing
3
+
4
+ ARG PYTHON_VERSION=3.12
5
+
6
+ FROM python:${PYTHON_VERSION}-slim
7
+
8
+ # Install system dependencies
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ curl \
11
+ git \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Install uv for fast dependency management
15
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
16
+
17
+ # Set environment variables
18
+ ENV PYTHONDONTWRITEBYTECODE=1 \
19
+ PYTHONUNBUFFERED=1 \
20
+ UV_COMPILE_BYTECODE=1 \
21
+ UV_LINK_MODE=copy \
22
+ PATH="/app/.venv/bin:$PATH" \
23
+ DJANGO_SETTINGS_MODULE="testproject.settings"
24
+
25
+ WORKDIR /app
26
+
27
+ # Copy dependency files
28
+ COPY pyproject.toml uv.lock ./
29
+
30
+ # Install ALL dependencies including dev
31
+ RUN --mount=type=cache,target=/root/.cache/uv \
32
+ uv sync --frozen --no-install-project
33
+
34
+ # Copy source code
35
+ COPY src/ src/
36
+ COPY testproject/ testproject/
37
+ COPY tests/ tests/
38
+ COPY README.md ./
39
+
40
+ # Install the project itself
41
+ RUN --mount=type=cache,target=/root/.cache/uv \
42
+ uv sync --frozen
43
+
44
+ # Expose ports
45
+ EXPOSE 8000 6379 8265
46
+
47
+ # Default command - run tests
48
+ CMD ["pytest", "-v"]
49
+
@@ -0,0 +1,34 @@
1
+ # Ray Worker Image with django-ray installed
2
+ # This image is used for Ray head and workers so they can execute django-ray tasks
3
+ #
4
+ # Build: docker build -f Dockerfile.ray -t django-ray-worker:latest .
5
+
6
+ ARG RAY_VERSION=2.53.0
7
+ ARG PYTHON_VERSION=py312
8
+
9
+ FROM rayproject/ray:${RAY_VERSION}-${PYTHON_VERSION}
10
+
11
+ # Install uv for fast dependency management
12
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
13
+
14
+ WORKDIR /app
15
+
16
+ # Copy dependency files
17
+ COPY pyproject.toml uv.lock ./
18
+
19
+ # Copy source code
20
+ COPY src/ src/
21
+ COPY testproject/ testproject/
22
+ COPY README.md ./
23
+
24
+ # Install django-ray and dependencies using uv
25
+ # Include postgres for database driver, plus testproject dependencies
26
+ RUN uv pip install --system -e ".[postgres]" django-ninja whitenoise --no-cache-dir
27
+
28
+ # Set environment variables
29
+ ENV DJANGO_SETTINGS_MODULE=testproject.settings \
30
+ PYTHONPATH=/app/src:/app
31
+
32
+ # Verify installation
33
+ RUN python -c "import django_ray; import psycopg; import ninja; print('django-ray and dependencies installed successfully')"
34
+
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Dariusz Panas
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.