Skip to content

Commit cb36be3

Browse files
authored
Fix podman+selinux compatibility (meta-llama#132)
When I ran `llama stack configure` for my `docker` based stack on my system using podman + SELinux (CentOS Stream 9), The `podman run` command failed due to SELinux blocking access to the volume mount. As a simple fix, disable SELinux label checking. Signed-off-by: Russell Bryant <rbryant@redhat.com>
1 parent 2bd7853 commit cb36be3

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

llama_stack/distribution/build_container.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ if [ -n "$LLAMA_MODELS_DIR" ]; then
117117
mounts="$mounts -v $(readlink -f $LLAMA_MODELS_DIR):$models_mount"
118118
fi
119119

120+
# Disable SELinux labels -- we don't want to relabel the llama-stack source dir
121+
DOCKER_OPTS="$DOCKER_OPTS --security-opt label=disable"
122+
120123
set -x
121124
$DOCKER_BINARY build $DOCKER_OPTS -t $image_name -f "$TEMP_DIR/Dockerfile" "$REPO_DIR" $mounts
122125
set +x

llama_stack/distribution/configure_container.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ docker_image="$1"
2727
host_build_dir="$2"
2828
container_build_dir="/app/builds"
2929

30+
# Disable SELinux labels
31+
DOCKER_OPTS="$DOCKER_OPTS --security-opt label=disable"
32+
3033
set -x
3134
$DOCKER_BINARY run $DOCKER_OPTS -it \
3235
-v $host_build_dir:$container_build_dir \

llama_stack/distribution/start_container.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ shift
3939

4040
set -x
4141

42+
# Disable SELinux labels
43+
DOCKER_OPTS="$DOCKER_OPTS --security-opt label=disable"
44+
4245
if [ -n "$LLAMA_CHECKPOINT_DIR" ]; then
4346
$DOCKER_BINARY run $DOCKER_OPTS -it \
4447
-p $port:$port \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy