Skip to content

Commit

Permalink
Merge pull request #810 from benoitf/RMLM-798
Browse files Browse the repository at this point in the history
feat: add ramalama labels about the execution on top of container
  • Loading branch information
rhatdan authored Feb 13, 2025
2 parents 08c5e25 + 94166f3 commit dcabb94
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 dcabb94

Please sign in to comment.