Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor RAMALAMA_IMAGE if set #733

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ramalama/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
MNT_FILE = f"{MNT_DIR}/model.file"
HTTP_RANGE_NOT_SATISFIABLE = 416

DEFAULT_IMAGE="quay.io/ramalama/ramalama"

def container_manager():
engine = os.getenv("RAMALAMA_CONTAINER_ENGINE")
Expand Down Expand Up @@ -156,7 +157,7 @@ def default_image():
if image:
return image

return "quay.io/ramalama/ramalama"
return DEFAULT_IMAGE


def genname():
Expand Down
4 changes: 2 additions & 2 deletions ramalama/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ramalama.common import (
container_manager,
default_image,
DEFAULT_IMAGE,
exec_cmd,
genname,
run_cmd,
Expand Down Expand Up @@ -106,7 +106,7 @@ def attempt_to_use_versioned(self, conman, image, vers, args):
return False

def _image(self, args):
if args.image != default_image():
if args.image != DEFAULT_IMAGE:
return args.image

env_vars = get_env_vars()
Expand Down
4 changes: 2 additions & 2 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ load helpers
run_ramalama 1 --nocontainer run --name foobar tiny
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}:latest llama-run" "verify image name"
RAMALAMA_IMAGE=${image}:1234 run_ramalama --dryrun run ${model}
is "$output" ".*${image}:1234 llama-run" "verify image name"
else
run_ramalama --dryrun run -c 4096 ${model}
is "$output" 'llama-run -c 4096 --temp 0.8.*/path/to/model.*' "dryrun correct"
Expand Down
Loading