Skip to content

Commit

Permalink
frontend report error if fail
Browse files Browse the repository at this point in the history
  • Loading branch information
ryichando committed Dec 26, 2024
1 parent 9796462 commit de6ed6b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/vast-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ name: All Examples

on:
workflow_dispatch:
inputs:
runner:
type: string
default: self-hosted
required: true
description: 'Runner Name'

env:
VAST_API_KEY: ${{ secrets.VAST_API_KEY }}

jobs:
part_1:
runs-on: ubuntu-latest
runs-on: ${{ github.event.inputs.runner }}
timeout-minutes: 300
steps:

Expand Down Expand Up @@ -63,7 +69,7 @@ jobs:
run: bash /tmp/vast-ci/delete-instance.sh

part_2:
runs-on: ubuntu-latest
runs-on: ${{ github.event.inputs.runner }}
timeout-minutes: 300
steps:

Expand Down Expand Up @@ -100,7 +106,7 @@ jobs:
run: bash /tmp/vast-ci/delete-instance.sh

part_3:
runs-on: ubuntu-latest
runs-on: ${{ github.event.inputs.runner }}
timeout-minutes: 300
steps:

Expand Down Expand Up @@ -137,7 +143,7 @@ jobs:
run: bash /tmp/vast-ci/delete-instance.sh

part_4:
runs-on: ubuntu-latest
runs-on: ${{ github.event.inputs.runner }}
timeout-minutes: 300
steps:

Expand Down Expand Up @@ -169,9 +175,6 @@ jobs:
- name: trampoline
run: bash .github/workflows/vast/run.sh run trampoline.py

- name: needle
run: bash .github/workflows/vast/run.sh run needle.py

- name: shutdown
if: always()
run: bash /tmp/vast-ci/delete-instance.sh
run: bash /tmp/vast-ci/delete-instance.sh
15 changes: 10 additions & 5 deletions .github/workflows/vast-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ name: Single Example
on:
workflow_dispatch:
inputs:
runner:
type: string
default: self-hosted
required: true
description: 'Runner Name'
scene:
type: string
required: true
Expand All @@ -17,7 +22,7 @@ env:

jobs:
single-example:
runs-on: ubuntu-latest
runs-on: ${{ github.event.inputs.runner }}
timeout-minutes: 300
steps:

Expand Down Expand Up @@ -49,15 +54,15 @@ jobs:
timeout-minutes: 10
run: bash .github/workflows/vast/run.sh convert

- name: run-1
- name: ${{ github.event.inputs.scene }} (1st)
run: bash .github/workflows/vast/run.sh run ${{ github.event.inputs.scene }}

- name: run-2
- name: ${{ github.event.inputs.scene }} (2nd)
run: bash .github/workflows/vast/run.sh run ${{ github.event.inputs.scene }}

- name: run-3
- name: ${{ github.event.inputs.scene }} (3rd)
run: bash .github/workflows/vast/run.sh run ${{ github.event.inputs.scene }}

- name: shutdown
if: always()
run: bash /tmp/vast-ci/delete-instance.sh
run: bash /tmp/vast-ci/delete-instance.sh
17 changes: 16 additions & 1 deletion examples/frontend/_session_.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,17 +641,22 @@ def stream(self, n_lines=40) -> "Session":
log_widget = widgets.HTML()
display(log_widget)
button = widgets.Button(description="Stop Live Stream")
display(widgets.HBox((button, self._terminate_button())))
terminate_button = self._terminate_button()
display(widgets.HBox((button, terminate_button)))

stop = False
log_path = os.path.join(self.info.path, "output", "cudasim_log.txt")
err_path = os.path.join(self.info.path, "error.log")
if os.path.exists(log_path):

def live_stream(self):
nonlocal stop
nonlocal button
nonlocal log_widget
nonlocal log_path
nonlocal err_path
nonlocal terminate_button
assert terminate_button is not None

while not stop:
result = subprocess.run(
Expand All @@ -665,7 +670,17 @@ def live_stream(self):
)
if not is_running():
log_widget.value += "<p style='color: red;'>Terminated.</p>"
if os.path.exists(err_path):
file = open(err_path, "r")
lines = file.readlines()
if len(lines) > 0:
log_widget.value += "<p style='color: red;'>"
for line in lines:
log_widget.value += line + "\n"
log_widget.value += "</p>"

button.disabled = True
terminate_button.disabled = True
break
time.sleep(self._update_terminal_interval)

Expand Down
1 change: 1 addition & 0 deletions warmup.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,6 @@ def start_jupyter():
install_fish()
set_tmux()
install_lazygit()
install_lazyvim()
else:
setup()

0 comments on commit de6ed6b

Please sign in to comment.