Platform Tips #18: Dagger - The Future of CI/CD For Platform Teams?
Dagger could be the future of CI/CD For Platform Engineering teams and I explain why.
Hey Folks 👋,
I'm Romaric, CEO of Qovery, and this is my 18th Platform Tips post.
This week I was at Kubecon, and I experienced a demonstration by Solomon Hykes and his team about Dagger; I'm inspired to share why I believe it could be a game-changer for CI/CD in the Platform Engineering space.
Here’s a closer look at the potential of Dagger to redefine CI/CD practices:
Prioritizing Developer Experience
Dagger takes a novel approach to the developer experience by doing away with the need for a specialized domain-specific language (DSL). Developers can leverage the Dagger library within their preferred programming environment, making the process more intuitive and straightforward.
Here is an example in TS:
import { dag, Container, Directory, object, func } from "@dagger.io/dagger"
@object()
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class Ci {
/**
* example usage: "dagger call ci --source ."
*/
@func()
async ci(source: Directory): Promise<string> {
// Use Golang module to configure project
var goProject = dag.golang().withProject(source)
// Run Go tests using Golang module
await goProject.test()
// Get container with built binaries using Golang module
var image = await goProject.buildContainer()
// Push image to a registry using core Dagger API
var ref = await image.publish("ttl.sh/demoapp:1h")
// Scan image for vulnerabilities using Trivy module
return dag.trivy().scanContainer(dag.container().from(ref))
}
}
To execute it, you simply need to install the dagger binary in your machine and run:
$ dagger call ci --source .
This shift not only simplifies the workflow for developers but also allows them to concentrate on building stuff rather than learning complex pipeline syntax.
Streamlining Development with Local Iterations
A common hurdle in traditional CI/CD practices is the delay caused by the need to push changes to test pipeline functionality. Dagger elegantly addresses this challenge by enabling the entire CI/CD process to run locally.
“Push and Pray” is spot on 🎯
If everything works in the local environment, it will seamlessly transition to remote execution. This enhancement significantly speeds up the development cycle by providing immediate feedback, encouraging a more dynamic and efficient approach to building software.
Advancing Pipeline Flexibility and Troubleshooting
With Dagger, building, iterating on, and troubleshooting CI/CD pipelines become as routine as any other coding task. This level of control and flexibility opens up possibilities for writing unit tests for pipelines, ensuring their effectiveness before they're deployed.
This proactive approach to identifying and resolving issues shifts the focus from reactive fixes to preventive measures, ultimately leading to more stable and reliable deployment processes.
Encouraging a Culture of Shared Responsibility
Dagger promotes a culture where the maintenance and success of CI/CD pipelines are a collective responsibility, transcending traditional boundaries to include everyone in the development process. This model of shared responsibility not only enhances team collaboration but also contributes to a more robust and efficient deployment strategy, benefiting the entire organization.
The Future of CI/CD
For me, it’s clear that tools like Dagger are setting the stage for a new era in software deployment and management. By focusing on enhancing the developer experience, enabling rapid local development cycles, and fostering a collaborative environment, Dagger is reimagining CI/CD practices and paving the way for their evolution.
—
Let's revolutionize Platform Engineering by putting developers first. Subscribe now to join me on this exciting journey!