Skip to content
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
2 changes: 1 addition & 1 deletion ramalama/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def configure_arguments(parser):
)
parser.add_argument(
"--image",
default=accel_image(CONFIG),
default=accel_image(CONFIG, nopull=True),
help="OCI container image to run with the specified AI model",
action=OverrideDefaultAction,
completer=local_images,
Expand Down
4 changes: 2 additions & 2 deletions ramalama/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ class AccelImageArgsOtherRuntimeRAG(Protocol):
AccelImageArgs = None | AccelImageArgsVLLMRuntime | AccelImageArgsOtherRuntime | AccelImageArgsOtherRuntimeRAG


def accel_image(config: Config) -> str:
def accel_image(config: Config, nopull=False) -> str:
"""
Selects and the appropriate image based on config, arguments, environment.
"""
Expand All @@ -650,7 +650,7 @@ def accel_image(config: Config) -> str:
return "registry.redhat.io/rhelai1/ramalama-vllm"

vers = minor_release()
if attempt_to_use_versioned(config.engine, image, vers, True):
if nopull or attempt_to_use_versioned(config.engine, image, vers, True):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new logic path introduced by the nopull flag is not covered by existing unit tests. To ensure the correctness of this change and prevent future regressions, please consider adding a test case to test/unit/test_common.py that verifies the behavior when nopull=True.

The test should:

  1. Call accel_image(config, nopull=True).
  2. Assert that the returned image name has the correct version tag.
  3. Assert that attempt_to_use_versioned is not called, for example by using mock.assert_not_called().

return f"{image}:{vers}"

return f"{image}:latest"
Expand Down
Loading