Skip to content

Commit

Permalink
feat: add ramalama labels about the execution on top of container
Browse files Browse the repository at this point in the history
fixes #798

Signed-off-by: Florent Benoit <[email protected]>
  • Loading branch information
benoitf committed Feb 13, 2025
1 parent 08c5e25 commit 94166f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ramalama/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ def setup_container(self, args):
"--init",
]

container_labels = []
if hasattr(args, "MODEL"):
container_labels += ["--label", f"ai.ramalama.model={args.MODEL}"]
if hasattr(args, "engine"):
container_labels += ["--label", f"ai.ramalama.engine={args.engine}"]
if hasattr(args, "runtime"):
container_labels += ["--label", f"ai.ramalama.runtime={args.runtime}"]
if hasattr(args, "port"):
container_labels += ["--label", f"ai.ramalama.port={args.port}"]
if hasattr(args, "subcommand"):
container_labels += ["--label", f"ai.ramalama.command={args.subcommand}"]
conman_args.extend(container_labels)

if os.path.basename(args.engine) == "podman":
conman_args += ["--pull=newer"]
if args.podman_keep_groups:
Expand Down

0 comments on commit 94166f3

Please sign in to comment.