Skip to content

Commit 17be460

Browse files
committed
Update demo scripts to show serve
Signed-off-by: Daniel J Walsh <[email protected]>
1 parent 8440be9 commit 17be460

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

docs/demo/ramalama.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ run() {
7171
echo_color "Serve granite via RamaLama run"
7272
exec_color "ramalama --dryrun run granite | grep --color podman"
7373
echo ""
74-
exec_color "ramalama --dryrun run granite | grep --color quay.io.*latest"
74+
exec_color "ramalama --dryrun run granite | grep --color \"quay.io[^ ]*\""
7575
echo ""
7676
exec_color "ramalama --dryrun run granite | grep --color -- --cap-drop.*privileges"
7777
echo ""
@@ -88,7 +88,7 @@ run() {
8888

8989
serve() {
9090
echo_color "Serve granite via RamaLama model service"
91-
exec_color "ramalama serve --name granite-service -d granite"
91+
exec_color "ramalama serve --port 8080 --name granite-service -d granite"
9292
echo ""
9393

9494
echo_color "List RamaLama containers"
@@ -99,6 +99,23 @@ serve() {
9999
exec_color "podman ps "
100100
echo ""
101101

102+
echo_color "Use web browser to show interaction"
103+
exec_color "firefox http://localhost:8080"
104+
105+
echo_color "Stop the ramalama container"
106+
exec_color "ramalama stop granite-service"
107+
echo ""
108+
109+
echo_color "Serve granite via RamaLama model service"
110+
exec_color "ramalama serve --port 8085 --api llama-stack --name granite-service -d granite"
111+
echo ""
112+
113+
# echo_color "Use web browser to show interaction"
114+
# exec_color "firefox http://localhost:8085"
115+
116+
# echo_color "Use web browser to show interaction"
117+
# exec_color "firefox http://localhost:8085/v1/openai"
118+
102119
echo_color "Stop the ramalama container"
103120
exec_color "ramalama stop granite-service"
104121
echo ""
@@ -161,6 +178,8 @@ pull
161178

162179
run
163180

181+
serve
182+
164183
kubernetes
165184

166185
quadlet

ramalama/engine.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import ramalama.common
99
from ramalama.common import check_nvidia, exec_cmd, get_accel_env_vars, perror, run_cmd
1010
from ramalama.console import EMOJI
11+
from ramalama.logger import logger
1112

1213

1314
class Engine:
@@ -269,10 +270,12 @@ def stop_container(args, name):
269270
pod = ""
270271
try:
271272
pod = inspect(args, name, format="{{ .Pod }}", ignore_stderr=True)
272-
except Exception:
273+
except Exception as e:
274+
logger.debug(e)
273275
try:
274276
pod = inspect(args, f"{name}-pod-model-server", format="{{ .Pod }}", ignore_stderr=True)
275-
except Exception: # Ignore errors, the stop command will handle it.
277+
except Exception as e: # Ignore errors, the stop command will handle it.
278+
logger.debug(e)
276279
pass
277280

278281
if pod != "":

0 commit comments

Comments
 (0)