Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Dagger Enables Developer Functions for CI/CD and Opens the Daggerverse

Dagger Enables Developer Functions for CI/CD and Opens the Daggerverse

The open-source Dagger project, which aims to be "CI/CD as code that runs anywhere," recently released version 0.10. This release introduced custom Dagger Functions, a feature that simplifies CI scripts while expanding possibilities for developers seeking cleaner, more efficient pipelines. Also announced was the Daggerverse, a searchable index for public Dagger Functions.

Dagger Functions are the interface to the fundamental operations in Dagger, as each core operation is exposed via the API as a function. The recent release adds capabilities to allow developers to write their own functions, package them as reusable modules, and call them directly from the CLI. The new release adds the following new functionality:

Custom Function Authorship: This feature enables developers to create their own Dagger Functions, extending the API's capabilities infinitely. Developers can write functions using the Dagger SDK, which allows them to code Dagger Functions in languages like Go, Python, and TypeScript. The Dagger Engine compiles developers' functions into a specialized container at runtime, exposing a custom GraphQL API for invocation. This makes the functions immediately composable into dynamic pipelines, just like core Dagger functionality. Functions can call other functions, and they don't all have to be written in the same language.

Reusable Modules: Dagger Functions are designed for safe reuse, fostering collaboration within the community. Developers can easily share and consume functions packaged into Dagger Modules. These modules are hosted as source code in a Git repository, ensuring decentralized distribution, version control, and dependency management, and without opinions about repository layout. When the modules are run, they are built locally. Semantic versioning is accommodated, and dependencies are pinned by default.

CLI Integration: Dagger Functions can be called directly from the command line interface using the Dagger CLI tool. This allows developers to run functions either from local storage or directly from a Git repository. The CLI introspects the module's API and exposes available functions and arguments, streamlining the invocation process.

Shortly after the release of Dagger Functions, Dagger also announced the Daggerverse, a searchable index of publically available functions intended to allow developers to discover great modules provided by the community. This provides easy access to modules for common tasks such as linting, building, security scanning, secrets integration and deployment to popular cloud providers.

Dagger Functions are initially targeted towards CI optimization, but their versatility could extend beyond traditional CI workflows. Potential applications include test data management and SaaS integration. The Dagger team anticipates broader adoption across various development domains. Reaction from the community has been positive; writing on X (formerly Twitter), Tom Hacohen says:

"I first saw a demo of Dagger two years ago and you could sense something big was brewing. Now with Dagger functions [...] it really feels like something we'll all be using".

The Dagger team suggests starting a migration by replacing cumbersome scripts and incrementally integrating Dagger Functions into projects. Quickstart Guides and Developer Module Guides cater to both newcomers and seasoned users, ensuring a smooth onboarding experience.

About the Author

Rate this Article