192 Commits

Author SHA1 Message Date
Eric Callahan
fccffa96c6
build: replace dbus_next with dbus_fast
The dbus_next dependency is no longer maintained.  Replace
it with dbus_fast, which is a fork and drop in compatible.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2025-01-12 07:39:35 -05:00
Eric Callahan
c79ba01dba install: support for package requirement specifiers
Initial support for pip-like requirement specifiers applicable
to system packages.  This allows for a package dependencies
specific to distribution version.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2025-01-09 16:28:03 -05:00
Eric Callahan
a4604e3380
python_deploy: fix github dev channel updates
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-12-22 07:38:06 -05:00
Eric Callahan
7117cfc273
python_deploy: minor reporting fixes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-25 12:46:21 -04:00
Eric Callahan
92ce2a5a5d
update_manager: correct base configuration
Remove deprecated "host_repo" option, update Klipper's venv args to invoke Python 3.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-25 10:27:21 -04:00
Eric Callahan
003acd5f64 update_manager: fetch klipper paths from klippy_connection
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 16:35:37 -04:00
Eric Callahan
484551e5bf app_deploy: streamline type and channel config
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 16:35:37 -04:00
Eric Callahan
96b1c22e28 update_manager: add support for python applications
Signed-off-by:  Eric Callahan <arksine.code@gmail.com
2024-07-24 07:37:08 -04:00
Eric Callahan
b8921ca593 python_deploy: support for updating python apps
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 07:37:08 -04:00
Eric Callahan
0ff1d79b5b server: improve add_warning method
Add an exc_info parameter that optionally takes an
exception that is passed to the logging function. This
will log the traceback without an additional logging call.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 07:37:08 -04:00
Eric Callahan
ecb6ebcc18 pip_utils: bump pip version to 24.0.0
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 07:37:01 -04:00
Eric Callahan
0fb48fb9bf app_deploy: separate out pip update method
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 06:29:59 -04:00
Eric Callahan
4e8d50367d app_deploy: fix unbound variable
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 06:29:59 -04:00
Eric Callahan
7f89bd7d62 git_deploy: limit corruption detection
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-05-28 16:13:13 -04:00
Eric Callahan
fa1dc438fa git_deploy: add support for pinned commits
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-05-25 12:30:56 -04:00
Eric Callahan
379a26600c
update_manager: use temporary file storage for iids
The default behavior of systemd is to remove shared memory
files when the user that created them logs out.  This breaks
instance ID tracking for most installations.  While its possible
to overcome this by changing the user type or the logind
configuration, these solutions required elevated privileges.
The simple solution is to store iids in a temporary file, with
access protected by a flock.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-04-27 10:52:22 -04:00
Eric Callahan
10dfb0d477
update_manager: improve instance detection
Implement instance package wide for the update_manager.  This
only requires detecting multiple instances once and eliminates
costly calls to git.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-03-11 06:26:17 -04:00
Eric Callahan
90e13c07f7
git_deploy: fix initialization regression
New repos have not yet saved the valid state, so it is necessary to
provide a default value when attempting to access the "is_valid"
field.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-24 05:40:33 -05:00
Eric Callahan
119f579a44
git_deploy: improve refresh error handling
Save repo state if an exception is raised during a refresh
attempt.   Add additional repo warnings with for better
descriptions regarding repo issues.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-23 18:22:38 -05:00
Kamil Domański
04b1103778 Allow configuring the update refresh window
This enables customizing the time of day within which periodic refresh occurs.

Previously docs said it happens between 12am-4am which is misleading,
because the code effectively allowed refresh until 4:59:59 AM.
The default window is now '0-5', which is practically the same as before.

The comment about checking every 24h hours has been fixed as well.
This hasn't been true since commit c4fa76f21792943ea512d24326259f01d2fa7e89

Signed-off-by: Kamil Domański <kamil@domanski.co>
2024-02-17 12:41:51 -05:00
Eric Callahan
3f7cae09bb
git_deploy: specify branch in clone command
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-27 17:31:27 -05:00
Eric Callahan
994123e92e
update_manager: use ZipDeploy to instantate web types
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:05 -05:00
Eric Callahan
8010c51521
app_deploy: add support for web types
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:05 -05:00
Eric Callahan
55454a300e
zip_deploy: bring up for usage
This performs a significant refactor to the ZipDeploy class, making it near identiical to WebClientDeploy.  Zipped applications have the same
"release_info" requirement as web clients.  Unlike web clients, they may also
configure the dependency and service options available to git repos.

