Skip to content

Commit

Permalink
Merge pull request #436 from rhatdan/stderr
Browse files Browse the repository at this point in the history
Run the command by default without stderr
  • Loading branch information
rhatdan authored Nov 9, 2024
2 parents 0b29550 + 75e09ec commit b16b4ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ramalama/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import glob
import atexit
import shlex

from ramalama.common import (
default_image,
Expand Down Expand Up @@ -228,7 +229,11 @@ def exec_model_in_container(self, model_path, cmd_args, args):

# Make sure Image precedes cmd_args.
conman_args += [self._image(args)]
conman_args += cmd_args
cargs=shlex.join(cmd_args)
if not args.debug:
cargs += " 2> /dev/null"
conman_args += ["/bin/sh", "-c", cargs]


if args.dryrun:
dry_run(conman_args)
Expand Down
2 changes: 1 addition & 1 deletion test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ load helpers
is "${lines[0]}" "Error: --nocontainer and --name options conflict. --name requires a container." "conflict between nocontainer and --name line"

RAMALAMA_IMAGE=${image} run_ramalama --dryrun run ${model}
is "$output" ".*${image} llama-cli -m" "verify image name"
is "$output" ".*${image} /bin/sh -c" "verify image name"
}

# FIXME no way to run this reliably without flakes in CI/CD system
Expand Down

0 comments on commit b16b4ac

Please sign in to comment.