mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-26 09:15:40 +00:00
chore(telemetry): add an arguement to select conatiner runtime explicitly (#3896)
# What does this PR do? ## Test Plan ❯ ./scripts/telemetry/setup_telemetry.sh --container docker
This commit is contained in:
parent
658fb2c777
commit
d12e5f0999
1 changed files with 53 additions and 8 deletions
|
|
@ -16,14 +16,59 @@
|
|||
|
||||
set -Eeuo pipefail
|
||||
|
||||
if command -v podman &> /dev/null; then
|
||||
CONTAINER_RUNTIME="podman"
|
||||
elif command -v docker &> /dev/null; then
|
||||
CONTAINER_RUNTIME="docker"
|
||||
else
|
||||
echo "🚨 Neither Podman nor Docker could be found"
|
||||
echo "Install Docker: https://docs.docker.com/get-docker/ or Podman: https://podman.io/getting-started/installation"
|
||||
exit 1
|
||||
# Parse arguments
|
||||
CONTAINER_RUNTIME=""
|
||||
|
||||
print_usage() {
|
||||
echo "Usage: $0 [--container docker|podman]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -c, --container Choose container runtime (docker or podman)."
|
||||
echo " -h, --help Show this help."
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-c|--container)
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "🚨 --container requires a value: docker or podman"
|
||||
exit 1
|
||||
fi
|
||||
case "$2" in
|
||||
docker|podman)
|
||||
CONTAINER_RUNTIME="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "🚨 Invalid container runtime: $2"
|
||||
echo "Valid options are: docker, podman"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-h|--help)
|
||||
print_usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "🚨 Unknown argument: $1"
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Detect container runtime if not specified
|
||||
if [[ -z "$CONTAINER_RUNTIME" ]]; then
|
||||
if command -v podman &> /dev/null; then
|
||||
CONTAINER_RUNTIME="podman"
|
||||
elif command -v docker &> /dev/null; then
|
||||
CONTAINER_RUNTIME="docker"
|
||||
else
|
||||
echo "🚨 Neither Podman nor Docker could be found"
|
||||
echo "Install Docker: https://docs.docker.com/get-docker/ or Podman: https://podman.io/getting-started/installation"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "🚀 Setting up telemetry stack for Llama Stack using $CONTAINER_RUNTIME..."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue