From 2d6bdaf916c34eeaabc3b1c46048c61cc98d3aee Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Fri, 22 Mar 2024 11:13:37 +0530 Subject: install redis and start celery --- blocks/Dockerfile | 2 +- blocks/install.sh | 2 ++ blocks/run.sh | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/blocks/Dockerfile b/blocks/Dockerfile index 6fec272f..6aaecf6a 100644 --- a/blocks/Dockerfile +++ b/blocks/Dockerfile @@ -17,7 +17,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install pre-requisites RUN apt-get update -qq && \ - apt-get install -qq --no-install-recommends gcc g++ libgfortran5 make nginx openjdk-8-jre python3 sqlite3 tzdata && \ + apt-get install -qq --no-install-recommends gcc g++ libgfortran5 make nginx openjdk-8-jre python3 redis sqlite3 tzdata && \ apt-get clean -qq && \ rm -f /var/lib/apt/lists/*_* diff --git a/blocks/install.sh b/blocks/install.sh index 655aad43..48461638 100755 --- a/blocks/install.sh +++ b/blocks/install.sh @@ -20,6 +20,8 @@ python manage.py loaddata -v0 xcosblocks sed -i \ -e "s/\\(SCILAB_DIR = \\).*/\\1'\/usr\/local'/" \ + -e "s/\\(CELERY_BROKER_URL = \\).*/\\1'redis:\\/\\/localhost:6379\\/1'/" \ + -e "s/\\(CELERY_RESULT_BACKEND = \\).*/\\1'redis:\\/\\/localhost:6379\\/1'/" \ blocks/settings.py sed -i -e '/^\s*location \/ {/,/^\s*}/c\ diff --git a/blocks/run.sh b/blocks/run.sh index 6c10f18e..20788d8f 100755 --- a/blocks/run.sh +++ b/blocks/run.sh @@ -3,8 +3,10 @@ set -e service nginx start +service redis-server start . env/bin/activate +celery -A blocks.celery_tasks worker --loglevel INFO --concurrency 1 & cd eda-frontend npm start & -- cgit