Skip to content

Commit

Permalink
Merge pull request ansible#774 from matburt/jupyter_for_devel
Browse files Browse the repository at this point in the history
Adding jupyter notebook support to the AWX development environment
  • Loading branch information
matburt authored Dec 6, 2017
2 parents 9488105 + da0b686 commit 7fc896e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,18 @@ receiver:
fi; \
$(PYTHON) manage.py run_callback_receiver

socketservice:
@if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
fi; \
$(PYTHON) manage.py run_socketio_service

nginx:
nginx -g "daemon off;"

rdb:
$(PYTHON) tools/rdb.py

jupyter:
@if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
fi; \
$(MANAGEMENT_COMMAND) shell_plus --notebook

reports:
mkdir -p $@

Expand Down
12 changes: 12 additions & 0 deletions awx/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@
# Load default settings.
from defaults import * # NOQA

# awx-manage shell_plus --notebook
NOTEBOOK_ARGUMENTS = [
'--NotebookApp.token=',
'--ip', '0.0.0.0',
'--port', '8888',
'--allow-root',
'--no-browser',
]

# print SQL queries in shell_plus
SHELL_PLUS_PRINT_SQL = False

# show colored logs in the dev environment
# to disable this, set `COLOR_LOGS = False` in awx/settings/local_settings.py
LOGGING['handlers']['console']['()'] = 'awx.main.utils.handlers.ColorHandler'
Expand Down
2 changes: 2 additions & 0 deletions requirements/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ pytest-mock
logutils
flower
uwsgitop
jupyter
matplotlib
1 change: 1 addition & 0 deletions tools/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
CELERY_RDB_HOST: 0.0.0.0
AWX_GROUP_QUEUES: tower
ports:
- "8888:8888"
- "8080:8080"
- "5555:5555"
- "8013:8013"
Expand Down
1 change: 1 addition & 0 deletions tools/docker-compose/Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ celeryd: make celeryd
receiver: make receiver
flower: make flower
uwsgi: make uwsgi
jupyter: make jupyter
8 changes: 8 additions & 0 deletions tools/docker-compose/supervisor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0

[program:jupyter]
command = make jupyter
autostart = true
autorestart = true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0

[group:awx-processes]
programs=celeryd,receiver,runworker,uwsgi,daphne,nginx,flower
priority=5
Expand Down

0 comments on commit 7fc896e

Please sign in to comment.