Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use celery concurrency 1 and allow --scale containers #61

Merged
merged 2 commits into from
Jun 8, 2020
Merged
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 dockerfiles/entrypoints/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

../../docker/common.sh

CMD="python3 -m celery worker -A ${CELERY_APP_NAME}.worker -Ofair -c 2 -Q builder,celery,default,build01 -l DEBUG"
CMD="python3 -m celery worker -A ${CELERY_APP_NAME}.worker -Ofair -c 1 -Q builder,celery,default,build01,build:default,build:large -l DEBUG"

if [ -n "${DOCKER_NO_RELOAD}" ]; then
echo "Running Docker with no reload"
Expand Down
7 changes: 4 additions & 3 deletions dockerfiles/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@ def down(c, volumes=False):
c.run(f'{DOCKER_COMPOSE_COMMAND} down', pty=True)

@task
def up(c, no_search=False, init=False, no_reload=False):
def up(c, no_search=False, init=False, no_reload=False, scale_build=1):
"""Start all the docker containers for a Read the Docs instance"""
INIT = 'INIT='
DOCKER_NO_RELOAD = 'DOCKER_NO_RELOAD='
SCALE = f'--scale build={scale_build}'
if init:
INIT = 'INIT=t'
if no_reload:
DOCKER_NO_RELOAD = 'DOCKER_NO_RELOAD=t'

if no_search:
c.run(f'{INIT} {DOCKER_NO_RELOAD} docker-compose -f {DOCKER_COMPOSE} -f {DOCKER_COMPOSE_OVERRIDE} up', pty=True)
c.run(f'{INIT} {DOCKER_NO_RELOAD} docker-compose -f {DOCKER_COMPOSE} -f {DOCKER_COMPOSE_OVERRIDE} up {SCALE}', pty=True)
else:
c.run(f'{INIT} {DOCKER_NO_RELOAD} {DOCKER_COMPOSE_COMMAND} up', pty=True)
c.run(f'{INIT} {DOCKER_NO_RELOAD} {DOCKER_COMPOSE_COMMAND} up {SCALE}', pty=True)

@task
def shell(c, running=False, container='web'):
Expand Down