Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update openhtf to latest #10

Merged
merged 55 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
cf5600c
fixed typos and closed open brackets (#807)
iHarshit15 Dec 14, 2023
b4a8291
adressing to the comment
iHarshit15 Dec 15, 2023
7993642
Update mfg_inspector.py
iHarshit15 Dec 15, 2023
7573009
Merge pull request #1126 from iHarshit15:master
copybara-github Dec 18, 2023
e4a844c
Use coveralls github action with parallel enabled (#1131)
dbhatman Jan 4, 2024
e892a9e
Move ImmutableMeasurement to measurement.py.
a-googler Jan 4, 2024
72a2e31
Added pytype None checks to console_summary.py.
a-googler Jan 18, 2024
a1449e0
Added pytype None checks to text.py.
a-googler Feb 23, 2024
d1ebe96
Added pytype None checks to station_server.py.
a-googler Feb 23, 2024
24a27fa
Add set_time_millis to measurement
wallacbe Feb 26, 2024
912af91
Update diagnoses_test.py
wallacbe Feb 26, 2024
4cf0734
util.time_millis()
wallacbe Feb 26, 2024
2f7f3be
Added pytype None checks to test.py.
a-googler Feb 26, 2024
2fccdbf
Added pytype None checks to local_usb.py.
a-googler Feb 29, 2024
2f840a3
Merge pull request #1140 from google:wallacbe-set_time
copybara-github Mar 1, 2024
865512a
Internal clean up.
a-googler May 1, 2024
1b777e9
Fix test breakage likely caused by an update to pytest
glados-verma Jun 29, 2024
f838833
Also generate LCOV file to fix coveralls integration
glados-verma Jun 29, 2024
71e03cb
Merge pull request #1163 from google:glados-verma-patch-1
copybara-github Jun 29, 2024
6060cd0
Move example Test definition out of the main() function to module level.
glados-verma Jul 2, 2024
1f103eb
Increase the post timeout for uploading
dbhatman Jul 22, 2024
bb7e12d
Add support for uncompressed uploads if they are being used
dbhatman Jul 25, 2024
80e9fe5
fix typo in event_sequence.md
frankalicious Dec 22, 2020
207303e
Merge pull request #1168 from frankalicious:fix_typo
copybara-github Aug 2, 2024
3877963
Update coveralls version to 2.3.0 in continuous_integration.yml (#1170)
glados-verma Aug 28, 2024
ecd0690
Log filename, number and function name for the phase being executed
glados-verma Aug 28, 2024
7a5acb8
Fix continuous integration (again) (#1173)
glados-verma Oct 4, 2024
4706af6
Exercise stop_on_measurement_fail option later, after multidims have …
glados-verma Oct 8, 2024
16b0c05
Overhaul the build system to be per modern conventions (#1175)
glados-verma Oct 24, 2024
07e17f4
No public description
glados-verma Oct 24, 2024
e980042
Add pytype disables for legacy unittests checking for incorrect types…
copybara-service[bot] Oct 30, 2024
945c089
Update documentation for the default repeat limit, add constant for r…
glados-verma Oct 30, 2024
2064831
Upgrade Tornado to v6, and fix servers accordingly. (#1181)
glados-verma Oct 30, 2024
d4d4bf0
Update tornado requirement in the pip group (#1176)
dependabot[bot] Oct 30, 2024
3890edb
Use importlib metadata version since setuptools pkg_resources is
glados-verma Oct 30, 2024
dc893eb
Merge pull request #1183 from glados-verma:metadata
copybara-github Oct 31, 2024
57f6344
Keep GitHub Actions up to date with GitHub's Dependabot (#1184)
cclauss Nov 6, 2024
710313e
Bump the github-actions group with 3 updates (#1187)
dependabot[bot] Nov 6, 2024
c302837
Create and persist an authorized session object for MfgInspector.
a-googler Nov 6, 2024
a7c3ce2
Bump pypa/gh-action-pypi-publish in the github-actions group (#1193)
dependabot[bot] Nov 11, 2024
d4b15b3
Update profiling to work with python3.12
glados-verma Oct 30, 2024
1938ce8
Merge pull request #1194 from glados-verma:profile
copybara-github Nov 12, 2024
a6bf9e1
Continuous Integration: python-version: ["3.9", "3.11", "3.13"] (#1185)
cclauss Nov 12, 2024
be30972
Add Python 3.13 to tox (local run) environments. (#1196)
glados-verma Nov 12, 2024
bc16234
Package web_gui, and add a note to CONTRIBUTING.md to check the built…
glados-verma Nov 12, 2024
8c69ab8
Merge pull request #1197 from glados-verma:packaging
copybara-github Nov 13, 2024
c7cd2b7
Use repr instead of str for phase result logging
glados-verma Nov 13, 2024
16941c3
Remove unused imports using autoflake --in-place --recursive --remove…
glados-verma Nov 14, 2024
f9209cf
Move some type hints from comments to the newer style
glados-verma Nov 14, 2024
98b5dac
Merge pull request #1198 from glados-verma:unused_imports
copybara-github Nov 14, 2024
f8e3885
Bump pypa/gh-action-pypi-publish in the github-actions group (#1201)
dependabot[bot] Dec 11, 2024
85f5d72
If run_if throws exception (not intentionally), test will terminate w…
eli-zr Dec 11, 2024
fd7c8ff
Fix broken examples and add a README
glados-verma Dec 18, 2024
0e4f7c4
Merge pull request #1207 from glados-verma:examples
copybara-github Dec 20, 2024
b482928
Merge branch 'master' into feat/update-openhtf-jan2025
jonny12375 Jan 6, 2025
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
Prev Previous commit
Next Next commit
Upgrade Tornado to v6, and fix servers accordingly. (google#1181)
Also updated the README for web_gui development
glados-verma authored Oct 30, 2024
commit 20648318253ed4f2c86c0d486fcdbd97ffe5cfea
2 changes: 2 additions & 0 deletions openhtf/output/servers/station_server.py
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
aggregate info from multiple station servers with a single frontend.
"""

import asyncio
import contextlib
import itertools
import json
@@ -166,6 +167,7 @@ def __init__(self, update_callback):

def run(self):
"""Call self._poll_for_update() in a loop and handle errors."""
asyncio.set_event_loop(asyncio.new_event_loop())
while True:
try:
self._poll_for_update()
51 changes: 35 additions & 16 deletions openhtf/output/servers/web_gui_server.py
Original file line number Diff line number Diff line change
@@ -13,9 +13,9 @@
# limitations under the License.
"""Extensible HTTP server serving the OpenHTF Angular frontend."""

import asyncio
import os
import threading
import time

import tornado.httpclient
import tornado.httpserver
@@ -112,6 +112,8 @@ class WebGuiServer(threading.Thread):

def __init__(self, additional_routes, port, sockets=None):
super(WebGuiServer, self).__init__(name=type(self).__name__)
self.ts_event = threading.Event()
self._running = asyncio.Event()

# Set up routes.
routes = [
@@ -121,24 +123,17 @@ def __init__(self, additional_routes, port, sockets=None):
}),
]
routes.extend(additional_routes)

if sockets is None:
sockets, self.port = bind_port(port)
else:
if not port:
raise ValueError('When sockets are passed to the server, port must be '
'specified and nonzero.')
self.port = port
self._sockets = sockets
self.port = port
self._loop = None

# Configure the Tornado application.
application = tornado.web.Application(
self.application = tornado.web.Application(
routes,
default_handler_class=DefaultHandler,
template_loader=TemplateLoader(STATIC_FILES_ROOT),
static_path=STATIC_FILES_ROOT,
)
self.server = tornado.httpserver.HTTPServer(application)
self.server.add_sockets(sockets)

def __enter__(self):
self.start()
@@ -147,14 +142,38 @@ def __enter__(self):
def __exit__(self, *unused_args):
self.stop()

async def run_app(self):
"""Runs the station server application."""
self.ts_watchdog_task = asyncio.create_task(self._stop_threadsafe())
if self._sockets is None:
self._sockets, self.port = bind_port(self.port)
else:
if not self.port:
raise ValueError(
'When sockets are passed to the server, port must be '
'specified and nonzero.'
)
self.server = tornado.httpserver.HTTPServer(self.application)
self.server.add_sockets(self._sockets)
await self._running.wait()
await self.ts_watchdog_task
await self.server.close_all_connections()

async def _stop_threadsafe(self):
"""Handles stopping the server in a threadsafe manner."""
while not self.ts_event.is_set():
await asyncio.sleep(0.1)
self._running.set()

def _get_config(self):
"""Override this to configure the Angular app."""
return {}

def run(self):
tornado.ioloop.IOLoop.instance().start() # Blocking IO loop.
"""Runs the station server."""
asyncio.run(self.run_app())

def stop(self):
self.server.stop()
ioloop = tornado.ioloop.IOLoop.instance()
ioloop.add_timeout(time.time() + _SERVER_SHUTDOWN_BUFFER_S, ioloop.stop)
"""Stops the station server. Method is threadsafe."""
self.ts_event.set()

15 changes: 13 additions & 2 deletions openhtf/output/web_gui/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# OpenHTF web GUI client

## Prerequisites

Follow the steps from [CONTRIBUTING.md](../../../CONTRIBUTING.md) to set up
the Python virtual environment. Make sure you have done an "editable" install.

## Development

First, start the dashboard server on the default port by running the following
Start the dashboard server on the default port by running the following
from the project root directory:

```
@@ -22,4 +27,10 @@ the dashboard server and should reload automatically when changes are made to
frontend files.

With the dashboard running, you can run OpenHTF tests separately, and they
should be picked up over multicast and appear on the dashboard.
should be picked up over multicast and appear on the dashboard. To test things
out, you can run the frontend example test:

```
python3 examples/frontend_example.py
```

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "openhtf"
version = "1.6.0"
version = "1.6.1"
authors = [
{ name="The OpenHTF Authors"},
]
@@ -23,7 +23,7 @@ dependencies = [
"pyOpenSSL>=17.1.0",
"requests>=2.27.1",
"sockjs_tornado>=1.0.7",
"tornado>=4.3,<5.0",
"tornado>=6,<6.3",
"typing_extensions>=4.12.2",
]
license = {file = "LICENSE"}