Commit Graph

85 Commits

Author SHA1 Message Date
James Ross 3520a65099
Restore lost continue statement (#4965)
Commit 140b769a42 separated the `continue` from its block, so this puts it back
2024-03-17 21:16:54 -04:00
Mike Degatano 98779a48b1
Fix check used for addon auto update (#4933)
* Fix check used for addon auto update

* Move timedelta to other side

Co-authored-by: Stefan Agner <stefan@agner.ch>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-02-29 11:22:21 -05:00
Mike Degatano 7fd6dce55f
Migrate to Ruff for lint and format (#4852)
* Migrate to Ruff for lint and format

* Fix pylint issues

* DBus property sets into normal awaitable methods

* Fix tests relying on separate tasks in connect

* Fixes from feedback
2024-02-05 11:37:39 -05:00
Stefan Agner 190894010c
Reset failed API call counter on successful API call (#4862)
* Reset failed API call counter on successful API call

Make sure to reset the failed API call counter after a successful
API call. While at it also update the log messages a bit to make it
clearer what the problem is exactly.

* Address pytest changes
2024-01-31 11:41:21 -05:00
Mike Degatano 140b769a42
Auto updates to new version delay for 24 hours (#4838) 2024-01-30 08:58:28 -05:00
Mike Degatano ddadbec7e3
Addon devs can block auto update for breaking versions (#4832) 2024-01-26 08:08:03 +01:00
Mike Degatano 480b383782
Add background option to backup APIs (#4802)
* Add background option to backup APIs

* Fix decorator tests

* Working error handling, initial test cases

* Change to schedule_job and always return job id

* Add tests

* Reorder call at/later args

* Validation errors return immediately in background

* None is invalid option for background

* Must pop the background option from body
2024-01-22 12:09:15 -05:00
Mike Degatano b7ddfba71d
Set max reanimation attempts on HA watchdog (#4784) 2023-12-21 16:44:39 +01:00
Stefan Agner 38d5d2307f
Bump tooling to target Python version 3.11 (#4666) 2023-11-03 12:02:55 +01:00
Mike Degatano 31200df89f
Addon methods interfacing with docker are job groups (#4659)
* Addon methods interfacing with docker are job groups

* Add test for install
2023-11-02 11:28:48 +01:00
Mike Degatano 0cd7bd47bb
Skip watchdog API test on landingpage (#4588)
* Skip watchdog API test on landingpage

* Skip check from task
2023-09-29 09:17:22 -04:00
Pascal Vizeli 1eb95b4d33
Remove old add-on state refresh (#4504) 2023-08-24 11:04:31 -04:00
Mike Degatano 93ba8a3574
Add job names and references everywhere (#4495)
* Add job names and references everywhere

* Remove group names check and switch to const

* Ensure unique job names in decorator tests
2023-08-21 09:15:37 +02:00
Mike Degatano 254ec2d1af
Addon startup waits for healthy (#4376)
* Addon startup waits for healthy

* fix import for pylint

* wait_for to 5 in tests

* Adjust tests to simplify async tasks

* Remove wait_boot time from addons.boot tests

* Eliminate async task race conditions in tests
2023-06-20 10:13:15 -04:00
Mike Degatano b4fd5b28f6
Use backup mounts (#4289)
* Add support for backup mounts

* Fix tests

* Allow backups to local when there's a default location
2023-05-16 14:08:22 -04:00
Mike Degatano 14fcda5d78
Sentry only loaded when diagnostics on (#3993)
* Sentry only loaded when diagnostics on

* Logging when sentry is closed
2022-11-13 21:23:52 +01:00
dependabot[bot] a2dffe595e
Bump pyupgrade from 3.1.0 to 3.2.0 (#3979)
* Bump pyupgrade from 3.1.0 to 3.2.0

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

* Fixing pyupgrade

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-11-08 19:38:55 +01:00
Mike Degatano fc646db95f
Reduce connectivity checks (#3836)
* Reduce connectivity checks

* Fix/remove connectivity tests

* Remove throttle from prior connectivity tests

* Use dbus_property wrapper

* Allow variable throttle period with lambda

* Add evaluation for connectivity check disabled
2022-09-03 09:48:30 +02:00
Mike Degatano 5fc9484f73
Supervisor updated before addon repositories (#3795) 2022-08-17 07:28:06 +02:00
Mike Degatano 96065ed704
Bump to python 3.10 and alpine 3.16 (#3791)
* Bump to python 3.10

* 3.10 is not a number

* Musllinux wheels link

* Revert attrs 22.1.0 -> 21.2.0 for wheel

* Revert cryptography for wheel & pylint fix

* Precommit and devcontainer to 3.10

* pyupgrade rewriting things

* revert

* Update builder.yml

* fix rust

* Update builder.yml

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-08-16 14:33:23 +02:00
Mike Degatano c8f184f24c
Add auto update option (#3769)
* Add update freeze option

* Freeze to auto update and plugin condition

* Add tests

* Add supervisor_version evaluation

* OS updates require supervisor up to date

* Run version check during startup
2022-08-15 12:13:22 -04:00
Mike Degatano d097044fa8
Update supervisor before auto-updating others (#3756) 2022-07-28 12:29:05 -04:00
Mike Degatano d19166bb86
Docker events based watchdog and docker healthchecks (#3725)
* Docker events based watchdog

* Separate monitor from DockerAPI since it needs coresys

* Move monitor into dockerAPI

* Fix properties on coresys

* Add watchdog tests

* Added tests

* pylint issue

* Current state failures test

* Thread-safe event processing

* Use labels property
2022-07-15 09:21:59 +02:00
Pascal Vizeli e92d8695c7
Cleanup API / old rebranding (#3623)
* Cleanup API / old rebranding

* cleanup p2

* next round

* better comments

* cleanup import

* support only installed add-ons

* legacy migration

* test fixes

* add old env back

* revert for Core

* fix issues with old core

* fix

* using installed short cat

* revert

* extend legacy

* cleanup

* fix path

* Fix missing

* add stop

* readd old token

* Add minimal

* extend attributes

* Add repo back

* add more repo info

* Make it working

* Bump frontend to e7848262 (#3680)

* Add icon

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-06-21 15:19:04 +02:00
Mike Degatano ccd2c31390
Move repository urls to store settings file (#3665)
* Move repository urls to store settings file

* Remove default repos from supervisor config

* Fix clone at initial store load

* Mock git load in repository fixture
2022-06-07 10:02:21 +02:00
Mike Degatano 8bb4596d04
Add API option to disable fallback DNS (#3586)
* Add API option to disable fallback DNS

* DNS unsupported evaluation and fallback in sentry
2022-04-25 18:15:40 +02:00
Pascal Vizeli 71903d906b
Create a backup on add-on auto update (#3464) 2022-02-24 20:26:57 +01:00
Joakim Sørensen d0e2c8b694
Split homeassistant watchdog conditions (#3318) 2021-11-29 17:03:49 +01:00
Joakim Sørensen 23143aede4
Add all_plugins to cleanup code (#3166) 2021-09-29 18:23:25 +02:00
dependabot[bot] dafc2cfec2
Bump pyupgrade from 2.26.0 to 2.26.0.post1 (#3131)
* Bump pyupgrade from 2.26.0 to 2.26.0.post1

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.26.0 to 2.26.0.post1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/commits)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

* Fixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-21 18:22:56 +02:00
Pascal Vizeli 271e4f0cc4
Support OS-Agent Data disk (#3120)
* Support OS-Agent Data disk

* fix lint

* add tests

* Fix empty path

* revert change

* Using as_posix()

* clean not needed cast

* rename

* Rename files
2021-09-17 15:01:07 +02:00
Joakim Sørensen 419f603571
Rename snapshot -> backup (#2940) 2021-07-27 10:06:09 +02:00
Pascal Vizeli 2b6829a786
OS-Agent support (#2811)
* OS-Agent support

* add agent to host feature

* Add support for os-agent on devcontainer

* Rename core

* fix tests

* add setter

* add cgroup / apparmor

* all interfaces added

* fix import

* Add tests

* More tests

* Finish tests

* reformating xml files

* fix doc string

* address comments

* change return value

* fix tests

* Update supervisor/dbus/agent/__init__.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Update scripts/supervisor.sh

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-06-30 11:55:53 +02:00
Pascal Vizeli 3b1ad5c0cd
Run API watchdog only if core is running (#2961)
* Run API watchdog only if core is running

* negate

* fix comment
2021-06-16 11:45:06 +02:00
Pascal Vizeli adf355e54f
Fix API watchdog never trigger (#2958) 2021-06-14 14:11:22 +02:00
Pascal Vizeli 6a0206c1e7
Next generation hardware handling (#2429)
* Next generation hardware handling

* need daemon for some details

* fix tests

* fix wrong coresys lookup

* test initial import

* test device lookup

* validate if device exists

* Add cgroups rules manager

* mapping udev from host

* Modify validation/options handling

* lookup devices

* add support for host udev mapping

* next

* Add policy support to add-ons

* Depricate hardware trigger call

* next cleanup round

* detect USB linking

* optimize

* readd udev utils for backwards compatibility

* fix tests

* Add more tests

* fix tests

* Make device explicit

* Add filter

* work on tests

* Add migration step

* clean out auto_uart

* Fix all tests

* Expose all device information

* small  improvment

* Fix loop over right devices

* Use migration for new device format

* Update rootfs/etc/cont-init.d/udev.sh

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Fix old helper

* Fix API

* add helper for by-id

* fix tests

* Fix serial helper

* Fix hardware API schema

* Hide some virtual devices from tracking

* Apply suggestions from code review

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Update supervisor/addons/validate.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Update supervisor/addons/validate.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

* fix lint

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* fix black

* fix lint

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-01-28 15:26:56 +01:00
Pascal Vizeli 59102afd45
Fix sentry with sets (#2323) 2020-12-02 12:43:38 +01:00
Pascal Vizeli 0b085354db
Send list of images to sentry (#2321) 2020-12-01 14:29:37 +01:00
Pascal Vizeli 49853e92a4
Fix sentry spam (#2313) 2020-11-30 11:01:10 +01:00
Joakim Sørensen 841520b75e
Strip device names (#2303) 2020-11-26 22:40:54 +01:00
Pascal Vizeli 056926242f
Fix sentry resoluton messages (#2295) 2020-11-24 14:17:47 +01:00
Pascal Vizeli 7e94537e36
Soft restart supervisor (#2281)
* Add softrestart to supervisor

* decouble

* adjust logger

* make sure it need run

* Use job condition

* add more job running
2020-11-21 12:48:16 +01:00
Pascal Vizeli 3dd3340e35
Make host feature cheaper to call and relay on it (#2266) 2020-11-18 14:13:49 +01:00
Pascal Vizeli 80f4309799
Enforce internet host/system (#2263) 2020-11-18 11:29:23 +01:00
Pascal Vizeli 4b500ef873
JobManager should not touch our exceptions (#2261)
* JobManager should not touch our exceptions

* Add tests

* temporary allow su update all time

* Update supervisor/jobs/decorator.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2020-11-17 18:46:02 +01:00
Pascal Vizeli 2040102e21
Handle Unhealthy like Unsupported (#2255)
* Handle Unhealthy like Unsupported

* Add tests

* Add unhealthy to sentry

* Add test
2020-11-14 16:16:00 +01:00
Pascal Vizeli 5552b1da49
Optimize flow / reduce call time (#2250)
* Optimize flow / reduce call time

* rename

* freeze too

* add connectivity task

* use newstyle timeout

* Fix tests

Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2020-11-13 12:19:10 +01:00
Joakim Sørensen a18b706f99
Add JobManager and Job decorator (#2225)
* Adds condition decorator to block execution that require internet

* Fix exsisting tests

* Add internet state to network info

* Add healthy condition

* Add tests

* It's all changed

* rename
2020-11-12 22:57:28 +01:00
Pascal Vizeli cd34a40dd8
Send issues with sentry report (#2246) 2020-11-12 14:57:04 +01:00
Pascal Vizeli f71549e3df
New fix for stale container on network (#2189)
* New fix for stale container on network

* fix core repair

* Clenaup before attach to network

* Fix reload

* Fix host network

* Fix prune network

* Remove refresh

* Fix unpack

* better name

* clean order

* Add comment why

* more comments

* Update supervisor/misc/tasks.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2020-10-30 10:03:05 +01:00