Skip to content
Open
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
1 change: 1 addition & 0 deletions OpenOrchestrator/orchestrator/tabs/logging_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class LoggingTab():
"""The 'Logs' tab object."""
def __init__(self, tab_name: str) -> None:
self.current_job_id: str | None = None
# TODO: Serverside pagination like queue tab maybe?
with ui.tab_panel(tab_name):
with ui.row().classes("w-full justify-between"):
with ui.row():
Expand Down
3 changes: 1 addition & 2 deletions OpenOrchestrator/orchestrator/tabs/queue_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(self, queue_name: str, update_callback):
ui.switch("Dense", on_change=lambda e: self._dense_table(e.value))
self._create_column_filter()
ui.button(icon='refresh', on_click=self._update)
self.close_button = ui.button(icon="close", on_click=dialog.close)
self.close_button = ui.button(icon="close", on_click=lambda: (dialog.close(), self.update_callback()))
with ui.scroll_area().classes("h-full"):
self.table = ui.table(columns=ELEMENT_COLUMNS, rows=[], row_key='ID', title=queue_name, pagination={'rowsPerPage': self.rows_per_page, 'rowsNumber': self.queue_count}).classes("w-full sticky-header h-[calc(100vh-200px)] overflow-auto")
self.table.on('rowClick', lambda e: self._open_queue_element_popup(e.args[1]))
Expand All @@ -105,7 +105,6 @@ def __init__(self, queue_name: str, update_callback):
self.new_button = ui.button(icon='playlist_add', on_click=self._open_create_dialog)

self._update()
self.update_callback()
test_helper.set_automation_ids(self, "queue_popup")

def _dense_table(self, value: bool):
Expand Down
9 changes: 7 additions & 2 deletions OpenOrchestrator/scheduler/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ def kill_job(job: SchedulerJob) -> None:
Args:
job: The job whose process to kill.
"""
# Kill process tree to ensure child processes (like browsers or subprocesses) are also killed
# WARNING: This will cause an error on non-Windows systems
subprocess.run(['taskkill', '/F', '/T', '/PID', str(job.process.pid)],
check=False, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

job.process.kill()
db_util.set_trigger_status(job.trigger.id, TriggerStatus.KILLED)
db_util.set_job_status(job.job.id, JobStatus.KILLED)
Expand Down Expand Up @@ -261,7 +266,7 @@ def run_process(trigger: Trigger) -> SchedulerJob | None:
conn_string = db_util.get_conn_string()
crypto_key = crypto_util.get_key()

command_args = ['python', process_path, trigger.process_name, conn_string, crypto_key, trigger.process_args, str(trigger.id), job.id]
command_args = ['python', process_path, trigger.process_name, conn_string, crypto_key, trigger.process_args, str(trigger.id), str(job.id)]

process = subprocess.Popen(command_args, stderr=subprocess.PIPE, text=True) # pylint: disable=consider-using-with

Expand All @@ -275,7 +280,7 @@ def run_process(trigger: Trigger) -> SchedulerJob | None:
db_util.set_trigger_status(trigger.id, TriggerStatus.FAILED)
error_msg = f"Scheduler couldn't launch the process:\n{exc.__class__.__name__}:\n{exc}"
db_util.create_log(trigger.process_name, LogLevel.ERROR, None, error_msg)
db_util.set_job_status(job, JobStatus.FAILED)
db_util.set_job_status(job.id, JobStatus.FAILED)
print(error_msg)

return None
7 changes: 1 addition & 6 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added the possibility to kill a running robot from Orchestrator.
- Added search and status filter to queue element list.
- Added overview of queue element.
- Added search and status filter to queue element list.
- Added overview of queue element.
- Added option to create new queue element.
- Added editing of queue elements.
- Added option to delete queue element.- Added search and status filter to queue element list.
- Added overview of queue element.
- Added option to create new queue element.
- Added editing of queue elements.
- Added option to delete queue element.
- Added search and status filter to queue element list.
- Added Job objects, job tabs and linked logs to jobs.

### Changed
Expand Down
Loading