-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from rhatdan/docker
Add ramalama info command
- Loading branch information
Showing
7 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
% ramalama-info 1 | ||
|
||
## NAME | ||
ramalama\-info - Display RamaLama configuration information | ||
|
||
|
||
## SYNOPSIS | ||
**ramalama info** [*options*] | ||
|
||
## DESCRIPTION | ||
Display configuration information in a json format. | ||
|
||
## OPTIONS | ||
|
||
#### **--help**, **-h** | ||
show this help message and exit | ||
|
||
## EXAMPLE | ||
|
||
Info all Models downloaded to users homedir | ||
``` | ||
$ ramalama info | ||
{ | ||
"Engine": "podman", | ||
"Image": "quay.io/ramalama/ramalama:latest", | ||
"Runtime": "llama.cpp", | ||
"Store": "/home/dwalsh/.local/share/ramalama", | ||
"Version": "0.0.18" | ||
} | ||
``` | ||
|
||
## SEE ALSO | ||
**[ramalama(1)](ramalama.1.md)** | ||
|
||
## HISTORY | ||
Oct 2024, Originally compiled by Dan Walsh <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
# bats test_tags=distro-integration | ||
@test "ramalama info" { | ||
#FIXME jq version on mac does not like regex handling | ||
skip_if_darwin | ||
run_ramalama 2 info bogus | ||
is "$output" ".*ramalama: error: unrecognized arguments: bogus" | ||
|
||
run_ramalama -v | ||
version=$(cut -f3 -d " " <<<"$output") | ||
|
||
run_ramalama info | ||
|
||
# FIXME Engine (podman|docker|'') | ||
tests=" | ||
Image | "quay.io/ramalama/ramalama:latest" | ||
Runtime | "llama.cpp" | ||
Version | "${version}" | ||
Store | "${HOME}/.local/share/ramalama" | ||
" | ||
|
||
defer-assertion-failures | ||
|
||
while read field expect; do | ||
actual=$(echo "$output" | jq -r ".$field") | ||
dprint "# actual=<$actual> expect=<$expect>" | ||
is "$actual" "$expect" "jq .$field" | ||
done < <(parse_table "$tests") | ||
|
||
image=i_$(safename) | ||
runtime=vllm | ||
engine=e_$(safename) | ||
store=s_$(safename) | ||
|
||
run_ramalama --store $store --runtime $runtime --engine $engine --image $image info | ||
tests=" | ||
Engine | $engine | ||
Image | $image | ||
Runtime | $runtime | ||
Store | $store | ||
" | ||
|
||
defer-assertion-failures | ||
|
||
while read field expect; do | ||
actual=$(echo "$output" | jq -r ".$field") | ||
dprint "# actual=<$actual> expect=<$expect>" | ||
is "$actual" "$expect" "jq .$field" | ||
done < <(parse_table "$tests") | ||
|
||
} | ||
|
||
# vim: filetype=sh |