Commit Graph

66 Commits

Author SHA1 Message Date
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: dc96d4bee7b898172a6a15de4799af0e2d35605e
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: 332f568a8241fba9459cb70c76840b9670e6993a
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: 55390d273f36f49da3896e687ac5530f40c1d150
2021-12-16 14:58:17 +01:00
Shane Smiskol ef38c36435 version.py: make function names more clear (#23216)
* rename a few version functions

* and is_prebuilt

* and some formatting 😊
old-commit-hash: b745a14ff71622fe1fe4c9c043c7d7694d23dc08
2021-12-14 12:15:13 +01:00
Adeeb Shihadeh db8e512ee5 updated: handle execptions while setting params
old-commit-hash: c6d3306dbe32a7f438c5422426d570316a697cba
2021-12-10 22:49:32 -08:00
Adeeb Shihadeh fc641646ed updated: move update alerts out of thermald (#23028)
* updated: move update alerts out of thermald

* cleanup last update time

* set on startup
old-commit-hash: b79eaca18df6535066a23a128d124f75e8bb6bdd
2021-12-04 22:15:55 -08:00
Mayfield 72c892e014 ui: render markdown in release notes (#22754)
* convert release notes from markdown to html

* fall back to previous behavior if utf8 decoding or markdown parsing throws

* make simple markdown parser to avoid needing a library

* add unit test

* move markdown parser to common. add unit test

use `markdown-it-py` instead of `markdown` dependency for test comparison since it's already in Pipfile.lock

* test (almost) all release notes and add some extra html encoding

* update lock

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1aebe6ff6e7097cef973f73a990c270d1f6d682b
2021-11-04 16:12:39 +01:00
Adeeb Shihadeh 104ba7be84 updated: add a few missing type hints
old-commit-hash: 9ca16560e2314e9b953a5fcc04d19f0fb6b9ab6b
2021-10-25 15:58:26 -07:00
Adeeb Shihadeh 47a983fb00 updated: add persistent param for build date (#22237)
old-commit-hash: ed70c5aaf537d14ca870d30851172c7a5242b7d1
2021-09-14 20:24:41 -07:00
Adeeb Shihadeh 9193e1afa1 Unify neos/agnos updaters (#22109)
* start moving neos updater

* downloading

* ui

* move recovery

* resuming

* add verification

* fix up launch

* test

* update updater

* fix mypy

* fake updater

* review suggestions

* more tests

* abc

* update bin

* raise

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: b3705ede5e9dbc29dcf5ea02bb257a8f576a0556
2021-09-10 17:03:54 -07:00
Adeeb Shihadeh ef7b6016b1 updated: move final git reset before finalizing update (#22168)
old-commit-hash: d4b42042331fe797efa144d7e5646c92925386db
2021-09-08 10:47:38 -07:00
Adeeb Shihadeh 8b512c4b75 updated: log successful update swap (#22144)
old-commit-hash: da1aa2704603fc15d1a6bbbe1d603c15b6be0cf5
2021-09-06 13:48:19 -07:00
Adeeb Shihadeh 8b8e77575c fix crash due to permissions when clearing update staging dir (#21790)
old-commit-hash: 3a7444250cb8ac9b6315d76df240de6a4b9aec51
2021-07-29 19:50:34 -07:00
Adeeb Shihadeh 57cc915aa9 updated: clear overlay on exception (#21489)
old-commit-hash: a44072753d43dc6bb67e3e326438637bc9a62d20
2021-07-05 19:27:06 -07:00
Willem Melching c8810406da tici: flash bootloader partitions from manifest (#21399)
* move swapping to python

* only create downloader if needed

* typo

* number

* add sanity check

* boot full check to test

* manifest is required argument

* implement full hash check

* off by one

* new manifest

* only write tag for system

* bump splash

* review comments part 1

* trigger update

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
old-commit-hash: 7c6bf89e043fe559b3bc4d19391c9c9af095a998
2021-06-30 14:20:58 +02:00
Adeeb Shihadeh e56a6919bd fixup release build (#21430)
* fixup release3 build

* works on pc

* install release3

* push dashcam

* only import on tici

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 49d96f0acc5d6675357b5f9bed3958ada48c0874
2021-06-28 14:30:44 -07:00
Willem Melching 33a3bb5fc9 Revert "tici: always run updated (#21249)"
This reverts commit 60ba93bd1be24e022552da1545dca9b61d2584b7.

old-commit-hash: 715dbd488201615219dc7b384c458954940597fa
2021-06-14 12:38:33 +02:00
Adeeb Shihadeh e07f1a1ee4 tici: always run updated (#21249)
old-commit-hash: 4dfdf0e51d878bd7639c50ae626853f71c1b7413
2021-06-12 22:23:39 -07:00
Adeeb Shihadeh f53936f904 Revert "updated: fix surfacing exceptions and errors (#20754)"
This reverts commit 07006949d3734b433a8b9de60440523f5e760d88.

old-commit-hash: 967489bdaae415aeee3ff73625c16e4b20d7e063
2021-05-27 14:35:52 -07:00
Adeeb Shihadeh f69e234419 updated: fix surfacing exceptions and errors (#20754)
* updated: fix surfacing exceptions and errors

* can't rely on that

* unused

* ugh pylint

* try this

* this makes pylint happy

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 3c9e46d8a2ec3f9c347b0f455f66179c8220c1e2
2021-04-26 20:58:21 -07:00
Willem Melching 8f4a445171 add putBool/getBool wrappers to cython params class (#20611)
* add putBool/getBool wrappers to cython class

* use new API

* some more puts

* fix mockparams arguments

* add get_bool to MockParams

* typo
old-commit-hash: ae094042ade44815fdba50196c15ba552bbf33d7
2021-04-07 15:36:37 +02:00
Adeeb Shihadeh 0d5dec9276 updated: log git diff on overlay init (#20476)
* updated: log git diff on overlay init

* add git diff param

* params
old-commit-hash: bcb6879199948c21f1ebef9afc2a63f433309c00
2021-03-25 16:16:12 -07:00
Adeeb Shihadeh 8866942686 offroad alert for agnos update (#20270)
old-commit-hash: 6e101fd6919f3eac745e9273dcdfe470c5ab1f64
2021-03-07 15:37:09 -08:00
Adeeb Shihadeh 6dbc7c6d92 oneplus cleanup (#20200)
* start cleanup

* cleanup camerad

* remove unused

* little more

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 07ab081a42e4c383bd0fbd3e7e5723a126c8da12
2021-03-01 17:14:03 -08:00
Adeeb Shihadeh ec468f88c9 move agnos manifest to selfdrive/hardware (#19889)
old-commit-hash: cfb0390183fe073f8aee93d922b6ba907c010532
2021-01-30 18:31:28 -08:00
Adeeb Shihadeh 933f2952bd fix updated bug that allows for mismatch openpilot/agnos (#19943)
old-commit-hash: 09ee2a8c51ae7c2fc0c3204228d5f501e471291e
2021-01-27 15:39:14 -08:00
Adeeb Shihadeh 349429836c agnos updater (#2600)
* agnos updater

* add manifest

* fix path

* get manifest from overlay

* update manifest

* remove merge markers

* add streaming decompressor

* dont need read all

* Unsparsify

* Fix output filename

* Optimization

* cleanup

* Small cleanup

* Read manifest from merged overlay

* Write hash at end of partition

* Sync before writing hash

* Write bytes in file

* add manifest with image sizes

* Fix manifest path

* File was closed already

* Format string

* Put raw hash

* Read hashes in launch script

* update launch script

* should be agnos version

* fix slot

* Make sure we clear the hash

* Verify partition size

* move updated

* Standalone flasher

* Don't rely on ordering

* Get path

* Debug log

* Download agnos

* Info is enough

* update manifest

* Remove f

* Check downloader return code

* Exit on wrong manifest

* Fix typos

* Set pythonpath before hardware init

* move agnos into hardware folder

* remove comments

* Fix abstractmethod

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: b276881fcdb95b6160bae23600ed204f521bdbb4
2020-12-18 13:17:12 +01:00
Adeeb Shihadeh 804f08f593 disable updater for oneplus EONs
old-commit-hash: 40a4bd9fc73d43a476c9133320d8f6b6ef1d9fc3
2020-12-17 12:20:07 -08:00
Adeeb Shihadeh b950cab874 HW abstraction layer (#19530)
* start hw refactor

* move that

* pins

* put that back
old-commit-hash: 8674b023bab2b44405139ceec5785a389f837682
2020-12-16 21:30:23 -08:00
Adeeb Shihadeh f359b4cf49 remove fsck logging in updated
old-commit-hash: 238ac19ba975ffcdbe7b792b30a1409d219541da
2020-12-14 10:51:03 -08:00
Adeeb Shihadeh 3e6abdd8bd oneplus deprecation (#2748)
* oneplus deprecation

* lowercase

* too long

* no udpates
old-commit-hash: 6a151dcd9c9f988301368312a7969aa9f413d346
2020-12-12 12:51:12 -08:00
Adeeb Shihadeh d05c8e2a08 Tici updated (#2126)
* run updated on tici

* do this for now

* two didn't like empty string

* fix permissions
old-commit-hash: 38ded9b1e79cc01bf4b8086b543bf0bab689d0fc
2020-10-02 16:36:20 -07:00
Adeeb Shihadeh 9bb39d1145 updated: remove old overlay init file
old-commit-hash: 2a2cfd6bb51cc67276b9c21fe70cf1114e1e6f03
2020-09-29 21:26:27 -07:00
Adeeb Shihadeh c23faac9df updated: log git corruption (#2242)
* log git corruption

* better cloudlog
old-commit-hash: 3f40a9ee7590f95743dd5914ca81496f1419f402
2020-09-29 12:08:55 -07:00
Adeeb Shihadeh 12b7a29d06 Improved updater robustness (#2046)
* git ping

* cleanup overlay init

* separate update available check from fetch

* cleanup setting params

* only fetch neos update on android

* move that

* type hints

* lightweight update check with git ls-remote

* git fetch dry run

* cleanup
old-commit-hash: 722a440eb6102777fb97f6ae8936d852709a66a5
2020-09-22 12:09:41 -07:00
Greg Hogan d200f048b7 fix pylint errors
old-commit-hash: 1e6c7c94e4750547297dc011d36eeedad0ad7e37
2020-09-03 18:46:13 -07:00
Adeeb Shihadeh b2e40a7487 remove dead code in updated
old-commit-hash: 21a1792f895e006fd70883b5621989e01b539693
2020-08-17 16:21:55 -07:00
Adeeb Shihadeh c2b1d97b20 NEOS background updater (#1892)
old-commit-hash: cb5a2996e75658ac61f057fb729c229a554c551e
2020-08-12 11:39:21 -07:00
Adeeb Shihadeh dde753d531 fix linter
old-commit-hash: 60e2267f02b8c09666a73c6ea2dea1bf25cc8ce1
2020-08-11 20:37:51 -07:00
Adeeb Shihadeh 017b084154 Alert when updated consistently fails (#2013)
* alert when update fails more than 10 times

* bring over offroad alert refactor from other branch

* and we have tests

* use it in snapshot

* bump apk

* don't show exceptions on release branches

* only write when changed

* why does delete use so much cpu

* clean that up

* little more
old-commit-hash: 8e63f065400ea1868f077560ae89b2c17f5523f8
2020-08-11 16:23:57 -07:00
Adeeb Shihadeh 3dccc7fc2e Updater tests (#1974)
* refactor exit handling

* test update

* more reliable?

* better

* init git in CI

* testy tester

* CI should work

* test overlay reinit

* only one

* still need to fix loop test

* more patience

* more patience in CI

* no ping in CI

* this is cleaner

* need to run these in jenkins

* clean up

* run in jenkins

* fix test file path

* it's a git repo now

* no commit

* reinit

* remove duplicate

* why not git

* la

* git status

* pythonpath

* fix

* no CI fro now

* check overlay consistent

* more tests

* make more changes in the update commit

* sample

* no k
old-commit-hash: fe18a014c7845b5e81738b0be716d256aeb00d78
2020-08-06 21:49:05 -07:00
Adeeb Shihadeh 792b74f543 Improve update reliability and responsiveness (#1986)
* handle orphaned git lock

* trigger update after going offroad

* git ping
old-commit-hash: a115366dddc076bb186219d33a7565712465b226
2020-08-06 12:49:11 -07:00
Adeeb Shihadeh b5fa861871 Cleanup updated (#1981)
* remove dead code from updated

* no short

* simpler

* simplify that

* move that into the class

* little more
old-commit-hash: f61dcb6e12447de7a84b547230b748b59b7424a4
2020-08-05 13:29:03 -07:00
Adeeb Shihadeh 0b64a13bc9 improve updated responsiveness (#1973)
old-commit-hash: 88c67e7e9f73ea5a0114b63598fd489a1e834a84
2020-08-04 13:48:19 -07:00
Adeeb Shihadeh 05628116ee fix blocking sleep in updated (#1860)
old-commit-hash: 62a94eb0cda8bc2c0f2cc1a116b3d5a0cc6e4628
2020-07-12 01:46:18 -07:00
Jason Young 2b60599543 Make updated more resilient (#1853)
* Add sleep at updated startup

* Mitigate symlink-related FS damage
old-commit-hash: c43df81214d34d90b318defbd7f43e240b0c8f45
2020-07-10 07:41:26 -04:00
George Hotz 70dbce450c Add an SSH param to disable updates (#1807)
* disable updates with optional param

* dont create the alert

* Revert "dont create the alert"

This reverts commit 7179a6c8b4b4656e0b203b5a590b33d3388aa9c9.

* keep alert, but allow engagement

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: cb495bb8c9af8b9347bfe3cf4b59baf1f6d10482
2020-07-01 14:26:35 -07:00
Adeeb 9027018368 Update Flake8 config (#1624)
* update flake8 checks

* add E502

* no whitespace warnings

* fix violations

* no W391

Co-authored-by: Jason Young <jason@comma.ai>
old-commit-hash: 367155168a0c9fb698c8248a5c28c66c2987ae65
2020-06-03 16:13:34 -07:00
Willem Melching a56e2b01f8 Make pylint more strict (#1626)
* make pylint more strict

* cleanup in progress

* done cleaning up

* no opendbc
old-commit-hash: 843a64c72fb94397a1edf814fa66044c8d92acbf
2020-06-02 16:29:32 -07:00
Willem Melching 36e26ce381 updater read git config first (#1376)
old-commit-hash: 0418da517a11758ffd0531cb6ffa18d8958bd1e4
2020-04-16 11:55:16 -07:00