| 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright (c) Meta Platforms, Inc. and affiliates. |
| 4 | # All rights reserved. |
| 5 | # |
| 6 | # This source code is licensed under the terms described in the LICENSE file in |
| 7 | # the root directory of this source tree. |
| 8 | |
| 9 | set -euo pipefail |
| 10 | |
| 11 | error_handler() { |
| 12 | echo "Error occurred in script at line: ${1}" >&2 |
| 13 | exit 1 |
| 14 | } |
| 15 | |
| 16 | trap 'error_handler ${LINENO}' ERR |
| 17 | |
| 18 | if [ $# -lt 2 ]; then |
| 19 | echo "Usage: $0 <container name> <build file path>" |
| 20 | exit 1 |
| 21 | fi |
| 22 | |
| 23 | docker_image="$1" |
| 24 | host_build_dir="$2" |
| 25 | container_build_dir="/app/builds" |
| 26 | |
| 27 | set -x |
| 28 | podman run -it \ |
| 29 | -v $host_build_dir:$container_build_dir \ |
| 30 | $docker_image \ |
| 31 | llama stack configure ./llamastack-build.yaml --output-dir $container_build_dir |