Skip to content

Releases

v2.24.3

Choose a tag to compare

@github-actions github-actions released this 24 Nov 15:25
fcadeea

Internal polling loop

The polling loop no longer depends on carlescere/scheduler (#554). A small internal package, internal/repeat, now calls the check right away and then at every interval from a single goroutine, so calls never overlap. When a check runs past one or more intervals, those intervals are skipped, as before.

The shutdown stops the loop and waits for a check in progress to finish, the same as in v2.24.2. Log messages and the sequence diagrams in the READMEs now say "polling loop" instead of "scheduler".

End-to-end tests

The end-to-end tests now use the file action of Probe v1.39.0 to read logs and to read and write local files (#553). Log checks no longer depend on the stdout of a shell step, which intermittently came back empty.

v2.24.2

Choose a tag to compare

@github-actions github-actions released this 23 Nov 05:01
af01190

Shutdown no longer races with the polling loop

A SIGTERM, SIGINT or SIGQUIT that arrived while a check or deployment was running could leave the server in a bad state (#552). The problem was introduced in v2.23.0, when the shutdown began to wait for the drain time.

  • Restart during the drain. A check that was running when the shutdown began found no server and started one again from the cache. The start failed because the stopping server still held the port, and the version was written to the blocked list.
  • Orphaned application. A signal received while dewy was starting the application made dewy exit at once, and the application kept running without dewy.

The shutdown now stops the polling first and waits for a running check or deployment to finish. Then it stops the server, including one that was just started. A shutdown that begins during a download waits for the download to finish.

The Worker stopped log line is now written before the shutdown returns, so it is no longer lost when dewy exits.

End-to-end tests

The end-to-end tests now send SIGTERM to dewy while it starts an application that takes 15 seconds to stop (#552). They check that dewy waits for the application to stop, that the application exits normally, that it is started only once, and that the version is not blocked.

v2.24.1

Choose a tag to compare

@github-actions github-actions released this 22 Nov 12:32
968d8ec

Socket path length is checked at startup

A --socket address longer than the operating system allows now fails the start with an error that names the limit (#551). Before, such a path passed the option checks and failed when dewy bound it, as bind: invalid argument on the first deployment, followed by a rollback attempt.

Error: invalid socket: "/var/lib/..." is 125 bytes; a Unix domain socket address on darwin is limited to 103 bytes
  • Paths. The limit applies to the absolute path, after a relative path is resolved against the working directory: 107 bytes on Linux and 103 bytes on macOS.
  • Abstract names. On Linux, an abstract name (@name) can be at most 108 bytes including @.

End-to-end tests

The end-to-end tests now include a server that listens only on --socket and reads its environment from --envdir (#550). They check that the application answers over the socket, that the health check probes the socket, that the application gets the values from the envdir, that SIGUSR1 reloads a changed value, and that the socket file is removed on shutdown.

v2.24.0

Choose a tag to compare

@github-actions github-actions released this 22 Nov 06:03
2658280

Unix domain sockets for the server command

--socket listens on a Unix domain socket, alone or next to --port (#547). An application behind a reverse proxy on the same host can be served without opening a TCP port.

dewy server --registry ghr://owner/repo --socket /run/app/app.sock --health-path /health -- /opt/app/current/app
  • Across restarts. Dewy keeps the socket open across restarts, as it does for ports. A connection that arrives during a restart waits in the socket's accept queue.
  • DEWY_PORT. Each socket is listed by its path after the port entries (8080=3;/run/app.sock=4), in the format server-starter uses.
  • Socket files. If a socket file is already at the path and refuses connections, it was left by a process that exited without removing it, and dewy replaces it. A socket that accepts connections, or any other file at the path, fails the start. Dewy removes the file on shutdown, unless another file has replaced it.
  • Abstract namespace. On Linux, --socket @name listens in the abstract namespace and creates no file.
  • Health checks. Without a TCP port, --health-path probes the first --socket, so a server that listens only on Unix domain sockets needs no --port.
  • Permissions. The socket file gets its permissions from dewy's umask. A client that runs as another user, such as a reverse proxy, needs write permission on the file.

Environment variables from --envdir

--envdir gives the application environment variables from a directory in the daemontools envdir format (#548). Dewy reads the directory again each time it starts a process: on the first start, a deployment, a rollback, SIGUSR1, and the restart of a crashed process. To change a value without a deployment, edit the file and send SIGUSR1.

echo 'postgres://db.internal/app' > /etc/app/env/DATABASE_URL
dewy server --registry ghr://owner/repo --port 8000 --envdir /etc/app/env -- /opt/app/current/app

echo debug > /etc/app/env/LOG_LEVEL
kill -USR1 $(pidof dewy)
  • Format. Each regular file sets the variable of its name to the first line of the file, with trailing spaces and tabs removed. An empty file removes the variable. Dotfiles and directories are skipped. Symbolic links are followed, so a mounted Kubernetes Secret or ConfigMap works as the directory.
  • Precedence. The envdir overrides dewy's own environment, but not DEWY_PORT, SERVER_STARTER_PORT or DEWY_HEALTH_PORT.
  • Errors. A directory that cannot be read fails the start. On a restart, the restart fails and the previous process keeps serving.

The sock module

sock.Listen("unix", path) returns the inherited Unix domain socket for a --socket path and creates the socket itself outside dewy. sock.Listeners now returns Unix domain sockets as well as TCP sockets. The module is released as sock/v0.2.0.

Documentation

  • Added the application integration page for the server command, redrew the supervisor and proxy diagrams, and added server command troubleshooting and deployment records to the FAQ (#543).
  • Corrected the architecture diagram against the code (#545).
  • Described how to install the development build from main with go install (#542).

v2.23.0

Choose a tag to compare

@github-actions github-actions released this 21 Nov 22:15
e5f72df

The server command runs on dewy's own supervisor

The server command no longer uses linyows/server-starter. Dewy now binds the ports itself, keeps them open across restarts, and passes them to the application as file descriptors 3, 4, ... (#532, #533).

  • DEWY_PORT. The application finds its sockets in DEWY_PORT (8080=3;8443=4). SERVER_STARTER_PORT carries the same value, so applications written for server-starter keep working.
  • IPv6. --host accepts any IPv4 or IPv6 unicast literal. Without --host the ports listen dual stack, so they also accept IPv6 connections. 0.0.0.0 listens on IPv4 only and :: on IPv6 only.
  • Failed restarts. A new process that exits within its startup window fails the restart, and the previous process keeps serving the previous release. The rollback restores the current symlink and cache key without restarting the server.
  • Crash recovery. A serving process that exits on its own is started again after a backoff that doubles from 1s up to 30s.
  • Shutdown. On SIGINT, SIGTERM or SIGQUIT, dewy stops the application, kills it after --drain-time if it is still running, and closes the sockets.
  • Signals. SIGUSR1 restarts the application. SIGHUP is still ignored.

New options for the server command

  • UDP ports (#535). --port takes Docker's /udp suffix: --port 53,53/udp, --port 6000-6002/udp. UDP sockets appear in DEWY_PORT with the suffix (53=3;53/udp=4). --health-path probes the lowest TCP port and requires at least one TCP port.
  • --startup-wait (#536) sets how long a new process must stay up before it replaces the previous one. The default is 1 second.
  • --drain-time (#537) now applies to the server command. A previous process that has not exited this long after SIGTERM is killed with SIGKILL. The default is 30 seconds. The assets command rejects the option instead of ignoring it.
  • --health-before-switch (#538) health checks a new process before it receives traffic. Each new process gets its own loopback TCP socket, announced in DEWY_HEALTH_PORT (127.0.0.1:41234=5). Dewy probes --health-path on that socket after the startup wait. On failure the new process is killed and the previous one never stops serving. The application has to serve its health endpoint on that socket, so the option is opt-in and requires --health-path.
dewy server --registry ghr://owner/repo --port 8000 \
  --health-path /healthz --health-before-switch -- /opt/app/current/app

The sock module

github.com/linyows/dewy/sock is a separate module that applications use to get the sockets dewy opened for them (#534). It depends only on the standard library.

ln, err := sock.Listen("tcp", ":8000")

sock.Listen and sock.ListenPacket return the inherited socket whose port matches, and fall back to net.Listen and net.ListenPacket outside dewy, so the same code runs on a developer machine. sock.Listeners, sock.PacketConns and sock.HealthListener return the sockets in DEWY_PORT and DEWY_HEALTH_PORT. The module is released as sock/v0.1.0.

Telemetry

  • dewy.server.crashes.total counts each time the serving process exits without being told to stop (#539). A new process rejected during a restart and exits during dewy's shutdown are not counted.

Documentation

  • The reference lists the environment variables dewy reads and the ones it sets for the application (#540).
  • The samples use DEWY_PORT and the sock module.
  • The Japanese docs describe the registry refresh lock as exclusive control (#531).

v2.22.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 15:42
e27b01b

Bind the server command to a specific address

The server command listened on every IPv4 interface, with no way to narrow it. --host now sets the IPv4 address it listens on, and the address applies to every --port (#528).

dewy server --registry ghr://owner/repo --host 127.0.0.1 --port 8000 -- /opt/app/current/app
  • --host requires --port. Only an IPv4 unicast address is accepted: a hostname such as localhost, an IPv6 address, and a multicast or broadcast address are rejected at startup. The assets and container commands reject the option.
  • 0.0.0.0 behaves the same as omitting the option, which is the default and listens on all IPv4 interfaces.
  • The --health-path check is sent to the given address, since a server bound to a specific interface does not accept connections on 127.0.0.1. With 0.0.0.0 or no --host, it is still sent to 127.0.0.1. The check no longer goes through HTTP_PROXY or HTTPS_PROXY, so a proxy set for reaching a registry cannot answer it in place of the application.
  • With an address other than 0.0.0.0, the SERVER_STARTER_PORT environment variable passed to the application lists each socket as host:port=fd instead of port=fd. An application that parses the variable itself must accept this form.

Nothing changes when --host is not set.

Documentation

  • The multi-port and signal handling samples serve on the sockets passed by server-starter (#529). The Go samples bound their ports with ListenAndServe, and the multi-port sample read the file descriptor in SERVER_STARTER_PORT as the port number. Under the server command, server-starter already holds the ports, so the samples left the configured ports unanswered, and binding the correct port fails with "address already in use" on Linux. The samples now turn each descriptor into a net.Listener with os.NewFile and net.FileListener and serve on it, which also keeps the ports open across a graceful restart.

Internal

  • Applied go fix modernizations (#530).
  • The end-to-end tests cover blue/green slots with the server command (#526), and the e2e docs describe the current test structure (#525).
  • Bumped go.opentelemetry.io/otel/sdk from 1.46.0 to 1.47.0 (#527).

v2.21.1

Choose a tag to compare

@github-actions github-actions released this 06 Nov 10:13
a5f6336

Fixes

  • Deploy notifications are sent on the tick that recovers from errors (#524). While any error was counted, the notifier also held back download, hook result, deploy success and rollback notifications, not only error notifications. The count is reset only after a successful poll finishes, so when the registry recovered and a new release was deployed, every notification from that deployment was dropped. The following polls skip the same version, so after error notifications reached their limit of 3, nothing was notified at all. A single failed registry fetch was enough to drop the notifications of the next deployment, and with quiet=true, where only important notifications are sent, none arrived. This has been the case since v0.14.0. Now only error notifications are limited: the limit of 3 and its reset when a poll succeeds are unchanged.

Documentation

  • The notifier page and the README state that only error notifications are limited (#524).

v2.21.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 21:55
e1f1056

Roll back a server deployment that fails its health check

In server mode a deployment used to finish as soon as the managed process was restarted, without checking that the new release served traffic. When it did not, the host served nothing until someone repointed the current symlink by hand, and the next poll deployed the same version again.

--health-path now applies to the server command as well as the container command (#490). After the process starts or restarts, Dewy probes http://127.0.0.1:<port><health-path> every two seconds until a 2xx or 3xx comes back or --health-timeout (30s by default) runs out. The port is the lowest of the configured --port values.

dewy server --registry ghr://owner/repo -p 8000 --health-path /health -- /opt/app/current/app

When the probe does not succeed, or the process does not start, Dewy points current back at the previous release, restarts the server on it, and sends a notification naming the failure and the restored version. The failed version is recorded as blocked, so it is deployed once rather than on every poll. Publishing a newer version, or running without --health-path, lets deployments proceed again.

  • --no-rollback keeps the failed release in place. The version is still recorded and the failure still notified.
  • --health-path without --port is rejected at startup, as is --health-path with the assets command and --no-rollback outside the server command.
  • A new counter, dewy.deployments.rollbacks.total, counts rollbacks, and a restart caused by one is recorded as dewy.server.restarts.total{reason="rollback"}.
  • Deploy hooks are not run on a rollback. The deployment hooks page describes the order of steps and what that means for the after-deploy hook (#494).

Nothing changes when --health-path is not set, which is the default.

Verify downloaded artifacts against published checksums

Dewy extracted what it downloaded without checking it. GitHub Releases, S3 and GCS registries now report the SHA-256 checksum file published next to the selected artifact, and Dewy checks the download against it before writing it to the cache (#491). An artifact that does not match is neither extracted nor shared with other instances on the same cache backend.

Two layouts are recognized: a file named after the artifact (app_linux_amd64.tar.gz.sha256, .sha256sum, .sha256.txt, .sha256sums), and an aggregate file in sha256sum format (checksums.txt, SHA256SUMS, and project-prefixed names such as the myapp_1.2.3_checksums.txt GoReleaser generates by default).

--verify-checksum takes auto (default), required or off:

  • auto verifies whenever a checksum file is published and deploys without verification when none is, so existing setups keep working, and a release that already publishes checksums is verified with no configuration.
  • required also fails the deployment when no checksum file is published. The gRPC registry does not report one.
  • off never fetches a checksum file.

Container images are not affected: the runtime verifies an image by its digest on pull.

Fixes

  • --slot picks the latest version within the slot (#521). The registries picked the latest version without looking at the slot, and Dewy checked the slot only on that version. Build metadata is ignored when versions are compared, so v1.2.3+blue and v1.2.3+green tied, and the one listed first won: on S3 and GCS a --slot green instance never deployed. A slot whose version sorted below another slot's also waited until it became the overall latest. This affected the server and assets commands alike. While no version carries the slot yet, Dewy now waits without reporting an error. With registry-ttl, the shared registry-result cache keeps a separate entry per slot.
  • A failing before-deploy hook aborts the deployment (#495). Dewy logged the failure and deployed anyway, while the documentation said the deployment is aborted. Now nothing is extracted and no container is replaced, the current symlink stays on the running release, and the version is retried on the next poll under the polling backoff.
  • The app name no longer carries the registry URL's query (#499). A ghr:// or s3:// registry URL with query parameters gave an app name such as myrepo?pre-release=true, and a gs:// URL gave none, falling back to app. Both now give the last path segment.
  • OCI registry credentials are resolved in one order (#500). Listing tags and pulling the image read the same environment variables in opposite orders, so an environment with both DOCKER_USERNAME and GITHUB_TOKEN listed as one identity and pulled as another. Both now use: DOCKER_USERNAME/DOCKER_PASSWORD, then GITHUB_TOKEN for ghcr.io, AWS_ECR_PASSWORD for ECR, and GCR_TOKEN for Artifact Registry. Listing tags on ECR and Artifact Registry is now authenticated as well.

Upgrade notes

These fixes change behavior that a deployment may depend on:

  • A before-deploy hook that exits non-zero now stops the deployment (#495).
  • A container deployment that omits --name and uses a ghr:// or s3:// registry URL with query parameters gets a different dewy.app label, and no longer recognizes the containers it started before (#499). img:// registries are not affected. Set --name to keep the previous name.
  • On the container path, DOCKER_USERNAME now takes precedence over a host-specific token such as GITHUB_TOKEN (#500).

Security

  • Release binaries are built with Go 1.27.3 (#523). Earlier releases were built with Go 1.26.0, because go.mod named no toolchain, and carried the standard library fixes made since then, in net/http, crypto/tls, crypto/x509 and html/template among others.
  • github.com/go-jose/go-jose/v4 is updated to v4.1.6 for GHSA-mgcc-cww5-fp2q, GHSA-4w3g-jfj2-cw2q and GHSA-vvm8-gf78-28g4, and golang.org/x/net to v0.62.0 and golang.org/x/crypto to v0.58.0 (#523).

Documentation

  • The memory, Consul and Redis cache backends are no longer described as planned. The rate-limit and multi-server answers in the FAQ now show the shared S3 or GCS cache with registry-ttl (#508).
  • The OCI registry credential variables and their precedence are documented (#500).

Maintenance

  • Dependencies: gRPC 1.83.2 (#489), the AWS SDK (#502) and OpenTelemetry 1.46.0 (#503).
  • Internal refactoring with no change in behavior: shared defaults, container label constants and the deploy hook runner each live in one place (#496, #497, #498).
  • The e2e tests run on Probe v1.30.0, cover blue/green slots on S3 and GCS, and the lint workflow checks their formatting (#516, #517, #518, #519, #521, #522).
  • The docs site dependencies are updated (#488, #514, #515).

v2.20.0

Choose a tag to compare

@github-actions github-actions released this 29 Aug 07:02
193bd2c

Opt-in backoff for the polling loop

The polling scheduler fired at a fixed interval, so a registry that was down met an unchanged request rate for as long as the outage lasted. At the default --interval 10 that is 360 attempts an hour per instance, every one of them failing.

--max-backoff-interval <seconds> bounds that (#481, thanks @u5surf). While checks keep failing the effective interval doubles from the configured interval, jittered, up to the given bound. The first successful check restores the normal cadence immediately.

dewy server --interval 10 --max-backoff-interval 300 -- /opt/app/current/app

A registry that stays down is then polled at most 10s, 20s, 40s, 80s and 160s apart, and at most 300s apart from there on, instead of every 10s. The flag defaults to 0, which keeps the fixed interval dewy has always used, so no existing deployment changes behavior without opting in.

Worth knowing before enabling it:

  • A single failure never stretches the interval. Only the second consecutive failure opens a window, because one failed check is more often a blip than an outage and delaying recovery for it costs more than it saves.
  • Jitter applies only to the part of the delay above the interval, so a jittered wait is never shorter than one polling interval. A bound shorter than --interval is therefore inert.
  • The scheduler still fires at --interval and a tick returns immediately while a window is open, so every wait lands on a multiple of the configured interval.
  • The artifact-not-found grace period and a slot mismatch are skips rather than failures, and neither opens a window. A slow CI upload will not stretch the interval.
  • Any error from a check counts, not only a registry outage. A failing deploy hook or a failed server restart backs off as well.
  • The trade-off is that a release landing right after recovery can go unnoticed for up to the bound. The polling tick is also dewy's only recovery path for a managed server that has crashed, so that restart is delayed by the same amount once the registry comes back.

Documentation

  • The reference documented --interval as defaulting to 600 seconds. The actual default is 10, and has been since 2018 (#480, thanks @u5surf).
  • The Japanese reference had both of the above missing and now carries them (#482).
  • レジストリ is used consistently across the Japanese pages and the side navigation, which still had レジストリー in six places (#482).

Maintenance

  • The backoff vocabulary was settled before it shipped: the flag, its config field, the type and the file all read as max-backoff-interval, and the scheduler callback is now tick, which is what the codebase already called it in comments (#482).

Full Changelog: v2.19.1...v2.20.0

v2.19.1

Choose a tag to compare

@github-actions github-actions released this 23 Aug 09:00
799ebee

Container flag fixes

--health-timeout and --drain-time were parsed, defaulted and stored on the container config, but neither reached the code it was supposed to control. Both were wired when container support landed and both lost their readers in later refactors, leaving the flags and their documentation advertising behavior that no longer existed (#478).

  • --health-timeout is now the overall budget for verifying a container, which matches its documented meaning. The probe retries within that budget instead of running a fixed five attempts with a hardcoded 5s timeout, and the failure message reports the attempt count, the budget and the last error.
  • The probe and its back-off now honor the context, so a shutdown during a deploy is no longer stuck behind an in-flight health check.
  • --drain-time now feeds the stop timeout of the old container. The old container is stopped right after its backend is pulled from the proxy, so that timeout is the drain window: SIGTERM lands immediately and the container has until the timeout to finish in-flight requests. At the default this widens the window from a hardcoded 10s to the documented 30s, the one user-visible difference at the defaults.
  • A sub-second stop timeout is clamped to one second. The runtime CLI takes whole seconds, so truncation turned a short graceful stop into an immediate kill. Reachable only from a programmatically built config.
  • container/healthcheck.go is removed. HealthChecker, WaitForHTTP and WaitForTCP lost their only production caller in an earlier refactor.

Dewy's own shutdown keeps its fixed 10 second stop window, so a generous drain budget cannot stall exit past a service manager's stop timeout.

Tests

  • New healthfail e2e variant covers the health check failure path, which had no coverage in any mode (#479). It asserts that the configured budget reaches the probe, and that a replica failing its health check is rolled back rather than stranded.
  • e2e now asserts that --drain-time reaches the old-container stop.

Security

Maintenance

  • Dependabot scope narrowed to Go modules at the repository root (#473).
  • Dependency bumps: aws-sdk-go-v2/config (#474), aws-sdk-go-v2/service/s3 (#475), prometheus/client_golang (#476).

Full Changelog: v2.19.0...v2.19.1

⌂ 换网址