simplism icon indicating copy to clipboard operation
simplism copied to clipboard

🐳 spawn a new process failed if the dockerized app is built with a `WORKDIR`

Open k33g opened this issue 1 year ago • 0 comments

FROM k33g/simplism:0.1.2

WORKDIR /app

COPY simplism-config.yaml .

EXPOSE 7000

CMD ["/simplism", "config", "./simplism-config.yaml", "faas-config"]

When deploying with:

curl -X POST \
http://localhost:9000/spawn \
--data-binary @- << EOF
{
    "wasm-file":"./tmp/hello-world.wasm", 
    "wasm-function":"handle",
    "wasm-url": "https://github.com/simplism-registry/hello-world/releases/download/v0.0.1/hello-world.wasm",
    "discovery-endpoint":"http://localhost:7000/discovery", 
    "service-name": "hello-world"
}
EOF

The process fails, and the container stops:

😡 Error when spawning a new simplism process: ./tmp/hello-world.wasm fork/exec ./simplism: no such file or directory

🤔 see https://github.com/bots-garden/simplism/blob/main/helpers/processes/processes-helper.go#L59C11-L59C28

cmd := &exec.Cmd{
  Path:   GetExecutablePath("simplism"),
  Args:   spawnArgs,
  Stdout: os.Stdout,
  Stderr: os.Stdout,
}

It looks like the GetExecutablePath does not return the appropriate path

k33g avatar Jan 21 '24 18:01 k33g