Dewy
website·Indexed 32 days ago
https://dewy.linyo.ws/Software for declaratively deploying applications in non-Kubernetes environments. Dewy provides zero-downtime deployments, automated continuous delivery via registry monitoring, and support for both containerized workloads and binary artifacts. It features a CLI with commands like `server`, `assets`, and `container`, built-in OpenTelemetry support, and flexible cache storage options including local filesystem and Amazon S3.
What's inside Dewy
- Deployment hooks allow the execution of arbitrary shell commands before and after the automated deployment process. They provide full access to environment variables and the file system, and record detailed execution results including stdout, stderr, exit codes, and duration.
Overview of Dewy Supported Registries
Dewy uses a Registry component to handle application and file version management, automatically detecting the latest version based on semantic versioning for continuous deployment. Supported registry types include:
- GitHub Releases (
ghr://) - AWS S3 (
s3://) - Google Cloud Storage (
gs://) - OCI Registry (
img://): Supports Docker Hub, GHCR, GCR, ECR, and other OCI-compliant registries. - gRPC (
grpc://): Custom gRPC servers.
- GitHub Releases (
Overview of the Dewy deployment workflow
Dewy implements continuous application delivery by periodically monitoring registries (default interval: 10 seconds) for new releases. When a new version is detected, it automatically executes a sequence of phases to update the application without manual intervention. The workflow consists of:
- Check: Retrieves latest release info from registries (e.g., GitHub Releases, S3, GCS).
- Cache: Verifies if the version is already cached to avoid redundant downloads.
- Download: Retrieves binaries and persists them to local cache only after the download is complete to prevent corruption.
- Deploy: Extracts artifacts to a timestamped directory and updates a
currentsymbolic link for atomic switching. - Startup Control: Manages server restart (via SIGHUP) or startup using the server-starter library.
Overview of Dewy declarative deployment
Dewy is an open-source (MIT License) deployment tool designed for non-Kubernetes environments such as VPS, virtual machines, and bare metal. Unlike imperative tools (Ansible, shell scripts), Dewy is declarative: you define the desired state, and the tool continuously maintains it. It uses a pull-based architecture where servers poll registries for updates, eliminating the need for inbound SSH connections or complex firewall rules.Overview of Dewy declarative deployment
Dewy is a software tool used for declaratively deploying applications in non-Kubernetes environments (such as single physical hosts or virtual machines). It ensures that applications and data on servers remain up-to-date using a pull-based deployment model. It is particularly useful for teams needing audit logs and shared visibility into deployments without the complexity of Kubernetes.Overview of Dewy Artifact Types and Storage
Dewy uses Artifacts to manage application binaries and files, downloading them based on registry versions for deployment. It supports the following artifact types via specific URI schemes:- GitHub Releases: ghr:// - AWS S3: s3:// - Google Cloud Storage: gs://Overview of Dewy End-to-End Testing
Dewy employs a comprehensive end-to-end (E2E) testing suite powered by Probe, a declarative workflow tool. The testing philosophy focuses on real-world scenarios, including building actual binaries, creating real releases on registries, and verifying that new app versions start correctly without log errors.Overview of Dewy Telemetry Architecture
Dewy uses the OpenTelemetry (OTel) SDK to monitor proxy performance, deployment activity, and container health. The telemetry behavior differs based on the operating mode:
- Container Mode: Dewy acts as a standalone reverse proxy. It uses its own telemetry pipeline with two export paths: a Prometheus exporter (exposing a
/metricsendpoint on the Admin API) and an OTLP exporter (sending metrics to an OTel Collector via gRPC). - Server Mode: Dewy runs as part of the application. Application-level telemetry should be handled by the application's own OTel SDK. Dewy specifically reports supervisor-level events, such as deployment activity and process restarts, via the
/metricsendpoint.
- Container Mode: Dewy acts as a standalone reverse proxy. It uses its own telemetry pipeline with two export paths: a Prometheus exporter (exposing a
Deploy container images from OCI Registries
Use thedewy containercommand with theimg://protocol to deploy images. Dewy supports multiple registries including GHCR, Docker Hub, Google Artifact Registry, and AWS ECR. It automatically selects the appropriate architecture using the OCI Image Index (manifest list).# GitHub Container Registry (GHCR) dewy container --registry img://ghcr.io/owner/app # Docker Hub (Official image) dewy container --registry img://docker.io/library/nginx # Docker Hub (User image - docker.io is default) dewy container --registry img://myuser/myapp # Google Artifact Registry dewy container --registry img://gcr.io/my-project/myapp # AWS ECR dewy container --registry img://123456789.dkr.ecr.ap-northeast-1.amazonaws.com/myappInspect current deployment artifacts
Thedewy assetscommand provides detailed information about current artifacts to help verify deployment status.dewy assets [options]Choose between Dewy Supervisor Mode and Proxy Mode
Dewy provides two deployment modes based on the target workload:
- Supervisor Mode (used with
serverorassetscommands): Acts as a process supervisor for binary applications (e.g., tar.gz, zip) deployed directly on VMs or bare-metal. It manages applications as child processes. - Proxy Mode (used with
containercommand): Manages OCI container images via Docker or Podman. It includes a built-in TCP reverse proxy to handle traffic and rolling updates.
- Supervisor Mode (used with
Implement zero-downtime deployments with Dewy's built-in proxy
Dewy uses a built-in reverse proxy (based on Go'snet/http/httputil.ReverseProxy) to achieve zero-downtime deployments. It ensures security by mapping containers only to localhost (127.0.0.1), preventing external network access to the containers directly. The proxy handles atomic backend switching and automatic rollbacks if health checks fail. All external traffic enters through a single configured port, while Docker assigns random localhost ports to containers to avoid conflicts.