Skip to content

Commit c7da8ad

Browse files
PhillipDowneyPhil Downey
andauthored
Jup refresh fix (#74)
* fix gui servers from getting timed out by Jupyter * needed to update to standard banner * Update README.md * Update metadata.json * Update pyproject.toml --------- Co-authored-by: Phil Downey <phildowney@pd-work-mac.local>
1 parent 5df3812 commit c7da8ad

6 files changed

Lines changed: 14 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ If you get an error when running `init_magic`, you may first need to setup the d
202202
> **Note:** Due to an issue with one of our dependencies, Python 3.12 is not yet supported.
203203
204204
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
205-
pyenv install 3.10
205+
pyenv install 3.11
206206
207207
1. **Step 1: Set up your virtual environment** (optional)<br>
208208

openad/app/metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"banner": "OPENAD",
33
"title": "Welcome to the Open Accelerated Discovery CLI",
4-
"version": "0.6.2",
4+
"version": "0.6.4",
55
"commands": {
66
"intro": "If this is your first time, let us help you getting started.",
77
"? toolkits": "Learn about the toolkits.",
@@ -10,4 +10,4 @@
1010
"? <soft>...</soft>": "List commands containing \"...\"",
1111
"docs": "Read the docs in your browser."
1212
}
13-
}
13+
}

openad/flask_apps/launcher.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import socket
33
import webbrowser
44
import warnings
5+
from time import sleep
56
from IPython.display import HTML, display
67
from IPython.display import IFrame as display_iframe
78
from flask import Flask, send_from_directory
@@ -152,6 +153,7 @@ def app_dir(subpath):
152153

153154
thread = Thread(target=lambda: app.run(host=host, port=port))
154155
thread.start()
156+
sleep(0.5)
155157
else:
156158
# CLI --> Start the Flask app in the main thread.
157159
app.run(host=host, port=port)

openad/gui/gui_launcher.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import logging
1717
import webbrowser
1818
import urllib.parse
19+
from time import sleep
1920
from pathlib import Path
2021
from threading import Thread
2122
import IPython.external
@@ -189,6 +190,13 @@ def serve(path=""):
189190
GUI_SERVER = ServerThread(app, host, port)
190191
GUI_SERVER.start()
191192

193+
# IMPORTANT
194+
# Pause long enough for the flask server to start
195+
# Issue can be that jupyter has race condition for resources and the server does not start.
196+
# On first starting Server says it is alive but there must be some resource contention that sees it close shorlty after starting
197+
# is_alive and -s_running both return ok so need to enformce mandatory pause to ensure no abend
198+
sleep(0.5)
199+
192200

193201
# This class replaces Flask's builtin app.run() server,
194202
# and allows us to shut down the server from another thread.
-372 KB
Loading

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "openad"
3-
version = "0.6.2"
3+
version = "0.6.4"
44
description = "Open Accelerated Discovery Client "
55
authors = ["Phil Downey <phil.downey1@ibm.com>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)