Added Celery worker docker container
This docker container uses the Blender Cloud image, but a different entry point. It is not intended to be network-reachable from the outside world. All it needs are connections to the databases (mongo, redis, rabbit).
This commit is contained in:
@@ -2,5 +2,8 @@ bash docker-entrypoint.sh
|
|||||||
env | sort
|
env | sort
|
||||||
apache2ctl start
|
apache2ctl start
|
||||||
apache2ctl graceful
|
apache2ctl graceful
|
||||||
|
/manage.sh operations worker -- -C
|
||||||
|
celery status --broker amqp://guest:guest@rabbit:5672//
|
||||||
|
celery events --broker amqp://guest:guest@rabbit:5672//
|
||||||
tail -n 40 -f /var/log/apache2/access.log
|
tail -n 40 -f /var/log/apache2/access.log
|
||||||
tail -n 40 -f /var/log/apache2/error.log
|
tail -n 40 -f /var/log/apache2/error.log
|
||||||
|
4
docker/4_run/celery-worker.sh
Executable file
4
docker/4_run/celery-worker.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source /install_scripts.sh
|
||||||
|
source /manage.sh operations worker -- -C
|
@@ -1,22 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ ! -f /installed ]; then
|
source /install_scripts.sh
|
||||||
SITEPKG=$(echo /opt/python/lib/python3.*/site-packages)
|
|
||||||
echo "Installing Blender Cloud packages into $SITEPKG"
|
|
||||||
|
|
||||||
# TODO: 'pip3 install -e' runs 'setup.py develop', which runs 'setup.py egg_info',
|
|
||||||
# which can't write the egg info to the read-only /data/git volume. This is why
|
|
||||||
# we manually install the links.
|
|
||||||
for SUBPROJ in /data/git/{pillar,pillar-python-sdk,attract,flamenco}; do
|
|
||||||
NAME=$(python3 $SUBPROJ/setup.py --name)
|
|
||||||
echo "... $NAME"
|
|
||||||
echo $SUBPROJ >> $SITEPKG/easy-install.pth
|
|
||||||
echo $SUBPROJ > $SITEPKG/$NAME.egg-link
|
|
||||||
done
|
|
||||||
echo "All packages installed."
|
|
||||||
|
|
||||||
touch /installed
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure that log rotation works.
|
# Make sure that log rotation works.
|
||||||
mkdir -p ${APACHE_LOG_DIR}
|
mkdir -p ${APACHE_LOG_DIR}
|
||||||
|
18
docker/4_run/install_scripts.sh
Normal file
18
docker/4_run/install_scripts.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
if [ ! -f /installed ]; then
|
||||||
|
SITEPKG=$(echo /opt/python/lib/python3.*/site-packages)
|
||||||
|
echo "Installing Blender Cloud packages into $SITEPKG"
|
||||||
|
|
||||||
|
# TODO: 'pip3 install -e' runs 'setup.py develop', which runs 'setup.py egg_info',
|
||||||
|
# which can't write the egg info to the read-only /data/git volume. This is why
|
||||||
|
# we manually install the links.
|
||||||
|
for SUBPROJ in /data/git/{pillar,pillar-python-sdk,attract,flamenco}; do
|
||||||
|
NAME=$(python3 $SUBPROJ/setup.py --name)
|
||||||
|
echo "... $NAME"
|
||||||
|
echo $SUBPROJ >> $SITEPKG/easy-install.pth
|
||||||
|
echo $SUBPROJ > $SITEPKG/$NAME.egg-link
|
||||||
|
done
|
||||||
|
echo "All packages installed."
|
||||||
|
|
||||||
|
touch /installed
|
||||||
|
fi
|
@@ -42,8 +42,7 @@ RUN a2enmod rewrite && a2enmod wsgi-py36
|
|||||||
|
|
||||||
ADD apache2.conf /etc/apache2/apache2.conf
|
ADD apache2.conf /etc/apache2/apache2.conf
|
||||||
ADD 000-default.conf /etc/apache2/sites-available/000-default.conf
|
ADD 000-default.conf /etc/apache2/sites-available/000-default.conf
|
||||||
ADD docker-entrypoint.sh /docker-entrypoint.sh
|
ADD *.sh /
|
||||||
ADD manage.sh /manage.sh
|
|
||||||
|
|
||||||
# Remove some empty top-level directories we won't use anyway.
|
# Remove some empty top-level directories we won't use anyway.
|
||||||
RUN rmdir /media /home 2>/dev/null || true
|
RUN rmdir /media /home 2>/dev/null || true
|
||||||
|
@@ -14,7 +14,7 @@ redis:
|
|||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:6379:6379"
|
- "127.0.0.1:6379:6379"
|
||||||
rabbit:
|
rabbit:
|
||||||
image: rabbitmq:3.6.7
|
image: rabbitmq:3.6.10
|
||||||
container_name: rabbit
|
container_name: rabbit
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -36,6 +36,22 @@ blender_cloud:
|
|||||||
links:
|
links:
|
||||||
- mongo
|
- mongo
|
||||||
- redis
|
- redis
|
||||||
|
- rabbit
|
||||||
|
celery_worker:
|
||||||
|
image: armadillica/blender_cloud:latest
|
||||||
|
entrypoint: /celery-worker.sh
|
||||||
|
container_name: celery_worker
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
# format: HOST:CONTAINER
|
||||||
|
- /data/git:/data/git:ro
|
||||||
|
- /data/config:/data/config:ro
|
||||||
|
- /data/storage/pillar:/data/storage/pillar
|
||||||
|
- /data/log:/var/log
|
||||||
|
links:
|
||||||
|
- mongo
|
||||||
|
- redis
|
||||||
|
- rabbit
|
||||||
# notifserv:
|
# notifserv:
|
||||||
# container_name: notifserv
|
# container_name: notifserv
|
||||||
# image: armadillica/pillar-notifserv:cd8fa678436563ac3b800b2721e36830c32e4656
|
# image: armadillica/pillar-notifserv:cd8fa678436563ac3b800b2721e36830c32e4656
|
||||||
|
Reference in New Issue
Block a user