Skip to content

Releases

0.1.0-alpha.34

0.1.0-alpha.34 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 21 Nov 23:16
155e9e1

Added

  • Added an application data directory shared by every release, given to the
    release's host, workers and commands as MURU_DATA_DIR, with a media part
    (MURU_MEDIA_DIR), which is a file hint root of every mount and is named
    media: in sendfile_roots and static entries, and an uploads part
    (MURU_UPLOADS_DIR), never served and where upload.save() now puts a
    file by default. It is STATE/data/APP under the daemon ([app.NAME] data_dir, media_dir and uploads_dir move it), runs/NAME-HASH/data
    in the user state directory under muructl run (--data-dir), and a
    volume named with --data-dir under muructl serve; muructl data show,
    muructl data check and muructl status --app report it, and muructl app remove --data removes it.
    (#849)
  • Added a directory of each release's own for built static files, given as
    MURU_STATIC_DIR and named static: in a static entry, so
    collectstatic run as a before_fork gate never writes into a shared
    source directory: STATE/static/APP/RELEASE under the daemon, made empty
    with the release and removed with it, beside the run's data directory
    under muructl run, and staticfiles in the project under muructl serve (--static-dir).
    (#850)

Changed

  • On a terminal, muructl status --processes fits 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 --json as state_dir, so the daemon's
    row is user daemon or system daemon. (#840)
  • muructl status --processes names a managed server's instance by the
    program its command runs, such as gunicorn, rather than its
    interpreter, and lists the processes the instance started, such as
    gunicorn's workers, without --all, under the role server-worker. (#841)
  • A relative sendfile_roots entry is now taken from the release's source
    directory, in [tool.muru], in --sendfile-root and in an applied
    release table alike, and must be a directory there when the release is
    deployed or muructl run starts; a root may be a symbolic link, and is
    opened afresh when it is pointed somewhere else.
    (#847)
  • A path hint (X-Muru-Sendfile, or X-Sendfile in compatibility mode)
    from an application Muru's workers serve is now opened by the worker as
    the application's user, within the mount's sendfile_roots, and handed to
    the edge open, so the edge's user needs no access to the file and one
    written 0600 is served; it keeps Range, conditional requests, ETag,
    Last-Modified and HEAD, and now gets a precompressed .br, .zst or
    .gz variant beside the file as a static route does.
    (#848)
  • The data directory, the uploads part and any directory containing either
    are refused as a sendfile_roots entry or a static directory, and data:
    and uploads: with them, and muructl run no 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's pid file and a
    serve's serve.json are 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, 502 with the reason worker_stalled.
    A request that reached the worker while the GIL was held had waited for
    the worker to be killed and was answered worker_crashed. (#836)
  • A daemon listener that cannot bind its address names the program and pid
    holding it, as muructl run does, 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 of post_fork and on_ready hooks, are printed
    before switched to release rN, rather than sometimes after it and after
    the old release's on_drain lines. (#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, 502 with 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 ms once the application is imported
    and before its on_load hook runs, with N the import's time alone, so
    the hook's output follows the line rather than coming before it. A
    hooks module's on_load and pre_fork each get a line of their own
    once they return, such as on_load hook ran in 500 ms.
    muru_release_load_seconds still counts the on_load hook. (#846)

Security

  • Static files and files named by X-Muru-Sendfile are 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

0.1.0-alpha.33 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 20 Nov 11:48
c0d8dad

Added

  • Every Muru instance on a machine, a daemon, a muructl run or a muructl serve, registers itself in one registry per user, in registry in 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 --json reports the ID and the hostname, and muructl cache reads 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, each running, detached or stale with its pid, uptime, listeners, dashboard and where it works from, and with --orphans the Muru processes no live instance accounts for, exiting 1 when there are any; --label, --kind, --all-users and --json narrow and shape it, the read-only MCP tool instances returns it, and muructl status with 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 start refuses an address a running instance holds before it starts anything, and muructl instance list --ports lists 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, --yes and --json narrow and shape it. (#809)
  • Added named daemon instances: muructl instance create NAME --listen ADDRESS defines one in the configuration area, with an instance.toml and its own muru.toml, --instance NAME or MURU_INSTANCE on the daemon's commands puts every location under instances/NAME so muructl daemon start --instance dev needs nothing else, muructl instance list shows a defined instance that is not running as stopped, muructl instance remove removes one, with --state its 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, by MURU_INSTANCE, or by instance = "NAME" in the checkout's muru.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 an instance field in --json output, muructl mcp serve settles 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 --dashboard an 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, --list and --json print the URLs instead, muructl run --open opens the application once the run answers, the dashboard lists each application's addresses, and the read-only MCP tool urls returns them. (#815)

Changed

  • A development run keeps its admin socket, its pid file and its releases' run directories in a directory of its own named by its instance ID, RUNTIME/run-7f3a9c2e, in place of RUNTIME/runs/PORT and a directory under the temporary directory, and run.json is 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) or muru 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, has MURU_INSTANCE_ID and MURU_INSTANCE in its environment. (#806)
  • MURU_SOCKET is read alongside MURU_INSTANCE, and setting both is refused, as giving --socket and --instance together is. (#811)
  • A dashboard login link may carry next, a relative path under the dashboard to go to once signed in, which muructl open --dashboard --request ID uses. (#815)
  • A managed server's instance is given its index as MURU_SERVER_INDEX in place of MURU_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 status and muructl daemon stop. muructl daemon start reports the same refusal. (#804)
  • muructl instance prune and muructl instance remove remove 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 prune removes 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

0.1.0-alpha.32 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 19 Nov 11:29
1dabe61

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-Timing has an import_wait entry apart from import, and the "modules loaded on first use" hint counts the wait too. (#787)
  • The workers section of muructl debug imports says, 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, the preload_modules advice. (#793)

Changed

  • lazy_imports and import_report now 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 run stops 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.warming gives the overlay's lead as it declares it, "its window begins in 1m" for a lead of 1m, 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_support is never suggested for preload_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 to pid beside 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 promoted until 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 showed Error: with a Caused 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 apply is taken from that file's directory, and a release's own static directories and error pages from its source directory. muructl apply now does the same for an upstream's and a mount's sendfile_roots and a client class's ja4_list, which it sent as written. (#778)
  • muructl apply refuses 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 an overlay.skipped warning giving the edge's reason, where before the overlay was recorded as active though not in force. (#779)
  • muructl debug request prints 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 imports its first 2,000 the same way. (#782)
  • Fixed a reload of muructl run for a changed pyproject.toml keeping the [tool.muru] settings the run started with: every reload for a changed settings file (pyproject.toml, muru.toml, muru.local.toml or the file --settings-file names, 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 imports lists 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 --all for 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 imports advising to defer what a preload_modules entry imports, which undid the list: nothing loaded for an entry is advised to be deferred, its rows are noted preload_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's lazy_modules names that a load with lazy_imports off imported eagerly is no longer shown in muructl debug imports as already lazy with nothing to save: it keeps its cost, and the advice names the setting that is missing and where it is off; --target narrows 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 from import, 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 a from import only in the project's own code when its load takes at least 10 ms. (#788)
  • muructl debug imports no 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 promote refused 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 an overlay.end_refused warning (schedule.end_refused for 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_wait in Server-Timing, when it asked through importlib.import_module, as Django does to load views, not only with an import statement. (#794)

0.1.0-alpha.31

0.1.0-alpha.31 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Nov 00:07
c635362

Changed

  • An overlay whose preconditions.probe fails 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 promote makes 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 list and muructl scale status show a release's share of each route that splits traffic on a traffic: 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 list shows a skip with no end as lasting until the overlay is activated by hand or changed. (#755)
  • overlay.warming gives the time until the window to the nearest second, and minute, so a lead of 1m reads "its window begins in 1m" rather than "in 59s". (#756)
  • muructl app list marks 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 as maintenance_overlay. (#757)
  • muructl logs --access shows class= for a request whose client class is not default, and redirects=, retried=1 and handoff= where the edge's own text lines show them. (#760)

0.1.0-alpha.30

0.1.0-alpha.30 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Nov 08:25
93afca7

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-Timing carries their time before the response head as import, the Hints panel names them when they take a large share of the request, and muructl debug status counts the modules each worker has loaded since the fork. (#738)
  • Added preload_modules to [tool.muru] and to a release's table: modules the host imports after the entrypoint and the mounts, and before the on_load and pre_fork hooks, 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 check imports and reports the list, and --print-config shows it. (#739)
  • Added lazy_imports to [tool.muru], muru.local.toml and 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-config shows the key and the unwrapt configuration the host finds. (#740)
  • Added import_report to [tool.muru], muru.local.toml and a release's table, muructl debug imports, muructl check --imports and an imports tool in muructl 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] or preload_modules entry 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, and muructl run and muructl serve the 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.loaded event when a release's host has imported the application, giving how long it took and, with import_report on, the import report's headline figures; and the metrics muru_release_load_seconds, muru_worker_load_seconds (a worker that imported the application itself), and muru_worker_modules_loaded_total and muru_worker_module_load_seconds_total for 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.Span took at for an event and segments of the new muru.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

0.1.0-alpha.29 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 16 Nov 09:06
37c30b4

Added

  • A span in a spans panel can now be marked failed: muru.panels.Span takes failed, a span() 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, and muructl debug request and 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_deadline names 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 request and the record's JSON carry them. (#709)
  • Added cap_workers to overlays and capacity schedules, which caps a worker group at a count whatever its policy and floors say, draining the excess at once, and muructl 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, muructl commands 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 run reloads 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 .gitignore alone, 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_total under the application it was routed to, so conditions on the application see it. (#724)
  • muructl apply warns 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 list shows a condition waiting out for as pending, and condition show says how long its when or clear_when has held of the wait it needs, where it read unknown: with no reason before its first change. (#727)
  • muructl overlay list keeps its columns in line when an overlay's state or trigger is long, such as active (condition) or a cooldown with its end. (#728)
  • muructl apply no longer warns that an overlay with latch = true takes 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

0.1.0-alpha.28 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 15 Nov 13:50
24fd713

Added

  • Added named conditions: [condition.NAME] with when, for, clear_when,
    clear_for and min_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_depth and more). The
    daemon evaluates each every second and raises condition.firing and
    condition.resolved events, and muructl condition list and muructl condition show give their states and figures. (#123)
  • Added gates: before_fork = true on 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, and before_promote = true runs it just before a rollout
    or blue/green promotion moves all traffic, stopping the promotion if it
    fails. A gate runs once a release unless every_start = true, needs a
    timeout, is always exclusive, runs under the daemon only, and muructl release show lists 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, and schedule = { 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.skipped event, each scheduled run is a detached run with the
    trigger schedule, and muructl command list shows each schedule and its
    next run. (#268)
  • Added detached command runs: muructl command run APP NAME --detach and
    muructl exec APP --detach -- ... start a run that outlives its caller and
    a daemon restart or upgrade, and muructl command runs, status, logs
    (with --follow) and stop list, 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, cooldown and max_per_hour against flapping, latch = true
    to keep it until ended by hand, and preconditions.probe, a path the
    release_ready release must answer before activation. muructl overlay list and preview show 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 (no copytruncate is needed under
    rotate = 'external'), and an instance that exits while no daemon runs is
    reported with its real exit status. (#492)
  • muructl logs list now 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 --orphaned removes those of an application that no
    longer exists and of runs the daemon no longer keeps. truncate, rotate
    and a prune by --keep or --older-than leave them alone. (#692)

Fixed

  • Fixed the daemon stopping everything else while a release started: a
    release's build, preload, before_fork gates and wait for its workers, and
    a promotion's before_promote gates, 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 or muructl 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, and muructl logs reopen waits 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, so muructl status, other applications'
    deploys and the daemon's own checks go on meanwhile. muructl drain still
    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, group and phase. (#697)

0.1.0-alpha.27

0.1.0-alpha.27 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 15 Nov 04:41
fde19be

Added

  • Added instrumentation modules: an ordered list in
    [[tool.muru.instrumentation]], [[instrumentation]] in muru.toml
    and muru.local.toml, or a declared release, each a module and its
    settings. Muru imports them before anything of the application and
    calls each one's configure(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_import and
    after_import around the hooks module, the entrypoint and each mount,
    and load_finished with how the load ended, in the host under preload,
    in each worker with per-worker imports, and under muructl check, so an
    import timer can measure each entry point's imports. (#502)
  • Added the worker_started and worker_stopped callbacks of
    instrumentation modules: worker_started just before the post_fork
    hook in each worker, and worker_stopped as the last thing a worker
    does, after lifespan shutdown, on_exit and the atexit callbacks,
    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 run in development mode carries
    Server-Timing, with the time the request waited for a worker as
    queue, the time to the response head as app and the request's ID as
    muru, so the browser's Network tab shows them, and Muru-Request-Link
    with the address of the request's page on the dashboard. (#633)
  • muructl run in 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 --json for the whole record, the MCP server's debug
    tool reads it as request, and the dashboard shows it as panels at
    /request/ID, with /v1/requests/ID as JSON, each recent request
    linking to its page. The access log's JSON lines name the connection as
    connection and the request's position on it as connection_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 to start_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 request show them in new Logs and Errors panels and on
    the Timing panel. (#635)
  • muructl run --toolbar, or toolbar = true in 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 tracing setting, which traces an application with wrapture in
    every mode, applying its configuration before the application is imported
    and starting its outputs in each worker, and tracing_middleware, which
    wraps the entrypoint or a mount in wrapture's request middleware. A
    developer's muru.local.toml can set tracing for 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: mask writes the values
    of secret parameters such as token as ***, and drop writes the
    path alone. muructl run and muructl serve take it as
    --access-log-query or access_log_query in 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 by muructl debug request, with the entries past a panel's limits counted. (#677)
  • muru.panels lets 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_key and code in the request's target, its internal
    redirects and the Referer and Location headers, 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, running load_finished with the new
    stopped outcome, lifespan shutdown, on_exit and the atexit
    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
    and muructl serve stop 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 503 no_workers at
    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 a post_fork hook. (#669)
  • muructl check now fails when an instrumentation module's configure,
    load_started or 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 an on_load or pre_fork hook, is tagged
    muru.host[PID]: for standard error and muru.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-Timing and Muru-Request-Link headers of a development run, the
    record it keeps of each request, the...
Read more

0.1.0-alpha.26

0.1.0-alpha.26 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 13 Nov 05:21
972f912

Added

  • The node budget's memory and cpu default to the daemon's own cgroup's limits, memory.max less the headroom and the quota of cpu.max, read at each decision, when [daemon.budget] leaves them out, as in a container or under a systemd unit with MemoryMax= or CPUQuota=; muructl daemon status says which came from the cgroup. A worker of a group with a hard_limit counts at it in the budget. (#384)
  • Under muructl serve in a container with a memory limit, a memory guard replaces the largest worker, one at a time, when less than the headroom (10% of memory.max, at least 128MB) is left, reported as worker.recycled with the reason container_memory, and holds off with a warning when replacing workers would not help. The limits are read at every memory check, so docker update or 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; and muructl status, /status and their JSON show the limits, what is used and left, and what the guard is doing. (#621)
  • muructl probe live, ready and startup ask the daemon as well as muructl serve, over its admin socket, with --app and --min-ready, exiting 1 with the reason on standard error; the daemon answers the same as /livez, /readyz and /startupz on its metrics address. An application with no serving release does not hold readiness back. The daemon reads its own cgroup's limits and, with a memory.max, its memory guard replaces the largest worker of any release, or scales its group in when its policy allows, and muructl status shows 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 serve applies a project's scaling policy, [tool.muru.scaling] or a group's scaling table, as the daemon does, with a scale-out admitted only when one more worker fits under the container's memory.max less the headroom, a worker counting at its group's hard_limit when 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 below min_workers. muructl scale status works inside the container, with the application optional; scale pin and unpin say they are not offered there, and a --min-ready above a group's min_workers is refused at start. (#623)
  • On Linux each worker raises its own oom_score_adj to 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 --json gives each process's oom_score_adj. The systemd unit sets OOMPolicy=continue, since systemd's default stops the whole service when the kernel kills one worker, and carries MemoryMax= and CPUQuota= 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's os_parent_pid still gives it. (#611)
  • In the second after a scale-in, muructl status --processes and 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 --json gives the count as departed. (#613)
  • muructl status --processes, its --json and the dashboard's Processes section give the time a retained release is kept until in UTC with the zone, retained until 07:40 UTC, as muructl release list does, 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: NotRequired for CPU and memory and its worker count with MURU_SERVE_PROCESSES. (#621)

Removed

  • muructl serve no longer sizes anything from the container's limits: --processes auto is gone and --processes defaults to 1, as under muructl run, and a worker has a hard memory limit only when one is set, rather than a share of memory.max worked out at start. (#621)

Fixed

  • just vm-up starts the muru Lima instance when it exists and is stopped, and creates it from packaging/dev/lima.yaml only when there is none. (#615)
  • muructl events gives 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 stacks and muructl debug profile work in a locked-down pod, with every capability dropped, no privilege escalation and the RuntimeDefault seccomp profile, with no SYS_PTRACE added. (#111)
  • The containers guide says that /readyz and --min-ready count 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 under muructl serve. (#620)

0.1.0-alpha.25

0.1.0-alpha.25 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 12 Nov 07:37
b82cf33

Changed

  • A worker is numbered within its group everywhere it is shown: muructl status --processes and its JSON, /v1/processes and the dashboard's worker pages, the answers of muructl debug and muructl 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. --worker and the dashboard's worker= take N for a worker of the default group and GROUP/N for one of a named group, and the debug and restart answers carry the worker's group beside its index. (#602)
  • The daemon's process title is muru daemon SCOPE and the edge's muru edge SCOPE, with muru-daemon and muru-edge as their short names, SCOPE being user or system, or the daemon's state directory when it is not the default, as with --state-dir. In muructl status --processes the daemon's row says the same, as user daemon, state ~/.local/state/muru, and a host's row gives its release's part in routing after its name: serving, canary 10%, held, draining or retained until 07:40, which --json, /v1/processes and the dashboard's Processes section carry as the host's state. (#604)

Fixed

  • muructl logs reopen --workers runs a release's on_reopen_logs hooks 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, so muructl debug bundle --since keeps them and they sort with the lines around them. Under muructl run and muructl serve, a build's lines follow the same rules for times as Muru's other lines, and with --log-format json a build's lines and a command's are records of kind build and command, the latter with the command's name. (#605)
  • A process started with a short command line, as muructl serve is in a container, now shows its whole title, such as muru serve shop rather than muru 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 --processes and 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; --json and /v1/processes keep both and carry each host's and worker's interface. 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 muructl command that only prints, --follow and --watch included, ends quietly with status 141 when the reader of its output closes, as head and grep -q do, rather than panicking with "Broken pipe" and status 101. (#608)
  • muructl logs reopen returns once the edge and every release's log relay have opened their files again, rather than as soon as they were told, so a logrotate postrotate that runs it can compress the renamed files at once without losing lines. (#609)

Documentation

  • The examples of muructl status --processes in 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)