dagger-for-github icon indicating copy to clipboard operation
dagger-for-github copied to clipboard

🐞 Engine stop is not called when the pipeline fails

Open sagikazarmark opened this issue 2 years ago • 2 comments

What is the issue?

When the Dagger command fails for any reason, engine stop is not called.

The GitHub snippet in the documentation has an added condition to make sure engine stop runs even if the command before it fails:

      - name: Stop Engine
        run: docker stop -t 300 $(docker ps --filter name="dagger-engine-*" -q)
        if: always()

Dagger version

dagger v0.9.7 (registry.dagger.io/engine) darwin/arm64

Steps to reproduce

No response

Log output

No response

sagikazarmark avatar Jan 22 '24 20:01 sagikazarmark

Yeah, the proper fix is to update the action to a "real" action instead of a composite action. Composite actions aren't allowed to have post steps for some reason.

A post step for the engine stop handles the cases where:

  • A step fails
  • Multiple uses of this action are called in a pipeline and we only want to stop the engine once at the very end

kpenfound avatar Feb 13 '24 18:02 kpenfound

  • A step fails
  • Multiple uses of this action are called in a pipeline and we only want to stop the engine once at the very end

Looks like a lot of GH Actions users want pre/post steps. https://github.com/actions/runner/issues/1478

jpadams avatar Mar 12 '24 18:03 jpadams

Engine-stop is now gone 👍

kpenfound avatar Sep 16 '25 18:09 kpenfound