leopardslab / dunner

Dunner is a task runner tool like Grunt but used Docker images like CircleCI do. You can define tasks and steps of the tasks in your `.dunner.yaml` file and then run these steps with `Dunner do taskname`
MIT License
65 stars 41 forks source link

Ability to use dunner with docker images whose entrypoint is defined #175

Open apoorvam opened 4 years ago

apoorvam commented 4 years ago

For Docker images whose entrypoint is defined and are run as an executable, Dunner fails to execute commands defined in it.

Example: Goreleaser's docker file.

Dunner task file:

tasks:
  release:
    steps:
      - image: goreleaser/goreleaser
        commands:
          - ["echo", "hello"]
          - ["goreleaser", "--version"]

Running this command with dunner fails with error as:

OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown
FATA[2019-08-26 18:39:51] docker: command execution failed with exit code 126
apoorvam commented 4 years ago

Solutions discussed:

Solution 1:

Combine all user commands and pass it as default command(instead of current tail -f /dev/null as default command to create container) to execute the shell script Cons:

Solution 2:

Find the entrypoint and override it with bash or cmd based on OS

Will research more on how this can be fixed and post update.

apoorvam commented 4 years ago

Resetting entrypoint seems to fix this issue. PR: https://github.com/leopardslab/dunner/pull/176

agentmilindu commented 4 years ago

What if the entry point is something like /app/src/python/main/analyze.py? Then someone who uses this docker needs to put this again and again in commands, right?

tasks:
  release:
    steps:
      - image: SCoRe/MLKit
        commands:
          - ["/app/src/python/main/analyzer.py", "analyze", "--algo","ImageNet"]
apoorvam commented 4 years ago

Right, no default command/args will be set. User will have to use it in shell mode and not as an executable. @agentmilindu

agentmilindu commented 4 years ago

Is some cases, users really don't know what is the entry point is. I strongly suggests against users having to define the entry point in commands.

WDYT @PratikDhanave @tdevinda @charithccmc @tharindupr @rehrumesh?