Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion legacy/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ CONTEXT_GRAPH_JOB_QUEUE_BACKEND=celery

# Database Configuration
POSTGRES_PASSWORD=your_password_here
POSTGRES_SERVER=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/momentum_dev
POSTGRES_SERVER=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/momentum

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because there is a mismatch in compost.yaml file it creates with momentum and not momentum_dev, either of the one needs to be modified.

    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: mysecretpassword
      POSTGRES_DB: momentum


NEO4J_URI=bolt://127.0.0.1:7687
NEO4J_USERNAME=neo4j
Expand Down
15 changes: 9 additions & 6 deletions legacy/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ fi
# Synchronize and create the managed virtual environment if needed
echo "Syncing Python environment with uv..."
if ! (cd "$REPO_ROOT" && uv sync --all-packages); then
echo "Error: Failed to synchronize Python dependencies"
echo "Error: Failed to synchronize root Python dependencies"
exit 1
fi
if ! (cd "$REPO_ROOT" && uv sync --project "$LEGACY_ROOT"); then
echo "Error: Failed to synchronize legacy Python dependencies"
exit 1
fi

Expand Down Expand Up @@ -81,14 +85,13 @@ if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" ==
fi
fi

cd "$REPO_ROOT"
source .venv/bin/activate
cd "$LEGACY_ROOT"

alembic -c alembic.ini upgrade heads
echo "Applying database migrations..."
uv run --project "$LEGACY_ROOT" alembic -c alembic.ini upgrade heads

echo "Starting momentum application..."
gunicorn --worker-class uvicorn.workers.UvicornWorker --workers 1 --timeout 1800 --bind 0.0.0.0:8001 --log-level debug app.main:app &
uv run --project "$LEGACY_ROOT" gunicorn --worker-class uvicorn.workers.UvicornWorker --workers 1 --timeout 1800 --bind 0.0.0.0:8001 --log-level debug app.main:app &
GUNICORN_PID=$!

echo "Starting Celery worker..."
Expand All @@ -99,7 +102,7 @@ _cg_lc=$(printf '%s' "$_cg" | tr '[:upper:]' '[:lower:]')
if [[ "$_cg_lc" != "false" && "$_cg_lc" != "0" && "$_cg_lc" != "no" && "$_cg_lc" != "off" && "$_cg_lc" != "" ]]; then
CELERY_QUEUES="${CELERY_QUEUES},context-graph-etl"
fi
celery -A app.celery.celery_app worker --loglevel=debug -Q "${CELERY_QUEUES}" -E --concurrency=1 --pool=solo -B --schedule=.celerybeat-schedule &
uv run --project "$LEGACY_ROOT" celery -A app.celery.celery_app worker --loglevel=debug -Q "${CELERY_QUEUES}" -E --concurrency=1 --pool=solo -B --schedule=.celerybeat-schedule &

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try running it from legacy folder or the root folder? Running inside the legacy folder works for me.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried running from legacy folder, did not work for me.

CELERY_PID=$!

# Keep this script in the foreground and forward Ctrl+C to app workers.
Expand Down