The varous forks of PrusaSlicer are processed identically
outside of their identifier, so there is no need to
implement new classes for each fork.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Raise an exception when a request with Basic Auth is received, however do not log the username/password.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add --allow-releaseinfo-change to the call to apt-get. This resolves an issue where the repos are chaning their "Suite" value from stable to oldstable with the release of Debian Bullseye.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Wait until update manager init is complete before attempting starting the auto refresh periodic callback. This prevents an auto refresh from blocking init if Moonraker is started during the auto refresh window.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This adds a thin wrapper around asyncio's eventloop. Generally it is similar to Tornado's IOLoop, however without the need to support all awaitables.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The delayed callback to "log_last_stats()" in the Watchdog shold not have its return value assigned to the watchdog handle.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
All calls to update now return a boolean value. When performing a full upate this return value is used to
check if Moonraker should wait for Klippy to reconnect.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This ignores an attempt to update packages if system updates are disabled and opens the possibility for supporting updates for other linux distributions.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Transion away from Tornado's wrappers, as their implementation of
"wait()" can be confusing. Some of tornado's methods require that
you specify a delay in seconds, others requrire that you specify a
timeout relative to the Unix epoch.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The underlying deployment implementations use locks to prevent concurrent attempts at refeshing state, thus the "is_refreshing" check is redundant.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This allows Moonraker to report download progress. This also resolves potential issues with I/O blocking the event loop.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This is the first step toward creating mutliple methods for deployment. This patch creates a base class for all deployment objects and a base class for application deployment. The git functionality has moved to its own module.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Remove the "distro" config option as it is not necessary. If there is a need to identify the linux distribution that can now be done through the distro dependency.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Rather than add these arguments to the config, use a method to access them from the server object.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This creates a generic utility for retreiving the git version. Moonraker will now attempt to parse basic version info from a ".version" file if git describe fails.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The importlib module will raise an exception if the component does not exist, so the check is redundant. This allow allows packages to be loaded.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Initially rebuilding the venv was required to change env options to include dist packages. This is no longer necessary so we can remove detection for it. Building a venv could still be necessary, so move this functionality to its own method.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
These options are no longer necessary, as we now apply the dist path before the import in modules that require dist packages.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Rather than symlink the gpiod dependency in a virtualenv, temporarily add the dist-package to sys.path then import gpiod.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This resolves a potential issue where clients could anticipate that all items in the status parameter are objects.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Rather than require consumers handle the TimeoutError, handle it directly and return the connection state.
SIgned-off-by: Eric Callahan <arksine.code@gmail.com>
Perform reads in a thread so File I/O does not block.
This patch also disables ETags for static files. Tornado's default behavior of caching file hashes will not work as many of Moonraker's can be updated. The previous workaround to this was to recalculate the checksum if the modified date changed. This is inefficient as its behavior is not much different than using "If-Modified-Since".
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use the PeriodicCallback in proc_stats to check if the event loop was blocked for a More than 5 seconds. If this is detected, log
Moonraker's CPU usage over that time.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This should prevent large file uploads from blocking the asyncio event loop for a long period of time.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Implement a write buffer so that all calls to "write_message" are awaited. This allows for more graceful shutdown if the websocket is closed.
When Moonraker shuts down, attempt to wait for all websockets to close before exiting.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add references to the application's "get_websocket_manager" and "register_api_transport" methods.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This allows eligible components to register themselves as API transports. By default the WebsocketManager is registered.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Some components require post-load initialization after the IOLoop has started. Provide a method for these components to register a failure with the server.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This switches Moonraker from calling `CANCEL_PRINT` and alikes
to rather use `pause_resume/` API that underneath calls
the relevant G-Codes.
This done, this way, allows Klipper to be able to interrupt
blocking operations gracefully.
Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
Keep track of the number of unsafe shutdowns a machine experiences. This data is useful in diagnosing potential file system issues and issues with the datbase itself.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It is invalid for a namespace to contain a top level key represented as an empty bytestring. If this is detected, log the result and drop the invalid key.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>