mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
fix: make integration-tests.sh Mac friendly (#3971)
# What does this PR do? When running ./scripts/integration-tests.sh --network host on mac fails regularly due to how Docker runs on MacOS. if on mac, keep network bridge mode. before: === Starting Docker Container === Using image: localhost/distribution-ci-tests:dev WARNING: Published ports are discarded when using host network mode Waiting for Docker container to start... ❌ Docker container failed to start Container logs: INFO 2025-10-29 18:38:32,180 llama_stack.cli.stack.run:100 cli: Using run configuration: /workspace/src/llama_stack/distributions/ci-tests/run.yaml ... (stack starts but is not reachable on network) after: === Starting Docker Container === Using image: localhost/distribution-ci-tests:dev Using bridge networking with port mapping (non-Linux) Waiting for Docker container to start... ✅ Docker container started successfully === Running Integration Tests === ## Test Plan integration tests pass! Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
parent
da8f014b96
commit
0ef9166c7e
1 changed files with 14 additions and 2 deletions
|
|
@ -313,8 +313,20 @@ if [[ "$STACK_CONFIG" == *"docker:"* && "$COLLECT_ONLY" == false ]]; then
|
||||||
fi
|
fi
|
||||||
echo "Using image: $IMAGE_NAME"
|
echo "Using image: $IMAGE_NAME"
|
||||||
|
|
||||||
docker run -d --network host --name "$container_name" \
|
# On macOS/Darwin, --network host doesn't work as expected due to Docker running in a VM
|
||||||
-p $LLAMA_STACK_PORT:$LLAMA_STACK_PORT \
|
# Use regular port mapping instead
|
||||||
|
NETWORK_MODE=""
|
||||||
|
PORT_MAPPINGS=""
|
||||||
|
if [[ "$(uname)" != "Darwin" ]] && [[ "$(uname)" != *"MINGW"* ]]; then
|
||||||
|
NETWORK_MODE="--network host"
|
||||||
|
else
|
||||||
|
# On non-Linux (macOS, Windows), need explicit port mappings for both app and telemetry
|
||||||
|
PORT_MAPPINGS="-p $LLAMA_STACK_PORT:$LLAMA_STACK_PORT -p $COLLECTOR_PORT:$COLLECTOR_PORT"
|
||||||
|
echo "Using bridge networking with port mapping (non-Linux)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker run -d $NETWORK_MODE --name "$container_name" \
|
||||||
|
$PORT_MAPPINGS \
|
||||||
$DOCKER_ENV_VARS \
|
$DOCKER_ENV_VARS \
|
||||||
"$IMAGE_NAME" \
|
"$IMAGE_NAME" \
|
||||||
--port $LLAMA_STACK_PORT
|
--port $LLAMA_STACK_PORT
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue