deps: add rerun-sdk into pyproject.toml (#32472)

* add rerun-sdk into pyproject.toml

* install/wheel cleanup

* unpin version
old-commit-hash: bd6bea39bf
This commit is contained in:
Mauricio Alvarez Leon 2024-05-18 17:21:04 -07:00 committed by GitHub
parent 72b6504595
commit 1600939a38
3 changed files with 5 additions and 26 deletions

4
poetry.lock generated
View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ac0468a1ad5059d4320e08fa5070ee4305beb9108b5f43c88e8e83dd40a6d331
size 607350
oid sha256:0331d5e607fb9fb524f5457c1a84677630852b11dfcb84752aaae6c982724b89
size 614123

View File

@ -108,6 +108,7 @@ pycryptodome = "*"
PyJWT = "*"
pyserial = "*"
pyzmq = "*"
rerun-sdk = "*"
requests = "*"
scons = "*"
sentry-sdk = "*"

View File

@ -1,8 +1,9 @@
#!/usr/bin/env python3
import subprocess
import sys
import argparse
import multiprocessing
import rerun as rr
import rerun.blueprint as rrb
from functools import partial
from openpilot.tools.lib.logreader import LogReader
@ -11,14 +12,6 @@ from cereal.services import SERVICE_LIST
NUM_CPUS = multiprocessing.cpu_count()
DEMO_ROUTE = "a2a0ccea32023010|2023-07-27--13-01-19"
WHEEL_URL = "https://build.rerun.io/commit/660463d/wheels"
def install():
# currently requires a preview release build
subprocess.run([sys.executable, "-m", "pip", "install", "--pre", "-f", WHEEL_URL, "--upgrade", "rerun-sdk"], check=True)
print("Rerun installed")
def log_msg(msg, parent_key=''):
stack = [(msg, parent_key)]
@ -45,7 +38,6 @@ def log_msg(msg, parent_key=''):
else:
pass # Not a plottable value
def createBlueprint():
timeSeriesViews = []
for topic in sorted(SERVICE_LIST.keys()):
@ -55,12 +47,10 @@ def createBlueprint():
rrb.Spatial2DView(name="thumbnail", origin="/thumbnail")))
return blueprint
def log_thumbnail(thumbnailMsg):
bytesImgData = thumbnailMsg.get('thumbnail')
rr.log("/thumbnail", rr.ImageEncoded(contents=bytesImgData))
def process(blueprint, lr):
ret = []
rr.init("rerun_test", spawn=True, default_blueprint=blueprint)
@ -73,12 +63,10 @@ def process(blueprint, lr):
log_thumbnail(msg.to_dict()[msg.which()])
return ret
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="A helper to run rerun on openpilot routes",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--demo", action="store_true", help="Use the demo route instead of providing one")
parser.add_argument("--install", action="store_true", help="Install or update rerun")
parser.add_argument("route_or_segment_name", nargs='?', help="The route or segment name to plot")
if len(sys.argv) == 1:
@ -86,16 +74,6 @@ if __name__ == '__main__':
sys.exit()
args = parser.parse_args()
if args.install:
install()
sys.exit()
try:
import rerun as rr
import rerun.blueprint as rrb
except ImportError:
print("Rerun is not installed, run with --install first")
sys.exit()
route_or_segment_name = DEMO_ROUTE if args.demo else args.route_or_segment_name.strip()
blueprint = createBlueprint()