Skip to content

Commit

Permalink
Honor RAMALAMA_IMAGE if set
Browse files Browse the repository at this point in the history
Currently on my cuda laptop, if I set RAMALAMA_IMAGE to something,
ramalama ignores it and forces cuda image.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Feb 4, 2025
1 parent 0388554 commit ed69141
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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
3 changes: 2 additions & 1 deletion ramalama/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from ramalama.common import (
container_manager,
DEFAULT_IMAGE,
default_image,
exec_cmd,
genname,
Expand Down Expand Up @@ -106,7 +107,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

0 comments on commit ed69141

Please sign in to comment.