Commit Graph

36 Commits

Author SHA1 Message Date
Justin Newberry
c4f322ce2d Linter: remove pylint (#29611)
remove pylint
old-commit-hash: 1ee6ed4b16
2023-08-24 16:30:54 -07:00
Adeeb Shihadeh
5bc6566e7c manager: refactor process starting logic (#29574)
* refactor into sane api

* always set

* cleanup

* cleanup

* and there too

* fix order

* fail

* and ensure we test

* pass test

pass test

* order

* only diff not related

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: d013f2174a
2023-08-24 06:00:55 -07:00
Adeeb Shihadeh
16ec56398c add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
old-commit-hash: a9626f95b6
2023-08-20 20:49:55 -07:00
Adeeb Shihadeh
51634f52dc replace custom clock helpers with time module (#29499)
* replace custom clock stuff wtih time module

* fix double

* fix release

* bump cereal

* update type

* fix one more
old-commit-hash: d61f86d339
2023-08-20 18:50:58 -07:00
Justin Newberry
d487c0501f Ruff: enable most of bugbear (#29320)
* added mutable default args

* most of the Bs

* add comment about lrucache
old-commit-hash: 62c1e65924
2023-08-11 15:33:49 -07:00
Adeeb Shihadeh
6cdd601cfe manager: remove old unkillable process handling (#29209)
old-commit-hash: bc0aa1c598
2023-08-01 22:18:58 -07:00
Kacper Rączy
67ac96c8b4 process_replay: capture process output (#29027)
* Add ProcessOutputProxy

* Move launcher to its own field

* Move ProcessOutputCapture to its own file

* Return itself from __enter__ of OpenpilotPrefix

* Integrate ProcessOutputCapture into process_replay

* Add note about capture_output_store to README

* ipykernel import is optional

* Disable type checking for link_with_current_proc

* Remove assertion

* Decode outputs to utf-8

* read(self): return empty buf if its none

* Fix type annotations

* Replace fifo with regular file, to avoid hitting fifo size limit
old-commit-hash: 547a033a3c
2023-07-31 16:30:58 -07:00
Adeeb Shihadeh
ebae4d9579 manager: create params once (#28757)
old-commit-hash: 260e83d8e4
2023-06-30 10:03:45 -07:00
Adeeb Shihadeh
ee363d69e3 fix a bunch of python warnings (#28576)
* fix a bunch of python warnings

* fix that
old-commit-hash: 111b4eee30
2023-06-16 13:22:30 -07:00
Adeeb Shihadeh
2b9b5e3646 manager: watchdog restart UI with SIGKILL (#28523)
old-commit-hash: 58d32a70d7
2023-06-12 21:46:20 -07:00
Comma Device
487189dae5 test manager: use ensure_running to start relevant procs
old-commit-hash: 4293705648
2023-01-22 16:28:20 -06:00
Adeeb Shihadeh
3c48bc47b7 Move a bunch of stuff to system/ part 3 (#24829)
* move swaglog.py

* timezoned

* logmessaged

* version.py

* fix linter
old-commit-hash: 0fce5d9045
2022-06-11 23:19:27 -07:00
Adeeb Shihadeh
9a45a3b99b Move selfdrive/hardware/ to system/ (#24725)
* move hardware to system/

* fix mypy
old-commit-hash: 1139fe507b
2022-06-11 16:38:24 -07:00
Adeeb Shihadeh
d097c4df26 manager: start process by callback (#24417)
old-commit-hash: cdf6338388
2022-05-03 23:30:35 -07:00
grekiki
cc943ac9a5 mypy: enable --warn-unreachable (#24282)
* Optional solves mypy assuming None is always None

* oops

* spaces

* Update registration.py

* fix local error

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: b8b15d5cf1
2022-04-21 18:27:45 +02:00
Willem Melching
373ac5ce3d manager: cleanup ensure_running (#24270)
* manager: cleanup ensure_running

* make notcar a blocking condition

* invert last conditions

* duplicate

* always run daemon process

* comment

* typo

* make notcar like driverview
old-commit-hash: 207df4742f
2022-04-21 16:23:39 +02:00
Adeeb Shihadeh
ae71ecf8b8 manager: start bridge and web joystick for notcars (#24212)
* manager: start bridge and web joystick for notcars

* fix that

* bump cereal

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 76a8338197
2022-04-19 14:13:05 -07:00
Adeeb Shihadeh
bd71c594a2 pylint: enforce indentation (W0311) (#24039)
* pylint: enforce indentation (W0311)

* few more
old-commit-hash: 8af20af66d
2022-03-24 23:23:29 -07:00
Adeeb Shihadeh
eac8bd839a sentry improvements (#23627)
* sentry: filter out unregistered devices and PC

* add daemon name
old-commit-hash: 8b5b0ae341
2022-01-26 11:44:10 -08:00
Adeeb Shihadeh
fa8ba3617b sentry fixups (#23249)
* set env

* do init in same place

* no sentry for forks

* start session

* start session

* remove that

* val
old-commit-hash: b63bc89bc9
2022-01-14 15:25:16 -08:00
Adeeb Shihadeh
7ea602dafe swaglog: add daemon name to context (#23518)
* cleanup first

* add daemon name

* add test

* fix

* daemon name
old-commit-hash: 8c53adf4ab
2022-01-13 20:23:08 -08:00
Shane Smiskol
002c79d2d5 manager: default driverview to False (#23492)
old-commit-hash: 6e817f9eb5
2022-01-11 14:07:35 +01:00
George Hotz
86a39e838b Add More Types for mypy (#23268)
* mypy passes

* a few more

* a few in manager

* more types, will lint

* more

* simple types

* events type

* Update selfdrive/thermald/thermald.py

* Apply suggestions from code review

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: dc96d4bee7
2021-12-28 18:07:00 +01:00
Ewout ter Hoeven
f206ebd054 Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305)
Updated Python code with Python 3.6+ features:
- utf-8 encoding is now the default (PEP 3120)
- Replace list comprehensions by Generator Expressions (PEP 289)
- Replace yield loop by yield from (PEP 380)
- Remove the (object) subclass when defining a class
- Replace the IOError alias by OSError (PEP 3151)
- Define sets with curly braces {} instead of set()
- Remove "r" parameter from open function, which is default

Co-Authored-By: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-Authored-By: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>

Co-authored-by: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-authored-by: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>
old-commit-hash: 332f568a82
2021-12-24 11:18:39 -08:00
Ewout ter Hoeven
a962365292 Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 55390d273f
2021-12-16 14:58:17 +01:00
Adeeb Shihadeh
6fc218503c cloudlog: add daemon name to context for python daemons (#23225)
* python

* manager is a daemon too

* Update selfdrive/manager/process.py

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: b27a19e9d1
2021-12-14 20:43:26 -08:00
Dean Lee
84097b29df watchdog_kick: non-allocating (#22892)
* non-allocating

* unpack

* call kick every second

* cleanup include
old-commit-hash: ca88a8769b
2021-11-17 12:02:31 +01:00
Adeeb Shihadeh
dbc41b847d add shouldBeRunning field to managerState (#22246)
old-commit-hash: 2f57f1729d
2021-09-15 19:51:55 -07:00
arfy slowy
63b3d6024b fix: spelling typos (#21861)
* fix: typo spelling grammar

* revert

* Update selfdrive/locationd/calibrationd.py

* more revert

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: d74def61f8
2021-08-05 12:05:49 -07:00
Adeeb Shihadeh
65ec97ad2d watchdog: restart while onroad (#21636)
old-commit-hash: 09291b99bc
2021-07-17 14:52:05 -07:00
Willem Melching
56df23047b Kill processes in parallel when going offroad (#20469)
* Kill processes in parallel when going offroad

* smaller diff

* handle edge case

* more readable

* set variable after actually sending signal

* newline
old-commit-hash: 9291ca773c
2021-03-25 17:27:49 +01:00
Willem Melching
0ccc4448e1 manager watchdog, log exit code
old-commit-hash: 958e7b0071
2021-03-09 13:11:40 +01:00
Willem Melching
4d6c98aa6b Add watchdog check to manager (#20277)
* this should work but doesnt

* Only offroad

* works

* make it work offorad

* reduce diff

* cleanup

* need util

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: a94ba4fb8b
2021-03-08 19:17:46 -08:00
Willem Melching
d9707bcaac manager: check if process is running before sending signal
old-commit-hash: af2a847f06
2021-03-08 15:42:09 +01:00
Willem Melching
c993097393 Process config cleanup (#20276)
* add enabled flag

* remove hack

* only prepare when enabled
old-commit-hash: 476558b547
2021-03-08 12:18:58 +01:00
Willem Melching
c0098cec09 Manager cleanup (#20231)
* move manager in folder

* inital refactor

* call start

* small cleanup

* add comments

* use self.signal()

* order shouldnt matter

* newlines

* add helpers

* newlines

* add process config

* split out build part of manager

* this should fix most tests

* no sensord on pc

* dont start athena

* remove comment

* fix old athena test

* fix inject model

* fix test car models

* should be not none

* fix helpers exitcode

* ignore manage_athenad

* Use time.monotonic()

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* combine init, remove spinner

* move manager test

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 5a3b511306
2021-03-05 11:03:23 +01:00