From 00f2473592234dfcbf6b4cb3f31d7e2c36e0b043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Mon, 28 May 2018 16:44:19 +0200 Subject: [PATCH 1/3] Update webservice supervisor config in preparation for console --- solvable/supervisor/webservice.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/solvable/supervisor/webservice.conf b/solvable/supervisor/webservice.conf index 69051cd..16a12b7 100644 --- a/solvable/supervisor/webservice.conf +++ b/solvable/supervisor/webservice.conf @@ -4,3 +4,6 @@ directory=%(ENV_TFW_WEBSERVICE_DIR)s environment=BASEURL="/webservice" command=python3 server.py autostart=true +startretries=0 +stdout_logfile=/tmp/webservice_logs +stderr_logfile=/tmp/webservice_logs From 7e717b88295811662e0caf120cd1b3b193c46fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Tue, 29 May 2018 18:00:57 +0200 Subject: [PATCH 2/3] Add LogMonitor for live process output monitoring --- solvable/src/event_handler_main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/solvable/src/event_handler_main.py b/solvable/src/event_handler_main.py index 1ff27f1..bdcc746 100644 --- a/solvable/src/event_handler_main.py +++ b/solvable/src/event_handler_main.py @@ -3,7 +3,7 @@ from ast import literal_eval from tornado.ioloop import IOLoop from tfw.components import IdeEventHandler, TerminalEventHandler, ProcessManagingEventHandler, BashMonitor -from tfw.components import TerminalCommands +from tfw.components import TerminalCommands, LogMonitor from tfw.networking import MessageSender, TFWServerConnector from tfw.config import TFWENV from tfw.config.logs import logging @@ -74,14 +74,16 @@ if __name__ == '__main__': directory=TFWENV.IDE_WD, exclude=['*.pyc'], additional_watched_directories=[TFWENV.WEBSERVICE_DIR] ) - terminal = TerminalEventHandler( # Web shell backend + terminal = TerminalEventHandler( # Web shell backend key='shell', monitor=BashMonitor(TFWENV.HISTFILE) ) - processmanager = ProcessManagingEventHandler( # Handles 'deploy' button clicks + processmanager = ProcessManagingEventHandler( # Handles 'deploy' button clicks key='processmanager', - dirmonitor=ide.monitor + dirmonitor=ide.monitor, + log_tail=2000 ) + LogMonitor('webservice', log_tail=2000).watch() # Sends live logs of webservice process to frontend terminal.historymonitor.subscribe_callback(cenator) From 8b8e6ed5fbc8471c3d6ac8875c4f39c3dec4bd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 30 May 2018 13:15:13 +0200 Subject: [PATCH 3/3] Use new LogMonitoringEventHandler instead of naked LogMonitor observer --- solvable/src/event_handler_main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/solvable/src/event_handler_main.py b/solvable/src/event_handler_main.py index bdcc746..54f1971 100644 --- a/solvable/src/event_handler_main.py +++ b/solvable/src/event_handler_main.py @@ -3,7 +3,7 @@ from ast import literal_eval from tornado.ioloop import IOLoop from tfw.components import IdeEventHandler, TerminalEventHandler, ProcessManagingEventHandler, BashMonitor -from tfw.components import TerminalCommands, LogMonitor +from tfw.components import TerminalCommands, LogMonitoringEventHandler from tfw.networking import MessageSender, TFWServerConnector from tfw.config import TFWENV from tfw.config.logs import logging @@ -83,14 +83,17 @@ if __name__ == '__main__': dirmonitor=ide.monitor, log_tail=2000 ) - LogMonitor('webservice', log_tail=2000).watch() # Sends live logs of webservice process to frontend + logmonitor = LogMonitoringEventHandler( # Sends live logs of webservice process to frontend + 'webservice', + log_tail=2000 + ) + eventhandlers = {ide, terminal, processmanager, logmonitor} terminal.historymonitor.subscribe_callback(cenator) commands = TestCommands(bashrc=f'/home/{TAOENV.USER}/.bashrc') terminal.historymonitor.subscribe_callback(commands.callback) - eventhandlers = {ide, terminal, processmanager} try: IOLoop.instance().start() finally: