#!/bin/bash # Initialize and update submodules git submodule init git submodule update --init --recursive export POETRY_CACHE_DIR="/app/.cache" # Use --global to avoid permission issues git config --global --add safe.directory /app git config --global --add safe.directory /app/olas-predict-benchmark git config --global --add safe.directory /app/olas-predict-benchmark/benchmark/mech # Ensure you're in the right directory before running git checkout cd /app/olas-predict-benchmark/benchmark git checkout fix/mech-packages || echo "Branch 'fix/mech-packages' not found." cd ../.. cd /app/olas-predict-benchmark/benchmark/mech git checkout main || echo "Switching to 'main'." cd ../../.. # Configure poetry to create virtual environments within the project directory poetry config virtualenvs.in-project true cd /app # If pyproject.toml has changed significantly, update dependencies poetry lock --no-update # Install dependencies as specified in poetry.lock file poetry install # Activate the virtual environment source /app/.venv/bin/activate # Run the application python app.py