I've done a few experiments with writing some Dagger tasks and in general really like how its scriptable and flexible. However, I'm having issues understanding how I can really run them in a CI pipeline actually triggered on git pushes in a repository.
From what I can gather in the documentation the current best practice is to sort of use your existing pipeline provider (e.g. Gitlab) as just a launcher for the containerized Dagger task. I am finding it a little difficult to see how things fit together nicely given this assumption.
My specific situation is that I have a new monorepo using Gitlab CI with self-hosted runners using their Kubernetes runner. The code and pipelines are small, but will be rapidly getting more complex as I want to implement logic for running only specific tasks in CI depending on what actually changed in the repo. Ultimately I would rather not have Gitlab CI/CD at all and just use Dagger, however currently to just use Gitlab CI as a connector to the git repo and launcher of Dagger tasks is fine. However, the problem is that I still need to implement most of the workflow level logic in my Gitlab CI/CD pipeline (i.e. run this job under this condition; run this task before this task, this task can fail) because if implement all my logic in python code around Dagger it will all run in the same job. This is bad primarily because I would normally get a new pod in the cluster created for each Gitlab job that runs in parallel. Secondarily I don't get the visualization of the pipeline. AFAIU there is some work being done for a paid offering to replace e.g. Gitlab as the launcher.
The other issue is just the extra layers of containers that comes along with piggybacking on another systems runners. For instance the Gitlab runner for Kubernetes will launch each job in a new pod with the container image for that job. To use Dagger I need to run podman (since its not very easy/secure to run Docker in K8s) and have Dagger launch another container.