The ZipDeploy class can also support we clients, eliminating duplicate code
and the need to keep web_deploy.py.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:04 -05:00
Eric Callahan
daad786072
git_deploy: move generic dependency methods to app_deploy
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:04 -05:00
Eric Callahan
c196f7548c
update_manager: workaround zipfile permission issues
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-16 12:35:38 -05:00
Eric Callahan
ddd735feba
refactor: convert klippy_connection into a component
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-13 15:15:15 -05:00
Eric Callahan
cf99b78489
app_deploy: use pip_utils for python package updates
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-13 15:15:13 -05:00
Eric Callahan
f1de614027
shell_command: refactor retrires to attempts
This is consistent with the http_client.  The argument "attempts" is more
accurate than retries, as the first attempt is not a retry.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-11 16:51:41 -05:00
Eric Callahan
3008a13efb
update_manager: fix web_deploy persistent_files
If the destination file exists it is necessary to explicitly use
the filename to overwrite.  Otherwise an error is generated.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-10 12:00:36 -05:00
Eric Callahan
6e6388d673
update_manager: fix race condition
Previously the Klipper repo location can be changed outside of
the lock.  If the location of the Klipper path is moved while an autorefresh is occurring it is possible for Moonraker to call refresh
and/or notify_update_refreshed before the repo has been initialized.

This commit moves the re-assignment of the "klipper" updated inside
the lock.  In addition AppDeploy._is_valid is now defined in the
__init__() method.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-06 11:54:33 -05:00
Eric Callahan
36b5b9f4dd
update_manager: bump pip version
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-12-28 16:37:00 -05:00
Eric Callahan
19422819da
app_deploy: add support for pip environment vars
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-12-28 08:05:43 -05:00
Eric Callahan
b18e9cc222
all: Replace strings with RequestType flags
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-12-16 16:21:20 -05:00
Eric Callahan
6e8b720d17
job_state: combine events into a single handler
Emit a single event where the first argument contains
a "JobEvent" enumeration that describes the particular
event.  This reduces the number of callbacks registered
by JobState consumers and allows them react to multiple
state changes in the same callback.

The individual events remain for compatibility, however
they are deprecated.  Current modules should be updated
to use the "job_state:state_changed" event and new modules
must use this event.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-12-16 16:21:20 -05:00
Eric Callahan
40011370a3
update_manager: improve Klipper detection
If the Klipper installation is not updatable (ie not a git repo)
abort reinstantion of the deployer.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-11-02 06:19:14 -04:00
Eric Callahan
d721ec5d9c
update_manager: fix linter errors
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-10-07 10:36:49 -04:00
Eric Callahan
f99e5b0bea
utils: add support for msgspec with stdlib json fallback
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2023-10-06 18:20:28 -04:00
Eric Callahan
3d9052d711
git_deploy: detached head verification fix
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-08-14 08:13:51 -04:00
Eric Callahan
8ad19e6054
web_deploy: return repo name in status response
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 15:35:13 -04:00
Eric Callahan
5a0dde2017
update_manager: introduce anomalies field
This allows Moonraker to report anomalies detected in an updater
that won't prevent an update.  Front ends may decide to present
these to users in a more subtle fashion so they know the state of
the repo without being concerned of an issue.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-24 16:57:44 -04:00
Eric Callahan
871c551134
git_deploy: remove untracked file warnings
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-24 15:30:25 -04:00
Eric Callahan
3e1919b46e
git_deploy: improve pristine detection
Detect untracked source files and modified files for each
configured repo.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-21 06:11:00 -04:00
Eric Callahan
9b1eed534b
update_manage: move web update deployer to its own module
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-14 12:43:57 -04:00
Eric Callahan
f46cc32be3
update_manager: move package management to its own module
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-14 12:40:18 -04:00
Eric Callahan
4f785cfca0
update_manager: clarify web client git warning
When the parent folder of a web client is a git repo note the specific
directory that contians a .git subdirectory.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-14 12:40:17 -04:00
Eric Callahan
db27fef6f2
git_deploy: only return tags merged in the remote branch
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 10:31:39 -04:00
Eric Callahan
0437d1623e
git_deploy: improve recovery implementation
After performing a recovery attempt to reset to the commit the
repo was at prior to the repo failure.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 08:22:29 -04:00
Eric Callahan
4443bfbd41
update_manager: improve package manager logging
Assign a custom prefix for the configured provider.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 07:58:41 -04:00
Eric Callahan
01141fa10e
git_deploy: validation improvements
Add a check for shallow repos and move validation logic to the
GitRepo class.  Additionally report the real number of commits behind.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 07:58:41 -04:00