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.

Tokens
23.8K
Snippets
124
Records
178
Agent score
54%

What's inside Dewy

  1. Overview of Dewy Deployment Hooks

    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.
  2. 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.
  3. 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:

    1. Check: Retrieves latest release info from registries (e.g., GitHub Releases, S3, GCS).
    2. Cache: Verifies if the version is already cached to avoid redundant downloads.
    3. Download: Retrieves binaries and persists them to local cache only after the download is complete to prevent corruption.
    4. Deploy: Extracts artifacts to a timestamped directory and updates a current symbolic link for atomic switching.
    5. Startup Control: Manages server restart (via SIGHUP) or startup using the server-starter library.
  4. 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.
  5. 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.
  6. 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://
  7. 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.
  8. 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 /metrics endpoint 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 /metrics endpoint.
  9. Deploy container images from OCI Registries

    Use the dewy container command with the img:// 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/myapp
  10. Inspect current deployment artifacts

    The dewy assets command provides detailed information about current artifacts to help verify deployment status.
    dewy assets [options]
  11. Choose between Dewy Supervisor Mode and Proxy Mode

    Dewy provides two deployment modes based on the target workload:

    1. Supervisor Mode (used with server or assets commands): 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.
    2. Proxy Mode (used with container command): Manages OCI container images via Docker or Podman. It includes a built-in TCP reverse proxy to handle traffic and rolling updates.
  12. Implement zero-downtime deployments with Dewy's built-in proxy

    Dewy uses a built-in reverse proxy (based on Go's net/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.