Closed rhatdan closed 1 week ago
The PR modifies the command execution in containers by wrapping the command in a shell environment and redirecting stderr to /dev/null by default. This change is implemented by using /bin/sh -c
to execute the command, with stderr redirection disabled when debug mode is enabled.
sequenceDiagram
participant User
participant Container
User->>Container: Execute command
alt Debug mode enabled
Container->>Container: /bin/sh -c "command"
else
Container->>Container: /bin/sh -c "command 2> /dev/null"
end
Change | Details | Files |
---|---|---|
Modified command execution to suppress stderr output by default |
|
ramalama/model.py |
@ericcurtin @bmahabirbu PTAL
@ericcurtin @bmahabirbu PTAL
Tested and works! Thank you!
Still does not work as well as I would hope.
$ ./bin/ramalama --nocontainer run tiny
.....................................................................................
main: interactive mode on.
== Running in interactive mode. ==
- Press Ctrl+C to interject at any time.
- Press Return to return control to the AI.
- To return control without starting a new line, end your input with '/'.
- If you want to submit another line, end your input with '\'.
>
Versus:
$ ./bin/ramalama run tiny
>
Something about the container is causing lama-cli to not show the nice prompt.
Instead of runing the container staight away run it in a shell -c environment with 2> /dev/null, to eliminate the stderr output.
Fixes: https://github.com/containers/ramalama/issues/431
Summary by Sourcery
Bug Fixes: