Dagger Functions
dagger.io
dagger.io
> Dagger Functions are a core feature of the Dagger Engine, which we are expanding and making available to all developers.
Yeah not great
The final aspect is that, typically, you wouldn't interact directly with the GraphQL API. Dagger provides wrappers for it in several languages.
Dagger 0.10 enables you to define and invoke your own functions, in addition to those already defined in the core Dagger API.
The initial purpose was to simplify the process of running the same task in any environment. For example, it allows you to replace the cumbersome YAML step definitions of CI/CD systems and effortlessly execute the same task both remotely and locally.
as best I can tell: It seems their innovation is that instead of having a GitHub Action in JavaScript as the reusable step in CI, one can build up company-specific "Dagger Actions" in any language the Dagger Engine supports, then invoke them in a versioned way that receives rich objects as parameters, ala PowerShell (e.g. not text, actual live objects)
# GHA way
jobs:
example:
steps:
- name: old way
uses: example/my-awesome-step@v5
# Dagger way
steps:
- name: Call Dagger Function
uses: dagger/dagger-for-github@v5
with:
version: "0.10.0"
verb: call
module: github.com/example-co/our-awesome-step-in-our-language@v0.5
and one may wonder, "but why?" and the theory is that unlike nektos/act which is a very, very skeletal implementation of GHA for local, dagger should(!) allow a local build step (or even GitLab CI, or Jenkins) that runs the same as GHA, promoting CI agnostic build pipelines: # .gitlab-ci.yml
example:
extends: [.docker-dind-good-luck-lol]
script:
- dagger call -m github.com/example-co/our-awesome-step-in-our-language@v0.5