Repository navigation
Releases
Releases · muruhq/muru
0.1.0-alpha.34
Added
- Added an application data directory shared by every release, given to the
release's host, workers and commands asMURU_DATA_DIR, with a media part
(MURU_MEDIA_DIR), which is a file hint root of every mount and is named
media:insendfile_rootsand static entries, and an uploads part
(MURU_UPLOADS_DIR), never served and whereupload.save()now puts a
file by default. It isSTATE/data/APPunder the daemon ([app.NAME] data_dir,media_diranduploads_dirmove it),runs/NAME-HASH/data
in the user state directory undermuructl run(--data-dir), and a
volume named with--data-dirundermuructl serve;muructl data show,
muructl data checkandmuructl status --appreport it, andmuructl app remove --dataremoves it.
(#849) - Added a directory of each release's own for built static files, given as
MURU_STATIC_DIRand namedstatic:in a static entry, so
collectstaticrun as abefore_forkgate never writes into a shared
source directory:STATE/static/APP/RELEASEunder the daemon, made empty
with the release and removed with it, beside the run's data directory
undermuructl run, andstaticfilesin the project undermuructl serve(--static-dir).
(#850)
Changed
- On a terminal,
muructl status --processesfits the terminal's width:
figure columns empty in every row are left out, a long WHAT is cut with
an ellipsis, columns that still do not fit are left out and named, and
the instance's figures wrap. A daemon's state directory is on a line of
its own above the table, and in--jsonasstate_dir, so the daemon's
row isuser daemonorsystem daemon. (#840) muructl status --processesnames a managed server's instance by the
program its command runs, such asgunicorn, rather than its
interpreter, and lists the processes the instance started, such as
gunicorn's workers, without--all, under the roleserver-worker. (#841)- A relative
sendfile_rootsentry is now taken from the release's source
directory, in[tool.muru], in--sendfile-rootand in an applied
release table alike, and must be a directory there when the release is
deployed ormuructl runstarts; a root may be a symbolic link, and is
opened afresh when it is pointed somewhere else.
(#847) - A path hint (
X-Muru-Sendfile, orX-Sendfilein compatibility mode)
from an application Muru's workers serve is now opened by the worker as
the application's user, within the mount'ssendfile_roots, and handed to
the edge open, so the edge's user needs no access to the file and one
written0600is served; it keeps Range, conditional requests, ETag,
Last-Modified and HEAD, and now gets a precompressed.br,.zstor
.gzvariant beside the file as a static route does.
(#848) - The data directory, the uploads part and any directory containing either
are refused as asendfile_rootsentry or a static directory, anddata:
anduploads:with them, andmuructl runno longer says that nothing is
persisted. (#849)
Fixed
- A daemon adopting a release whose log relay was just replaced finds the
relay, where before it could read the relay's record while it was being
rewritten and take the release for one with no relay. The daemon's other
records, its pid file, its instance ID, the run'spidfile and a
serve'sserve.jsonare written the same way, whole or not at all. (#833) - In a development run, the GIL stall timeout again answers every request
the stalled worker held at once,502with the reasonworker_stalled.
A request that reached the worker while the GIL was held had waited for
the worker to be killed and was answeredworker_crashed. (#836) - A daemon listener that cannot bind its address names the program and pid
holding it, asmuructl rundoes, when that program is not Muru's, and
so does a listener a reload adds. (#837) - When a run reloads, the lines the new release's workers write while they
start, such as those ofpost_forkandon_readyhooks, are printed
beforeswitched to release rN, rather than sometimes after it and after
the old release'son_drainlines. (#838) - After a settings file changes under
muructl run, a setting only a
restart applies is named once, against the file it changed in. A later
reload no longer names it again against whichever settings file changed
last. (#839) - The GIL stall timeout answers an ASGI request that reached the worker
while the GIL was held at once too,502with the reason
worker_stalled, rather than when the worker is killed with
worker_crashed. Two such requests no longer hold up every other
connection to the worker until the GIL is free. (#842) - The host logs
preloaded APP in N msonce the application is imported
and before itson_loadhook runs, with N the import's time alone, so
the hook's output follows the line rather than coming before it. A
hooks module'son_loadandpre_forkeach get a line of their own
once they return, such ason_load hook ran in 500 ms.
muru_release_load_secondsstill counts theon_loadhook. (#846)
Security
- Static files and files named by
X-Muru-Sendfileare now opened beneath
their directory's open descriptor and read from that open file, so nothing
that can write inside the directory can swap a path for a symbolic link
and lead the edge out of it between a check and the open; a symbolic link
inside is followed only when its target is relative and stays inside, so
an absolute link is no longer served even when it names a file inside the
directory. (#847)
0.1.0-alpha.33
Added
- Every Muru instance on a machine, a daemon, a
muructl runor amuructl serve, registers itself in one registry per user, inregistryin the user's default runtime location whatever its run directory, with one entry each that only its owner writes and that is live while its owner holds a lock on it. A daemon keeps its instance ID in its state directory,muructl status --jsonreports the ID and the hostname, andmuructl cachereads what each live instance uses from its entry. (#805) - Added
muructl instance list, which lists every Muru instance on the machine, daemons, development runs and serves, from the instance registry, eachrunning,detachedorstalewith its pid, uptime, listeners, dashboard and where it works from, and with--orphansthe Muru processes no live instance accounts for, exiting 1 when there are any;--label,--kind,--all-usersand--jsonnarrow and shape it, the read-only MCP toolinstancesreturns it, andmuructl statuswith nothing listening says how many instances it shows. (#807) - A port another instance of Muru's holds is named as that instance when a bind fails, in
muructl run,muructl serve, the daemon's listeners and a dashboard's address,port 8000 on 127.0.0.1 is in use by the development run of shop in ~/src/shop (pid 4123, dashboard http://127.0.0.1:8001/), before falling back to lsof or ss,muructl daemon startrefuses an address a running instance holds before it starts anything, andmuructl instance list --portslists the ports every instance uses or is configured to use, with the clashes between them. (#808) - Added
muructl instance prune, which removes stale instance registry entries and stops orphaned Muru processes, SIGTERM and after a grace period SIGKILL, each pid checked by its start time first so a reused pid is never signalled, after listing what it will do and asking; a detached daemon's edge and hosts are left unless--detached, and--label,--instance,--entries-only,--grace,--dry-run,--yesand--jsonnarrow and shape it. (#809) - Added named daemon instances:
muructl instance create NAME --listen ADDRESSdefines one in the configuration area, with aninstance.tomland its ownmuru.toml,--instance NAMEorMURU_INSTANCEon the daemon's commands puts every location underinstances/NAMEsomuructl daemon start --instance devneeds nothing else,muructl instance listshows a defined instance that is not running asstopped,muructl instance removeremoves one, with--stateits state and logs too, and a systemd template unit,muru@.service, runs one by name. (#810) - Commands that talk to a daemon reach a named instance by
--instance NAME, byMURU_INSTANCE, or byinstance = "NAME"in the checkout'smuru.local.toml, a key of that file alone, with no machine-wide current instance; a development run of the checkout still answers first what it can, saying so, a change sent to a named instance says where it went,muru: deploying shop to instance dev (from muru.local.toml), with aninstancefield in--jsonoutput,muructl mcp servesettles its instance once at start, and the commands that work only on this machine's processes and files say so for an instance that is not on it. (#811) - Added
muructl open, which opens the current project's application, an application on a daemon, or with--dashboardan instance's dashboard, signed in, in the browser on this machine, a run's URL coming from its registry entry and a daemon application's from its routes, virtual hosts and listeners, best first and leaving out names that reach another machine;--print,--listand--jsonprint the URLs instead,muructl run --openopens the application once the run answers, the dashboard lists each application's addresses, and the read-only MCP toolurlsreturns them. (#815)
Changed
- A development run keeps its admin socket, its
pidfile and its releases' run directories in a directory of its own named by its instance ID,RUNTIME/run-7f3a9c2e, in place ofRUNTIME/runs/PORTand a directory under the temporary directory, andrun.jsonis gone: commands find runs through the instance registry, so a run killed outright is never reached, and two runs on one port on different addresses no longer collide. (#805) - Every process of a Muru instance names its instance: a host's, a log relay's and a worker's process title ends with it in parentheses,
muru host shop@r3 (user)ormuru worker blog@r1 default/0 (run:8000), a daemon started with its own--state-dir, and its edge, add its short instance ID, and every process the daemon, a run or a serve starts, and everything those start, hasMURU_INSTANCE_IDandMURU_INSTANCEin its environment. (#806) MURU_SOCKETis read alongsideMURU_INSTANCE, and setting both is refused, as giving--socketand--instancetogether is. (#811)- A dashboard login link may carry
next, a relative path under the dashboard to go to once signed in, whichmuructl open --dashboard --request IDuses. (#815) - A managed server's instance is given its index as
MURU_SERVER_INDEXin place ofMURU_INSTANCE, which now names the Muru instance in the environment of every process Muru starts. (#816)
Fixed
- A second daemon started on the state or run directory of one already running is refused before it touches anything, naming the daemon that has the directory, its pid and its admin socket, where before it took over the first daemon's admin socket and edge and left the first running but unreachable by
muructl daemon statusandmuructl daemon stop.muructl daemon startreports the same refusal. (#804) muructl instance pruneandmuructl instance removeremove a stale registry entry even when another command is reading the registry at the same moment, where before they could leave it, saying its owner held its lock again. (#818)- A daemon that restarts while
muructl instance pruneremoves its stale registry entry registers afresh, where before it could run with no entry a command could find, or have its new entry removed by the prune. (#819)
0.1.0-alpha.32
Added
- A release with tracing on says at start-up where its wrapture configuration came from and what it instruments,
tracing on: wrapture configuration from [tool.wrapture] in ./pyproject.toml, instrumenting flask, sqlite3, and when tracing cannot apply, a one-line warning that the release is served untraced, and why. (#781) - A request that waits on a module another request in the worker is still loading for the first time now says so: its record's Timing panel has a "waiting for an import" row naming the module and the request loading it,
Server-Timinghas animport_waitentry apart fromimport, and the "modules loaded on first use" hint counts the wait too. (#787) - The workers section of
muructl debug importssays, for each import the host's load deferred, how many of the workers have loaded it so far: none, "the deferral is paying off"; some, loading on first use pays off; every one, thepreload_modulesadvice. (#793)
Changed
lazy_importsandimport_reportnow need unwrapt 1.0.0a5 or later in the project's environment, and a release with an older one starts without deferral or a report, with the two versions in the log.
Fixed
muructl runstops with an error naming the process that holds its dashboard's address, as it does for its HTTP port, rather than serving without a dashboard while the browser and the toolbar's links reach whatever holds it; the dashboard's banner names the run's project directory and start time. (#750)overlay.warminggives the overlay'sleadas it declares it, "its window begins in 1m" for a lead of1m, where it said "in 59s" because the daemon sees the lead begin a moment late; a warm-up that begins later in the lead, after an apply or a restart, gives the time left. (#756)- Fixed the workers section of
muructl debug imports: its heading reads "Modules loaded for the first time since the fork, by the 2 workers that answered", and a private module such as_osx_supportis never suggested forpreload_modules; the suggestion names the nearest public module whose load contained it, or none. (#763) muructl run's process title names its HTTP and dashboard addresses,muru run shop 127.0.0.1:18631 dashboard 127.0.0.1:8081, so a run can be found by its port, and the run prints its process id at start-up and writes it topidbeside its admin socket, for a script to stop the run it started. (#764)- A promoted overlay is no longer activated again, by hand, by the webhook or by its trigger, which for a pin sent every request back to the release it promoted; it stays
promoteduntil an apply changes or removes it. (#776) - muructl prints a command's error as one line,
muru: error: MESSAGE: CAUSE, on a terminal as it does elsewhere, where a terminal showedError:with aCaused by:section; the guides' examples show the same line. (#777) - The configuration reference and the error pages, overlays and client classes guides now state one rule for paths: a relative path in a file given to
muructl applyis taken from that file's directory, and a release's own static directories and error pages from its source directory.muructl applynow does the same for an upstream's and a mount'ssendfile_rootsand a client class'sja4_list, which it sent as written. (#778) muructl applyrefuses an overlay whose error page file does not exist, and an overlay activation or end the edge refuses no longer stands: by hand it fails and the overlay keeps its state, and by schedule or condition it is skipped with anoverlay.skippedwarning giving the edge's reason, where before the overlay was recorded as active though not in force. (#779)muructl debug requestprints a capture's stack, and each of the worker's other threads, below its name with every line indented, where only the first line was; a value of several lines in a table a worker's panel adds keeps its lines in the toolbar and on the dashboard. (#780)- Fixed a request that loads more than 200 modules on first use keeping the innermost loads and dropping the outermost, which left the Timing panel's "importing modules" row short and had the "modules loaded on first use" hint name the wrong module; the record keeps the first 200 loads to start, and the workers' section of
muructl debug importsits first 2,000 the same way. (#782) - Fixed a reload of
muructl runfor a changedpyproject.tomlkeeping the[tool.muru]settings the run started with: every reload for a changed settings file (pyproject.toml,muru.toml,muru.local.tomlor the file--settings-filenames, all of them now watched) reads the settings again and the new release starts with them, and a changed setting only a restart applies is named on a line of its own. (#783) muructl debug importslists by default only the imports there is something to do about, naming under NOTES the module whose eager import keeps a row's saving at nothing, with--allfor every row; the imports compiled extension modules make as they load are credited to them and never advised, and the summary counts modules rather than top-level packages. (#784)- Fixed
muructl debug importsadvising to defer what apreload_modulesentry imports, which undid the list: nothing loaded for an entry is advised to be deferred, its rows are notedpreload_modules, and each entry's own load time is given on a line of its own. (#785) - An import a module's
__lazy_modules__or unwrapt'slazy_modulesnames that a load withlazy_importsoff imported eagerly is no longer shown inmuructl debug importsas already lazy with nothing to save: it keeps its cost, and the advice names the setting that is missing and where it is off;--targetnarrows the summary to the target, with the whole load's time beside it. (#786) - Fixed the import report missing every module first loaded by a
fromimport, Flask's own load among them: the import check now attributes what an import leaves through each module's loader and no longer loads modules itself, so the report counts them with their time and line, and advises afromimport only in the project's own code when its load takes at least 10 ms. (#788) muructl debug importsno longer advises deferring an import its module uses as it loads, which saves nothing, and the workers section lists a deferred import used as the module deferring it loaded, with the line, advising the entry's removal. (#789)muructl overlay promoterefused by the edge changes nothing and fails with the edge's reason, where before the promotion was recorded and the serving release switched though the edge kept the configuration it had, and an overlay whose end by schedule or condition the edge refuses raises anoverlay.end_refusedwarning (schedule.end_refusedfor an application's schedule) with the edge's reason. (#790)- A request waiting on a module another request in the worker is still loading is now shown as "waiting for an import" in the Timing panel, and as
import_waitinServer-Timing, when it asked throughimportlib.import_module, as Django does to load views, not only with animportstatement. (#794)
0.1.0-alpha.31
Changed
- An overlay whose
preconditions.probefails names the release it probed and the host it asked at, as in "its probe of shop@r2 failed: /healthz (as a preview, at host shop) answered 503 Service Unavailable", rather than the edge's listener. (#758) muructl overlay promotemakes the release an overlay pins the application's serving release, as a deploy would, rather than writing a pin into the route that later deploys never moved and the next apply undid. It refuses an overlay that pins only some of the application's routes, a client class's route, or splits traffic, and it prints what to put in the applied files for the next apply to keep the promotion.muructl release listandmuructl scale statusshow a release's share of each route that splits traffic on atraffic:line. (#759)
Fixed
- An apply that changes a scheduled overlay skipped by its preconditions clears the skip, so the overlay is judged again at its next window; one that changes its trigger clears an end by hand too.
muructl overlay listshows a skip with no end as lasting until the overlay is activated by hand or changed. (#755) overlay.warminggives the time until the window to the nearest second, and minute, so a lead of1mreads "its window begins in 1m" rather than "in 59s". (#756)muructl app listmarks an application an active overlay put in maintenance as[maintenance by overlay NAME], and one an overlay keeps out of it as[maintenance off by overlay NAME]; the dashboard's overview names the overlay too, and the JSON gives it asmaintenance_overlay. (#757)muructl logs --accessshowsclass=for a request whose client class is notdefault, andredirects=,retried=1andhandoff=where the edge's own text lines show them. (#760)
0.1.0-alpha.30
Added
- Added the modules a request loads for the first time in its worker to its record: the development toolbar's Timing panel draws them as "importing modules" and lists each with its time and the line that imported it,
Server-Timingcarries their time before the response head asimport, the Hints panel names them when they take a large share of the request, andmuructl debug statuscounts the modules each worker has loaded since the fork. (#738) - Added
preload_modulesto[tool.muru]and to a release's table: modules the host imports after the entrypoint and the mounts, and before theon_loadandpre_forkhooks, so a module the application only imports on first use is loaded once before the fork rather than in every worker. A module that cannot be imported fails the load,muructl checkimports and reports the list, and--print-configshows it. (#739) - Added
lazy_importsto[tool.muru],muru.local.tomland a release's table: with unwrapt in the project's environment, the imports a module names in__lazy_modules__are deferred to first use from Python 3.11, as Python 3.15 does natively, along with those unwrapt's own configuration lists for code the project does not own. Deferral stays in place through the fork, the host logs as it forks which deferred imports were used before it, the toolbar's Timing panel marks a module a request loaded through a deferred import, and--print-configshows the key and the unwrapt configuration the host finds. (#740) - Added
import_reportto[tool.muru],muru.local.tomland a release's table,muructl debug imports,muructl check --importsand animportstool inmuructl mcp serve: the host records its imports with unwrapt as it loads, each labelled with the entry point being loaded, and the report says what each import cost, who pays for it under preload, and what to defer or load before the fork, written as the__lazy_modules__,[tool.unwrapt.lazy_modules]orpreload_modulesentry to add; with each module the workers have loaded for the first time since the fork, by how many of them. The daemon keeps each release's report beside it, andmuructl runandmuructl servethe last four loads'. (#741) - "Muru" in the dashboard's title banner links back to the front page on every page: the run's page under
muructl run, the node's under the daemon. (#747) - Added a
release.loadedevent when a release's host has imported the application, giving how long it took and, withimport_reporton, the import report's headline figures; and the metricsmuru_release_load_seconds,muru_worker_load_seconds(a worker that imported the application itself), andmuru_worker_modules_loaded_totalandmuru_worker_module_load_seconds_totalfor the modules each worker has loaded for the first time since the fork. (#753)
Changed
- The host logged a worker that exited with a failure status or by a signal while the host stopped it, and the 502 for a worker that sent an unexpected frame before its response head said so, rather than that the worker sent no response head. (#734)
- The toolbar's Timing panel drew moments as moments and repeated waits one by one: the response head reaching the edge and the response starting became events, shown as a diamond with a dashed line through every row, the application's own time became "running the application", every wait for the GIL and every stretch with the event loop held was drawn as a segment on its row, and a tooltip on every bar, segment and event opened on hover, keyboard focus and tap.
muru.panels.Spantookatfor an event andsegmentsof the newmuru.panels.Segment, drawn the same way in panels of your own. (#737)
Fixed
- The open toolbar stayed within a narrow window, such as a phone's, scrolling a wide panel sideways, instead of running off the window's left edge. (#742)
- A dashboard section that refreshes no longer sends its scrollable regions, such as the output and the request tables, back to the top: each keeps its place, one scrolled to its end stays at the end as lines arrive, and a section is not refreshed while it is being scrolled. (#748)
0.1.0-alpha.29
Added
- A span in a spans panel can now be marked failed:
muru.panels.Spantakesfailed, aspan()block that an exception escapes is marked, and the Trace panel marks each operation an exception escaped or was noted against. The toolbar draws a failed span with a red outline and a mark beside its name, andmuructl debug requestand the record's JSON show it too. (#705) - The development toolbar's Errors panel now shows the evidence Muru captured of a timeout or a killed worker: the request's stack at a soft timeout, at its deadline or when its worker was killed, with the worker's other threads and links to the other requests in flight on it.
request.past_deadlinenames where the request was, and a record whose worker never sent its part says so in its Logs and Errors panels. (#706) - With tracing on, the development toolbar now has an Outbound panel: a request's calls to other services, grouped by method, host and path with how many times each was called and their total time, so an endpoint called once per row shows as one line, then each call with its URL and status. (#707)
- The development toolbar has a History tab: the run's recent document requests, newest first, with each redirect joined to the request it led to, so the POST of a form that redirects is a click away from the page it led to. (#708)
- The development toolbar has a Hints panel, the first of a record's panels, listing what stands out: a statement or an outbound endpoint repeated (N+1), a slow query or call, an HTML or JSON response that went out uncompressed, the event loop held, long waits for a worker or a thread, garbage collection, and an answer of Muru's own with the setting behind it. The badge counts the hints, and
muructl debug requestand the record's JSON carry them. (#709) - Added
cap_workersto overlays and capacity schedules, which caps a worker group at a count whatever its policy and floors say, draining the excess at once, andmuructl scale APP --cap N --for DURATION, which sets a temporary cap and waits until the group is under it. (#712)
Changed
- The development toolbar now appears on an HTML page with no
</body>, such as the error pages of Flask and other Werkzeug applications: for a browser loading the page, the edge appends its tag at the end. (#703)
Fixed
- With several
muructl runs of one project listening,muructlcommands reach the newest and name the others with their--socket, and a run started beside another of its project says so, where commands reached the run on the lowest port. (#714) - A worker killed for a timeout or a stall that cannot answer for its stacks, such as one whose thread holds the GIL in C or one stopped whole, still gives each request in flight on it a capture in its record, with the event's message, the worker, its pid and why. (#715)
- The development toolbar's Errors panel now shows a 500 that the application answered itself, as Flask and Django do after catching an exception, with the traceback the request logged, rather than nothing. (#722)
muructl runreloads a project kept in a directory that the repository around it ignores, such as another repository's scratch directory, by watching it with its own.gitignorealone, and says at start when no watched file matches the reload patterns. (#723)- A request a rate limit, a method restriction or a site mode refuses is counted in
muru_requests_totalunder the application it was routed to, so conditions on the application see it. (#724) muructl applywarns of an overlay whose route for a client class sends the class to a static snapshot while its condition reads that class's share of the application's requests, and the overlays guide's crawler example uses a rate limit, which the condition still sees. (#725)muructl condition listshows a condition waiting outforaspending, andcondition showsays how long itswhenorclear_whenhas held of the wait it needs, where it readunknown:with no reason before its first change. (#727)muructl overlay listkeeps its columns in line when an overlay's state or trigger is long, such asactive (condition)or a cooldown with its end. (#728)muructl applyno longer warns that an overlay withlatch = truetakes away the traffic its condition reads, since its condition does not end it. (#729)
Documentation
- Added a "Capacity on a condition" section to the scaling guide: an overlay triggered by a condition that warms one application while another is busy, or holds capacity while an upstream is down. (#711)
- Added the tutorial "Responding to traffic", in which a condition on the crawlers' share of a shop's requests is watched before it acts, then rate-limits them through an overlay, holds capacity while it fires, and shows why a response must not take away what its condition reads. (#713)
- Added the tutorial "Debugging a page", which finds and fixes the faults of a small Flask shop with the development toolbar and tracing: an N+1 query, a failing page, a call to another service per row, a form that redirects, a request past the soft timeout, and the hints that point at them. (#716)
- Added the tutorial "Commands and migrations", in which a small catalog with a sqlite database declares commands, runs its migration as a gate a release must pass, runs a backup detached from the terminal and the daemon, and puts a cleanup on a schedule. (#717)
0.1.0-alpha.28
Added
- Added named conditions:
[condition.NAME]withwhen,for,clear_when,
clear_forandmin_requests, in the daemon's file or an applied file,
written in a small PromQL-shaped language over Muru's own figures
(error_rate,request_share,latency,queue_depthand more). The
daemon evaluates each every second and raisescondition.firingand
condition.resolvedevents, andmuructl condition listandmuructl condition showgive their states and figures. (#123) - Added gates:
before_fork = trueon a declared command runs it as a release
starts, once its host has preloaded and before any worker forks, failing the
start if it fails, andbefore_promote = trueruns it just before a rollout
or blue/green promotion moves all traffic, stopping the promotion if it
fails. A gate runs once a release unlessevery_start = true, needs a
timeout, is always exclusive, runs under the daemon only, andmuructl release showlists the gates a release has passed. (#266) - Added schedules for declared commands:
schedule = { cron = "30 3 * * *", timezone = "Australia/Sydney" }runs the command under the daemon at those
times with the application's current release, andschedule = { at_boot = true }when the daemon starts from nothing. A scheduled command needs a
timeout, a run due while one is under way is skipped with a
command.skippedevent, each scheduled run is a detached run with the
triggerschedule, andmuructl command listshows each schedule and its
next run. (#268) - Added detached command runs:
muructl command run APP NAME --detachand
muructl exec APP --detach -- ...start a run that outlives its caller and
a daemon restart or upgrade, andmuructl command runs,status,logs
(with--follow) andstoplist, show, follow and stop runs. The daemon
keeps the last 20 runs of each command ([daemon] keep_command_runs), each
with its output in a file of its own, and an exclusive command's claim now
survives a daemon restart. (#688) - Added overlays triggered by a named condition:
trigger = { condition = 'NAME' }keeps an overlay active while the condition is firing and ends it
once it resolves, held as it is while the condition is unknown, with
min_active,cooldownandmax_per_houragainst flapping,latch = true
to keep it until ended by hand, andpreconditions.probe, a path the
release_readyrelease must answer before activation.muructl overlay listandpreviewshow the condition's state and figures. (#689)
Changed
- A managed HTTP server's instances now run under a log relay each, so their
lines carry the time and a tag naming the instance and stream
(muru.instance[0]:,muru.instance[0].stdout:), the release's log is
rotated and reopened without losing lines (nocopytruncateis needed under
rotate = 'external'), and an instance that exits while no daemon runs is
reported with its real exit status. (#492) muructl logs listnow shows the output files of each command's runs, one
line for each command with how many runs it has and what they take, and
muructl logs prune --orphanedremoves those of an application that no
longer exists and of runs the daemon no longer keeps.truncate,rotate
and a prune by--keepor--older-thanleave them alone. (#692)
Fixed
- Fixed the daemon stopping everything else while a release started: a
release's build, preload,before_forkgates and wait for its workers, and
a promotion'sbefore_promotegates, now run beside the daemon's loop, so
muructl status, other applications' deploys and the daemon's own checks go
on meanwhile. A drain or removal of a release that is starting cancels its
start, and a scale of it is refused until it is ready. (#693) - Fixed a detached or scheduled command run carrying on writing to the
release's renamed log after a rotation ormuructl logs reopen, which lost
its lines once the archive was compressed: its log relay now opens the files
again as a release's relays do, andmuructl logs reopenwaits for it. (#698) - Fixed the daemon stopping everything else while a release stopped: a drain's
wait for the release's host or instances to stop, with their grace periods,
now runs beside the daemon's loop, somuructl status, other applications'
deploys and the daemon's own checks go on meanwhile.muructl drainstill
answers once the release has stopped. (#699)
Documentation
- The metrics guide now gives
muru_request_duration_seconds's labels as the
edge writes them:app,release,groupandphase. (#697)
0.1.0-alpha.27
Added
- Added instrumentation modules: an ordered list in
[[tool.muru.instrumentation]],[[instrumentation]]inmuru.toml
andmuru.local.toml, or a declared release, each a module and its
settings. Muru imports them before anything of the application and
calls each one'sconfigure(settings)with its own settings. A module
that cannot be imported stops the release; an exception from a callback
is logged. (#501) - Added the load callbacks of instrumentation modules:
load_started
before anything of the application is imported,before_importand
after_importaround the hooks module, the entrypoint and each mount,
andload_finishedwith how the load ended, in the host under preload,
in each worker with per-worker imports, and undermuructl check, so an
import timer can measure each entry point's imports. (#502) - Added the
worker_startedandworker_stoppedcallbacks of
instrumentation modules:worker_startedjust before thepost_fork
hook in each worker, andworker_stoppedas the last thing a worker
does, after lifespan shutdown,on_exitand theatexitcallbacks,
also when the worker failed to start or to serve. (#503) - Added the
wrap_application(context, target, application, interface)
callback of instrumentation modules, which receives each entry point's
application in each worker, after any factory and before lifespan
starts, and returns a wrapper to serve in its place, so an APM agent can
wrap a plain WSGI or ASGI application without a change to its code. (#504) - Every response of
muructl runin development mode carries
Server-Timing, with the time the request waited for a worker as
queue, the time to the response head asappand the request's ID as
muru, so the browser's Network tab shows them, andMuru-Request-Link
with the address of the request's page on the dashboard. (#633) muructl runin development mode keeps a record of each of its last
1000 requests: the access log's record, the connection it arrived on,
its request and response headers with secret values masked, and whether
the response was compressed and why not.muructl debug request ID
prints it, with--jsonfor the whole record, the MCP server'sdebug
tool reads it asrequest, and the dashboard shows it as panels at
/request/ID, with/v1/requests/IDas JSON, each recent request
linking to its page. The access log's JSON lines name the connection as
connectionand the request's position on it asconnection_requests,
in every mode. (#634)- A development run's record of a request has the worker's part: the
thread that ran it, the times tostart_response, the first and last
body bytes and the application's end, the body's size and source, the
outcome with the unhandled exception and its traceback, and the
request's log records and warnings. The dashboard's request page and
muructl debug requestshow them in new Logs and Errors panels and on
the Timing panel. (#635) muructl run --toolbar, ortoolbar = truein the run table or
muru.local.toml, puts a debug toolbar on the application's HTML pages:
a badge with the request's status, times, worker and its log and error
counts, opening to the panels of its record. Muru inserts the toolbar's
tag itself, honouring the page's content security policy, and answers
its files and each record's JSON and panels under/_muru/on the
application's own address. (#636)- The debug toolbar has a "This page" tab: every request the page made,
from the browser's own timings, as a waterfall with each request's queue
time, worker, log and error counts and connection from its record.
Clicking a row opens that request's record in the toolbar, and
/_muru/requests?ids=gives the same figures for several requests at
once. (#637) - A development run's record of a request says what held it up while the
worker had it: the wait for an application thread, the waits for the
GIL, the garbage collections that ran meanwhile and the longest stretch
the event loop was held. The Timing panel marks them on the request's
timeline and lists them under "During the request". (#638) - With tracing on, the development toolbar shows three more panels for each
request from what wrapture recorded: Trace, the request's tree of calls,
queries and template renders on its clock; SQL, its queries grouped by
statement, which shows an N+1 pattern as one statement run many times;
and Exceptions, the exceptions that escaped or were handled. (#640) - Added the
tracingsetting, which traces an application with wrapture in
every mode, applying its configuration before the application is imported
and starting its outputs in each worker, andtracing_middleware, which
wraps the entrypoint or a mount in wrapture's request middleware. A
developer'smuru.local.tomlcan settracingfor their own runs. (#674) - Added
access_log_query, in the[logs]table and on a virtual host,
which keeps (the default), masks or drops the query string of the access
log's targets and redirects in either format:maskwrites the values
of secret parameters such astokenas***, anddropwrites the
path alone.muructl runandmuructl servetake it as
--access-log-queryoraccess_log_queryin their tables. (#675) - The development request record can hold panels added in the worker, as
values, tables, spans on the request's clock or text, drawn after the
built-in panels in the toolbar, on the dashboard and bymuructl debug request, with the entries past a panel's limits counted. (#677) muru.panelslets an application add its own panels to the development
toolbar: values, tables, spans or text, plain or markdown, declared once
and added to during a request, keeping nothing outside a development run. (#681)
Changed
- The development request record, shown by the toolbar, the dashboard and
muructl debug request, now masks secret query parameters such as
token,api_keyandcodein the request's target, its internal
redirects and theRefererandLocationheaders, as it already masked
secret headers. (#671) - The host and its workers now take their signals as they start, before the
application is imported: SIGTERM or SIGINT while the application loads
ends the host or the worker cleanly, runningload_finishedwith the new
stoppedoutcome, lifespan shutdown,on_exitand theatexit
callbacks as far as they apply, and a SIGUSR1 or SIGUSR2 then no longer
ends the process and is acted on once the worker serves.muructl run
andmuructl servestop while the workers are coming up rather than once
they are ready.signal.signal()for one of the signals Muru handles is
refused with a warning naming the signal and where the call came from. (#673)
Fixed
- The dashboard's pages take the window's width, so a wide screen shows
every column of their tables. (#649) - The development error page lets a traceback take the window's width, so
its lines are shown whole on a wide screen. (#650) - Under
muructl serve, the memory guard and a worker's hard limit no
longer stop two workers at once and leave a group with none: a worker
being replaced for its own limits counts as the guard's one at a time,
and a group's last worker in routing is not stopped first while another
is away. While a group has no worker in routing, requests wait for one
up to the queue timeout instead of being answered 503no_workersat
once. (#662) - The preload import check names each Python thread it finds, with the
module its code is in, and puts a thread running an instrumentation
module's code, such as a tool's writer started on the first call it
traces, down to that module with advice for it, rather than to the
application module being imported with advice to use apost_forkhook. (#669) muructl checknow fails when an instrumentation module'sconfigure,
load_startedor other load callback raises, naming the module, the
callback and the exception, where it passed and showed nothing before. (#670)- What the application's Python code writes in the host, at import under
preload or from anon_loadorpre_forkhook, is tagged
muru.host[PID]:for standard error andmuru.host[PID].stdout:for
standard output, as a worker's output is, and the host's standard output
is line-buffered. (#672) - The preload import check names the module whose import opened a socket
on a descriptor number that was in use when the import began, such as
one a file closed during the import left free, where it named no module. (#685)
Documentation
- A new guide, "Inspecting requests in development", describes the
Server-TimingandMuru-Request-Linkheaders of a development run, the
record it keeps of each request, the...
0.1.0-alpha.26
Added
- The node budget's
memoryandcpudefault to the daemon's own cgroup's limits,memory.maxless the headroom and the quota ofcpu.max, read at each decision, when[daemon.budget]leaves them out, as in a container or under a systemd unit withMemoryMax=orCPUQuota=;muructl daemon statussays which came from the cgroup. A worker of a group with ahard_limitcounts at it in the budget. (#384) - Under
muructl servein a container with a memory limit, a memory guard replaces the largest worker, one at a time, when less than the headroom (10% ofmemory.max, at least 128MB) is left, reported asworker.recycledwith the reasoncontainer_memory, and holds off with a warning when replacing workers would not help. The limits are read at every memory check, sodocker updateor an in-place pod resize applies without a restart; the start lines give the limits read and warn when the workers are more than the CPUs, when a preload would not fit once each worker holds a copy of it, when hard limits add up to more than the limit, and when request bodies are spooled to memory, whose quota is then the headroom; andmuructl status,/statusand their JSON show the limits, what is used and left, and what the guard is doing. (#621) muructl probe live,readyandstartupask the daemon as well asmuructl serve, over its admin socket, with--appand--min-ready, exiting 1 with the reason on standard error; the daemon answers the same as/livez,/readyzand/startupzon its metrics address. An application with no serving release does not hold readiness back. The daemon reads its own cgroup's limits and, with amemory.max, its memory guard replaces the largest worker of any release, or scales its group in when its policy allows, andmuructl statusshows the limits. The daemon guide's "In a container" section covers a container that is kept: volumes, logs, stopping, probes, the admin socket, memory limits and a Compose service. (#622)muructl serveapplies a project's scaling policy,[tool.muru.scaling]or a group'sscalingtable, as the daemon does, with a scale-out admitted only when one more worker fits under the container'smemory.maxless the headroom, a worker counting at its group'shard_limitwhen one is set. Short of memory, the memory guard scales a group with a policy in by its largest worker rather than replacing it, never belowmin_workers.muructl scale statusworks inside the container, with the application optional;scale pinandunpinsay they are not offered there, and a--min-readyabove a group'smin_workersis refused at start. (#623)- On Linux each worker raises its own
oom_score_adjto 500 as it starts, so the kernel's out-of-memory killer picks a worker, which its host replaces, before a host, the edge, the daemon or another service;status --processes --jsongives each process'soom_score_adj. The systemd unit setsOOMPolicy=continue, since systemd's default stops the whole service when the kernel kills one worker, and carriesMemoryMax=andCPUQuota=as commented-out lines; the systemd guide's new limits section says what a limit on the unit does. (#624)
Changed
- After a daemon restart,
muructl status --processes, its JSON and the dashboard mark a re-adopted host and leave its log relay unmarked when both have the same OS parent, rather than saying it twice and widening the WHAT column; the relay'sos_parent_pidstill gives it. (#611) - In the second after a scale-in,
muructl status --processesand the dashboard mark a host's or group's REQ/S with*when its figures count a worker that has exited and is no longer listed, with a line under the table saying so, and--jsongives the count asdeparted. (#613) muructl status --processes, its--jsonand the dashboard's Processes section give the time a retained release is kept until in UTC with the zone,retained until 07:40 UTC, asmuructl release listdoes, rather than in the daemon's local time without one. (#618)- A worker replaced for memory stops before its replacement starts when less is left under the cgroup's memory limit than the worker's own size, whether or not a hard limit is set. The Kubernetes guide's Deployment sets
resizePolicy: NotRequiredfor CPU and memory and its worker count withMURU_SERVE_PROCESSES. (#621)
Removed
muructl serveno longer sizes anything from the container's limits:--processes autois gone and--processesdefaults to 1, as undermuructl run, and a worker has a hard memory limit only when one is set, rather than a share ofmemory.maxworked out at start. (#621)
Fixed
just vm-upstarts themuruLima instance when it exists and is stopped, and creates it frompackaging/dev/lima.yamlonly when there is none. (#615)muructl eventsgives each event's time as the local clock, as other terminal clocks are, rather than a UTC clock with no zone, and the dashboard shows a release's creation, a rollout's last change, maintenance and a WebSocket's opening in the viewer's local time, with the full UTC time on hover, rather than a UTC clock. (#625)
Documentation
- The Kubernetes and containers guides say that
muructl debug stacksandmuructl debug profilework in a locked-down pod, with every capability dropped, no privilege escalation and theRuntimeDefaultseccomp profile, with noSYS_PTRACEadded. (#111) - The containers guide says that
/readyzand--min-readycount the workers ready in each worker group that is not optional, rather than in every mount, and has a section on named worker groups and mounts undermuructl serve. (#620)
0.1.0-alpha.25
Changed
- A worker is numbered within its group everywhere it is shown:
muructl status --processesand its JSON,/v1/processesand the dashboard's worker pages, the answers ofmuructl debugandmuructl restart, the host's log lines and events, the tags of the release log (muru.worker[reports/1]), the access log and the metrics, matching its process title and its socket's name.--workerand the dashboard'sworker=takeNfor a worker of the default group andGROUP/Nfor one of a named group, and the debug and restart answers carry the worker'sgroupbeside itsindex. (#602) - The daemon's process title is
muru daemon SCOPEand the edge'smuru edge SCOPE, withmuru-daemonandmuru-edgeas their short names, SCOPE beinguserorsystem, or the daemon's state directory when it is not the default, as with--state-dir. Inmuructl status --processesthe daemon's row says the same, asuser daemon, state ~/.local/state/muru, and a host's row gives its release's part in routing after its name:serving,canary 10%,held,drainingorretained until 07:40, which--json,/v1/processesand the dashboard's Processes section carry as the host'sstate. (#604)
Fixed
muructl logs reopen --workersruns a release'son_reopen_logshooks only once its release log has been opened again, so what the hooks print goes to the new file rather than the renamed one. (#598)- In the second after traffic moves, a worker that has just left the pool, scaled in or with its release taken off the route, keeps its last second's requests per second and p95 in
muructl status --processes, so its row adds up with its host's. (#604) - The
[build]and[command NAME]lines the daemon writes into a release's log carry the full UTC time, as every other line of the file does, somuructl debug bundle --sincekeeps them and they sort with the lines around them. Undermuructl runandmuructl serve, a build's lines follow the same rules for times as Muru's other lines, and with--log-format jsona build's lines and a command's are records of kindbuildandcommand, the latter with the command's name. (#605) - A process started with a short command line, as
muructl serveis in a container, now shows its whole title, such asmuru serve shoprather thanmuru serve sh: a title longer than the command line takes the room of the environment strings that follow it, which the process keeps a copy of. A title that still does not fit is cut at a space rather than in the middle of a name. (#606) muructl status --processesand the dashboard's Processes section show an ASGI worker's event loop lag under GIL/LAG, and a WSGI worker's GIL wait, rather than the GIL wait whenever there is one;--jsonand/v1/processeskeep both and carry each host's and worker'sinterface. A host's and a group's GIL/LAG keep their last figure through a second with no new report from their workers, as a worker's does, rather than going empty. (#607)- A
muructlcommand that only prints,--followand--watchincluded, ends quietly with status 141 when the reader of its output closes, asheadandgrep -qdo, rather than panicking with "Broken pipe" and status 101. (#608) muructl logs reopenreturns once the edge and every release's log relay have opened their files again, rather than as soon as they were told, so a logrotatepostrotatethat runs it can compress the renamed files at once without losing lines. (#609)
Documentation
- The examples of
muructl status --processesin the daemon guide and the architecture page are now what the command prints, with its column alignment and its ordering of applications and groups. (#601)