Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

feat: Reload support for backend, changes to entrypoint script (#1100)

Chandrasekharan M019ab7f7ab3e
diff --git a/.gitignore b/.gitignore
index 0f029490b..a7588844a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -636,6 +636,7 @@ docker/*.env
!docker/sample*.env
docker/public_tools.json
docker/proxy_overrides.yaml
+docker/compose.override.yaml
docker/workflow_data/
# Tool development
diff --git a/backend/README.md b/backend/README.md
index 8f8cbc330..87e970ec5 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -39,6 +39,8 @@ pdm install --dev -G lint
pdm install --prod --no-editable
```
+#### Running scripts
+
PDM allows you to run scripts applicable within the service dir.
```bash
@@ -46,6 +48,12 @@ PDM allows you to run scripts applicable within the service dir.
pdm run -l
```
+For example to run the backend (dev mode is recommended to take advantage of gunicorn's `reload` feature)
+
+```bash
+pdm run backend --dev
+```
+
#### Running commands
- If you plan to run the django server locally, make sure the dependent services are up (either locally or through docker compose)
diff --git a/backend/backend/wsgi.py b/backend/backend/wsgi.py
index 9a654eb50..ff41a40b0 100644
--- a/backend/backend/wsgi.py
+++ b/backend/backend/wsgi.py
@@ -6,7 +6,9 @@ For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
"""
+import logging
import os
+import time
from django.conf import settings
from django.core.wsgi import get_wsgi_application
@@ -15,11 +17,17 @@ from utils.log_events import start_server
load_dotenv()
+logger = logging.getLogger(__name__)
+
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE",
os.environ.get("DJANGO_SETTINGS_MODULE", "backend.settings.dev"),
)
+wsgi_start_time = time.perf_counter()
django_app = get_wsgi_application()
+wsgi_init_elapsed = time.perf_counter() - wsgi_start_time
+logger.info(f"WSGI application initialized in {wsgi_init_elapsed:.3f} seconds")
+
application = start_server(django_app, f"{settings.PATH_PREFIX}/socket")
diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh
index 686755124..5d44345fd 100755
--- a/backend/entrypoint.sh
+++ b/backend/entrypoint.sh
@@ -1,19 +1,50 @@
#!/usr/bin/env bash
-cmd=$1
-if [ "$cmd" = "migrate" ]; then
+show_help() {
+ echo "Usage: ./entrypoint.sh [OPTIONS]"
+ echo ""
+ echo "Options:"
+ echo " --migrate Perform database migrations before starting the server."
+ echo " --dev Run Gunicorn in development mode with --reload and reduced graceful timeout (5s)."
+ echo " --help, -h Show this help message and exit."
+}
+
+# Parse arguments
+migrate=false
+dev=false
+
+while [[ "$#" -gt 0 ]]; do
+ case $1 in
+ --migrate) migrate=true ;;
+ --dev) dev=true ;;
+ --help|-h) show_help; exit 0 ;;
+ *) echo "Unknown argument: $1"; exit 1 ;;
+ esac
+ shift
+done
+
+# Perform database migration if --migrate is provided
+if [ "$migrate" = true ]; then
echo "Migration initiated"
.venv/bin/python manage.py migrate
fi
-# NOTE: Leaving below for reference incase required in the future
-# python manage.py runserver 0.0.0.0:8000 --insecure
-# NOTE updated socket threads
-.venv/bin/gunicorn \
- --bind 0.0.0.0:8000 \
- --workers 2 \
- --threads 2 \
- --log-level debug \
- --timeout 600 \
- --access-logfile - \
- backend.wsgi:application
+# Configure Gunicorn based on --dev flag
+gunicorn_args=(
+ --bind 0.0.0.0:8000
+ --workers 2
+ --threads 2
+ --log-level debug
+ --timeout 600
+ --access-logfile -
+)
+
+if [ "$dev" = true ]; then
+ echo "Running in development mode"
+ gunicorn_args+=(--reload --graceful-timeout 5)
+else
+ echo "Running in production mode"
+fi
+
+# Start Gunicorn
+.venv/bin/gunicorn "${gunicorn_args[@]}" backend.wsgi:application
diff --git a/backend/pdm.lock b/backend/pdm.lock
index c9b2ee969..d8642f357 100644
--- a/backend/pdm.lock
+++ b/backend/pdm.lock
@@ -5,7 +5,7 @@
groups = ["default", "deploy", "dev", "test"]
strategy = ["cross_platform", "inherit_metadata"]
lock_version = "4.4.2"
-content_hash = "sha256:91a2107cba5ace82af1ff886802662781f7736cb1c414561d6de9b4b4c3f77d4"
+content_hash = "sha256:238a337bae984c303a07a897f701bb3f6467d25a419f4979fb867b44ea00d124"
[[package]]
name = "adlfs"
@@ -190,7 +190,7 @@ files = [
[[package]]
name = "anthropic"
-version = "0.45.0"
+version = "0.45.2"
requires_python = ">=3.8"
summary = "The official Python library for the anthropic API"
groups = ["default", "dev"]
@@ -204,26 +204,26 @@ dependencies = [
"typing-extensions<5,>=4.10",
]
files = [
- {file = "anthropic-0.45.0-py3-none-any.whl", hash = "sha256:f36aff71d2c232945e64d1970be68a91b05a2ef5e3afa6c1ff195c3303a95ad3"},
- {file = "anthropic-0.45.0.tar.gz", hash = "sha256:4e8541dc355332090bfc51b84549c19b649a13a23dbd6bd68e1d012e08551025"},
+ {file = "anthropic-0.45.2-py3-none-any.whl", hash = "sha256:ecd746f7274451dfcb7e1180571ead624c7e1195d1d46cb7c70143d2aedb4d35"},
+ {file = "anthropic-0.45.2.tar.gz", hash = "sha256:32a18b9ecd12c91b2be4cae6ca2ab46a06937b5aa01b21308d97a6d29794fb5e"},
]
[[package]]
name = "anthropic"
-version = "0.45.0"
+version = "0.45.2"
extras = ["bedrock", "vertex"]
requires_python = ">=3.8"
summary = "The official Python library for the anthropic API"
groups = ["default", "dev"]
dependencies = [
- "anthropic==0.45.0",
+ "anthropic==0.45.2",
"boto3>=1.28.57",
"botocore>=1.31.57",
"google-auth<3,>=2",
]
files = [
- {file = "anthropic-0.45.0-py3-none-any.whl", hash = "sha256:f36aff71d2c232945e64d1970be68a91b05a2ef5e3afa6c1ff195c3303a95ad3"},
- {file = "anthropic-0.45.0.tar.gz", hash = "sha256:4e8541dc355332090bfc51b84549c19b649a13a23dbd6bd68e1d012e08551025"},
+ {file = "anthropic-0.45.2-py3-none-any.whl", hash = "sha256:ecd746f7274451dfcb7e1180571ead624c7e1195d1d46cb7c70143d2aedb4d35"},
+ {file = "anthropic-0.45.2.tar.gz", hash = "sha256:32a18b9ecd12c91b2be4cae6ca2ab46a06937b5aa01b21308d97a6d29794fb5e"},
]
[[package]]
@@ -1383,7 +1383,7 @@ files = [
[[package]]
name = "google-api-core"
-version = "2.24.1rc1"
+version = "2.24.1"
requires_python = ">=3.7"
summary = "Google API client core library"
groups = ["default", "dev"]
@@ -1395,32 +1395,32 @@ dependencies = [
"requests<3.0.0.dev0,>=2.18.0",
]
files = [
- {file = "google_api_core-2.24.1rc1-py3-none-any.whl", hash = "sha256:92ee3eed90a397a9f4dd13c034a36cbe7dba2a58e01e5668619847b68a527b73"},
- {file = "google_api_core-2.24.1rc1.tar.gz", hash = "sha256:d1cf8265c8b0b171a87d84adc8709a5e48147ca529d6f96d6a2be613a195eb78"},
+ {file = "google_api_core-2.24.1-py3-none-any.whl", hash = "sha256:bc78d608f5a5bf853b80bd70a795f703294de656c096c0968320830a4bc280f1"},
+ {file = "google_api_core-2.24.1.tar.gz", hash = "sha256:f8b36f5456ab0dd99a1b693a40a31d1e7757beea380ad1b38faaf8941eae9d8a"},
]
[[package]]
name = "google-api-core"
-version = "2.24.1rc1"
+version = "2.24.1"
extras = ["grpc"]
requires_python = ">=3.7"
summary = "Google API client core library"
groups = ["default", "dev"]
dependencies = [
- "google-api-core==2.24.1rc1",
+ "google-api-core==2.24.1",
"grpcio-status<2.0.dev0,>=1.33.2",
"grpcio-status<2.0.dev0,>=1.49.1; python_version >= \"3.11\"",
"grpcio<2.0dev,>=1.33.2",
"grpcio<2.0dev,>=1.49.1; python_version >= \"3.11\"",
]
files = [
- {file = "google_api_core-2.24.1rc1-py3-none-any.whl", hash = "sha256:92ee3eed90a397a9f4dd13c034a36cbe7dba2a58e01e5668619847b68a527b73"},
- {file = "google_api_core-2.24.1rc1.tar.gz", hash = "sha256:d1cf8265c8b0b171a87d84adc8709a5e48147ca529d6f96d6a2be613a195eb78"},
+ {file = "google_api_core-2.24.1-py3-none-any.whl", hash = "sha256:bc78d608f5a5bf853b80bd70a795f703294de656c096c0968320830a4bc280f1"},
+ {file = "google_api_core-2.24.1.tar.gz", hash = "sha256:f8b36f5456ab0dd99a1b693a40a31d1e7757beea380ad1b38faaf8941eae9d8a"},
]
[[package]]
name = "google-api-python-client"
-version = "2.159.0"
+version = "2.160.0"
requires_python = ">=3.7"
summary = "Google API Client Library for Python"
groups = ["default", "dev"]
@@ -1432,8 +1432,8 @@ dependencies = [
"uritemplate<5,>=3.0.1",
]
files = [
- {file = "google_api_python_client-2.159.0-py2.py3-none-any.whl", hash = "sha256:baef0bb631a60a0bd7c0bf12a5499e3a40cd4388484de7ee55c1950bf820a0cf"},
- {file = "google_api_python_client-2.159.0.tar.gz", hash = "sha256:55197f430f25c907394b44fa078545ffef89d33fd4dca501b7db9f0d8e224bd6"},
+ {file = "google_api_python_client-2.160.0-py2.py3-none-any.whl", hash = "sha256:63d61fb3e4cf3fb31a70a87f45567c22f6dfe87bbfa27252317e3e2c42900db4"},
+ {file = "google_api_python_client-2.160.0.tar.gz", hash = "sha256:a8ccafaecfa42d15d5b5c3134ced8de08380019717fc9fb1ed510ca58eca3b7e"},
]
[[package]]
@@ -1485,7 +1485,7 @@ files = [
[[package]]
name = "google-cloud-aiplatform"
-version = "1.78.0"
+version = "1.79.0"
requires_python = ">=3.8"
summary = "Vertex AI API client library"
groups = ["default", "dev"]
@@ -1504,8 +1504,8 @@ dependencies = [
"typing-extensions",
]
files = [
- {file = "google_cloud_aiplatform-1.78.0-py2.py3-none-any.whl", hash = "sha256:e2663b715bdeb5f4c9bf72defc5bd9abdb182048b012b83231dd0708dbc8b7ba"},
- {file = "google_cloud_aiplatform-1.78.0.tar.gz", hash = "sha256:c42a8e9981afb7964d14c3109e1eae0892785c746235acb1f990cdfd40ce9d13"},
+ {file = "google_cloud_aiplatform-1.79.0-py2.py3-none-any.whl", hash = "sha256:e52d518c386ce2b4ce57f1b73b46c57531d9a6ccd70c21a37b349f428bfc1c3f"},
+ {file = "google_cloud_aiplatform-1.79.0.tar.gz", hash = "sha256:362bfd16716dcfb6c131736f25246790002b29c99a246fcf4c08a7c71bd2301f"},
]
[[package]]
@@ -1975,7 +1975,7 @@ files = [
[[package]]
name = "huggingface-hub"
-version = "0.27.1"
+version = "0.28.1"
requires_python = ">=3.8.0"
summary = "Client library to download and publish models, datasets and other repos on the huggingface.co hub"
groups = ["default", "dev"]
@@ -1989,8 +1989,8 @@ dependencies = [
"typing-extensions>=3.7.4.3",
]
files = [
- {file = "huggingface_hub-0.27.1-py3-none-any.whl", hash = "sha256:1c5155ca7d60b60c2e2fc38cbb3ffb7f7c3adf48f824015b219af9061771daec"},
- {file = "huggingface_hub-0.27.1.tar.gz", hash = "sha256:c004463ca870283909d715d20f066ebd6968c2207dae9393fdffb3c1d4d8f98b"},
+ {file = "huggingface_hub-0.28.1-py3-none-any.whl", hash = "sha256:aa6b9a3ffdae939b72c464dbb0d7f99f56e649b55c3d52406f49e0a5a620c0a7"},
+ {file = "huggingface_hub-0.28.1.tar.gz", hash = "sha256:893471090c98e3b6efbdfdacafe4052b20b84d59866fb6f54c33d9af18c303ae"},
]
[[package]]
@@ -2048,6 +2048,18 @@ files = [
{file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
]
+[[package]]
+name = "inotify"
+version = "0.2.10"
+summary = "An adapter to Linux kernel support for inotify directory-watching."
+groups = ["dev"]
+dependencies = [
+ "nose",
+]
+files = [
+ {file = "inotify-0.2.10.tar.gz", hash = "sha256:974a623a338482b62e16d4eb705fb863ed33ec178680fc3e96ccdf0df6c02a07"},
+]
+
[[package]]
name = "isodate"
version = "0.7.2"
@@ -2187,7 +2199,7 @@ files = [
[[package]]
name = "llama-cloud"
-version = "0.1.10"
+version = "0.1.11"
requires_python = "<4,>=3.8"
summary = ""
groups = ["default", "dev"]
@@ -2197,8 +2209,8 @@ dependencies = [
"pydantic>=1.10",
]
files = [
- {file = "llama_cloud-0.1.10-py3-none-any.whl", hash = "sha256:d91198ad92ea6c3a25757e5d6cb565b4bd6db385dc4fa596a725c0fb81a68f4e"},
- {file = "llama_cloud-0.1.10.tar.gz", hash = "sha256:56ffe8f2910c2047dd4eb1b13da31ee5f67321a000794eee559e0b56954d2f76"},
+ {file = "llama_cloud-0.1.11-py3-none-any.whl", hash = "sha256:b703765d03783a5a0fc57a52adc9892f8b91b0c19bbecb85a54ad4e813342951"},
+ {file = "llama_cloud-0.1.11.tar.gz", hash = "sha256:d4be5b48659fd9fe1698727be257269a22d7f2733a2ed11bce7065768eb94cbe"},
]
[[package]]
@@ -2228,7 +2240,7 @@ files = [
[[package]]
name = "llama-index-agent-openai"
-version = "0.4.2"
+version = "0.4.3"
requires_python = "<4.0,>=3.9"
summary = "llama-index agent openai integration"
groups = ["default", "dev"]
@@ -2238,8 +2250,8 @@ dependencies = [
"openai>=1.14.0",
]
files = [
- {file = "llama_index_agent_openai-0.4.2-py3-none-any.whl", hash = "sha256:e100b8a743b11fef373b5be31be590b929950a4d7fd9d158b5f014dd8fd7976e"},
- {file = "llama_index_agent_openai-0.4.2.tar.gz", hash = "sha256:0f8aeb091fc834b2667a46ad2417fc8601bf1c08ccfd1a3d15ede90a30eb1a29"},
+ {file = "llama_index_agent_openai-0.4.3-py3-none-any.whl", hash = "sha256:5d1fbb6831113e609296e457b0a4d1c08c9267acca219eb78cb702bd76a0744d"},
+ {file = "llama_index_agent_openai-0.4.3.tar.gz", hash = "sha256:ff1f4a13ba417cb4b9cfbc2ffa9f162bdbdda9b87d6645d512cbde2061f55412"},
]
[[package]]
@@ -2905,6 +2917,16 @@ files = [
{file = "nltk-3.9.1.tar.gz", hash = "sha256:87d127bd3de4bd89a4f81265e5fa59cb1b199b27440175370f7417d2bc7ae868"},
]
+[[package]]
+name = "nose"
+version = "1.3.7"
+summary = "nose extends unittest to make testing easier"
+groups = ["dev"]
+files = [
+ {file = "nose-1.3.7-py3-none-any.whl", hash = "sha256:9ff7c6cc443f8c51994b34a667bbcf45afd6d945be7477b52e97516fd17c53ac"},
+ {file = "nose-1.3.7.tar.gz", hash = "sha256:f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98"},
+]
+
[[package]]
name = "numpy"
version = "1.26.4"
@@ -2987,7 +3009,7 @@ files = [
[[package]]
name = "openai"
-version = "1.60.1"
+version = "1.60.2"
requires_python = ">=3.8"
summary = "The official Python library for the openai API"
groups = ["default", "dev"]
@@ -3002,8 +3024,8 @@ dependencies = [
"typing-extensions<5,>=4.11",
]
files = [
- {file = "openai-1.60.1-py3-none-any.whl", hash = "sha256:714181ec1c452353d456f143c22db892de7b373e3165063d02a2b798ed575ba1"},
- {file = "openai-1.60.1.tar.gz", hash = "sha256:beb1541dfc38b002bd629ab68b0d6fe35b870c5f4311d9bc4404d85af3214d5e"},
+ {file = "openai-1.60.2-py3-none-any.whl", hash = "sha256:993bd11b96900b9098179c728026f016b4982ded7ee30dfcf4555eab1171fff9"},
+ {file = "openai-1.60.2.tar.gz", hash = "sha256:a8f843e10f2855713007f491d96afb2694b11b5e02cb97c7d01a0be60bc5bb51"},
]
[[package]]
@@ -3367,7 +3389,7 @@ files = [
[[package]]
name = "proto-plus"
-version = "1.26.0rc1"
+version = "1.26.0"
requires_python = ">=3.7"
summary = "Beautiful, Pythonic protocol buffers"
groups = ["default", "dev"]
@@ -3375,8 +3397,8 @@ dependencies = [
"protobuf<6.0.0dev,>=3.19.0",
]
files = [
- {file = "proto_plus-1.26.0rc1-py3-none-any.whl", hash = "sha256:a0ad6fbc2e194dbbb813edc22ee2e509a7c38df7ecea2fd2803bce0536eaf0f4"},
- {file = "proto_plus-1.26.0rc1.tar.gz", hash = "sha256:04eeceecd6a038285e2aa8996b53c045d04a568c5c48b7eaa79c097a4984a4c7"},
+ {file = "proto_plus-1.26.0-py3-none-any.whl", hash = "sha256:bf2dfaa3da281fc3187d12d224c707cb57214fb2c22ba854eb0c105a3fb2d4d7"},
+ {file = "proto_plus-1.26.0.tar.gz", hash = "sha256:6e93d5f5ca267b54300880fff156b6a3386b3fa3f43b1da62e680fc0c586ef22"},
]
[[package]]
@@ -3925,12 +3947,12 @@ files = [
[[package]]
name = "pytz"
-version = "2024.2"
+version = "2025.1"
summary = "World timezone definitions, modern and historical"
groups = ["default", "dev"]
files = [
- {file = "pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725"},
- {file = "pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a"},
+ {file = "pytz-2025.1-py2.py3-none-any.whl", hash = "sha256:89dd22dca55b46eac6eda23b2d72721bf1bdfef212645d81513ef5d03038de57"},
+ {file = "pytz-2025.1.tar.gz", hash = "sha256:c2db42be2a2518b28e65f9207c4d05e6ff547d1efa4086469ef855e4ab70178e"},
]
[[package]]
@@ -4311,7 +4333,7 @@ files = [
[[package]]
name = "shapely"
-version = "2.0.6"
+version = "2.0.7"
requires_python = ">=3.7"
summary = "Manipulation and analysis of geometric objects"
groups = ["default", "dev"]
@@ -4319,25 +4341,25 @@ dependencies = [
"numpy<3,>=1.14",
]
files = [
- {file = "shapely-2.0.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:29a34e068da2d321e926b5073539fd2a1d4429a2c656bd63f0bd4c8f5b236d0b"},
- {file = "shapely-2.0.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e1c84c3f53144febf6af909d6b581bc05e8785d57e27f35ebaa5c1ab9baba13b"},
- {file = "shapely-2.0.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ad2fae12dca8d2b727fa12b007e46fbc522148a584f5d6546c539f3464dccde"},
- {file = "shapely-2.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3304883bd82d44be1b27a9d17f1167fda8c7f5a02a897958d86c59ec69b705e"},
- {file = "shapely-2.0.6-cp310-cp310-win32.whl", hash = "sha256:3ec3a0eab496b5e04633a39fa3d5eb5454628228201fb24903d38174ee34565e"},
- {file = "shapely-2.0.6-cp310-cp310-win_amd64.whl", hash = "sha256:28f87cdf5308a514763a5c38de295544cb27429cfa655d50ed8431a4796090c4"},
- {file = "shapely-2.0.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5aeb0f51a9db176da9a30cb2f4329b6fbd1e26d359012bb0ac3d3c7781667a9e"},
- {file = "shapely-2.0.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9a7a78b0d51257a367ee115f4d41ca4d46edbd0dd280f697a8092dd3989867b2"},
- {file = "shapely-2.0.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f32c23d2f43d54029f986479f7c1f6e09c6b3a19353a3833c2ffb226fb63a855"},
- {file = "shapely-2.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3dc9fb0eb56498912025f5eb352b5126f04801ed0e8bdbd867d21bdbfd7cbd0"},
- {file = "shapely-2.0.6-cp311-cp311-win32.whl", hash = "sha256:d93b7e0e71c9f095e09454bf18dad5ea716fb6ced5df3cb044564a00723f339d"},
- {file = "shapely-2.0.6-cp311-cp311-win_amd64.whl", hash = "sha256:c02eb6bf4cfb9fe6568502e85bb2647921ee49171bcd2d4116c7b3109724ef9b"},
- {file = "shapely-2.0.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:392f66f458a0a2c706254f473290418236e52aa4c9b476a072539d63a2460595"},
- {file = "shapely-2.0.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:eba5bae271d523c938274c61658ebc34de6c4b33fdf43ef7e938b5776388c1be"},
- {file = "shapely-2.0.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7060566bc4888b0c8ed14b5d57df8a0ead5c28f9b69fb6bed4476df31c51b0af"},
- {file = "shapely-2.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b02154b3e9d076a29a8513dffcb80f047a5ea63c897c0cd3d3679f29363cf7e5"},
- {file = "shapely-2.0.6-cp39-cp39-win32.whl", hash = "sha256:44246d30124a4f1a638a7d5419149959532b99dfa25b54393512e6acc9c211ac"},
- {file = "shapely-2.0.6-cp39-cp39-win_amd64.whl", hash = "sha256:2b542d7f1dbb89192d3512c52b679c822ba916f93479fa5d4fc2fe4fa0b3c9e8"},
- {file = "shapely-2.0.6.tar.gz", hash = "sha256:997f6159b1484059ec239cacaa53467fd8b5564dabe186cd84ac2944663b0bf6"},
+ {file = "shapely-2.0.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:33fb10e50b16113714ae40adccf7670379e9ccf5b7a41d0002046ba2b8f0f691"},
+ {file = "shapely-2.0.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f44eda8bd7a4bccb0f281264b34bf3518d8c4c9a8ffe69a1a05dabf6e8461147"},
+ {file = "shapely-2.0.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf6c50cd879831955ac47af9c907ce0310245f9d162e298703f82e1785e38c98"},
+ {file = "shapely-2.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04a65d882456e13c8b417562c36324c0cd1e5915f3c18ad516bb32ee3f5fc895"},
+ {file = "shapely-2.0.7-cp310-cp310-win32.whl", hash = "sha256:7e97104d28e60b69f9b6a957c4d3a2a893b27525bc1fc96b47b3ccef46726bf2"},
+ {file = "shapely-2.0.7-cp310-cp310-win_amd64.whl", hash = "sha256:35524cc8d40ee4752520819f9894b9f28ba339a42d4922e92c99b148bed3be39"},
+ {file = "shapely-2.0.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5cf23400cb25deccf48c56a7cdda8197ae66c0e9097fcdd122ac2007e320bc34"},
+ {file = "shapely-2.0.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d8f1da01c04527f7da59ee3755d8ee112cd8967c15fab9e43bba936b81e2a013"},
+ {file = "shapely-2.0.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f623b64bb219d62014781120f47499a7adc30cf7787e24b659e56651ceebcb0"},
+ {file = "shapely-2.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e6d95703efaa64aaabf278ced641b888fc23d9c6dd71f8215091afd8a26a66e3"},
+ {file = "shapely-2.0.7-cp311-cp311-win32.whl", hash = "sha256:2f6e4759cf680a0f00a54234902415f2fa5fe02f6b05546c662654001f0793a2"},
+ {file = "shapely-2.0.7-cp311-cp311-win_amd64.whl", hash = "sha256:b52f3ab845d32dfd20afba86675c91919a622f4627182daec64974db9b0b4608"},
+ {file = "shapely-2.0.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4abeb44b3b946236e4e1a1b3d2a0987fb4d8a63bfb3fdefb8a19d142b72001e5"},
+ {file = "shapely-2.0.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cd0e75d9124b73e06a42bf1615ad3d7d805f66871aa94538c3a9b7871d620013"},
+ {file = "shapely-2.0.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7977d8a39c4cf0e06247cd2dca695ad4e020b81981d4c82152c996346cf1094b"},
+ {file = "shapely-2.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0145387565fcf8f7c028b073c802956431308da933ef41d08b1693de49990d27"},
+ {file = "shapely-2.0.7-cp39-cp39-win32.whl", hash = "sha256:98697c842d5c221408ba8aa573d4f49caef4831e9bc6b6e785ce38aca42d1999"},
+ {file = "shapely-2.0.7-cp39-cp39-win_amd64.whl", hash = "sha256:a3fb7fbae257e1b042f440289ee7235d03f433ea880e73e687f108d044b24db5"},
+ {file = "shapely-2.0.7.tar.gz", hash = "sha256:28fe2997aab9a9dc026dc6a355d04e85841546b2a5d232ed953e3321ab958ee5"},
]
[[package]]
diff --git a/backend/pyproject.toml b/backend/pyproject.toml
index 4b9b59092..ea4f55888 100644
--- a/backend/pyproject.toml
+++ b/backend/pyproject.toml
@@ -79,6 +79,8 @@ dev = [
"-e unstract-tool-sandbox @ file:///${PROJECT_ROOT}/../unstract/tool-sandbox",
"-e unstract-workflow-execution @ file:///${PROJECT_ROOT}/../unstract/workflow-execution",
"-e unstract-filesystem @ file:///${PROJECT_ROOT}/../unstract/filesystem",
+ # For file watching
+ "inotify>=0.2.10",
]
[tool.pytest.ini_options]
diff --git a/docker/README.md b/docker/README.md
index 8529196db..d895f069c 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -1,4 +1,6 @@
-# Docker Build
+# Docker Commands
+
+## Docker Build
```bash
# Build all services
@@ -8,7 +10,7 @@ VERSION=dev docker compose -f docker-compose.build.yaml build
VERSION=dev docker compose -f docker-compose.build.yaml build frontend
```
-# Docker Run
+## Docker Run
**NOTE**: First copy `sample.*.env` files to `*.env` and update as required.
@@ -22,7 +24,7 @@ VERSION=dev docker compose -f docker-compose.yaml up -d frontend
Now access frontend at http://frontend.unstract.localhost
-# Docker Build and Run Optional Services
+## Docker Build and Run Optional Services
Some services are kept optional and will not be built or started by default. Run them as follows.
@@ -33,7 +35,27 @@ VERSION=dev docker compose -f docker-compose.build.yaml --profile optional build
VERSION=dev docker compose -f docker-compose.yaml --profile optional up -d
```
-# `src` Folder Layout and `gunicorn`
+## Overriding a service's config
+
+By making use of the [merge compose files](https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/) feature its
+possible to override some configuration that's used by the services.
+
+Copy and rename the `sample.compose.override.yaml` to `compose.override.yaml` and update it as necessary.
+
+```bash
+cp sample.compose.override.yaml compose.override.yaml
+
+# Configuration in docker-compose.yaml gets overridden
+VERSION=dev docker compose -f docker-compose.yaml -f compose.override.yaml up -d
+```
+
+This can be useful during development to
+
+- not run some memory intensive services
+- use commands with different arguments to save resources
+- mount additional volumes or define additional env to configure behaviour
+
+## `src` Folder Layout and `gunicorn`
For the following project structure:
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index 13d591cf3..0ed380afe 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -7,7 +7,7 @@ services:
image: unstract/backend:${VERSION}
container_name: unstract-backend
restart: unless-stopped
- command: migrate
+ command: --migrate
ports:
- "8000:8000"
env_file:
diff --git a/docker/sample.compose.override.yaml b/docker/sample.compose.override.yaml
new file mode 100644
index 000000000..f4ac352b2
--- /dev/null
+++ b/docker/sample.compose.override.yaml
@@ -0,0 +1,14 @@
+# Refer https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/
+# This is an example configuration which aims to minimize the number of celery workers
+# It helps reduce memory usage during development
+services:
+ worker:
+ command: "-A backend worker --loglevel=info -Q celery,celery_periodic_logs,celery_log_task_queue,celery_api_deployments --autoscale=${WORKER_AUTOSCALE}"
+
+ worker-logging:
+ profiles:
+ - high_memory
+
+ worker-api-deployment:
+ profiles:
+ - high_memory