From eb04731750688de26f0aba7291199f8c9b1521b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 12 Jun 2025 16:14:32 +0200 Subject: [PATCH] ci: fix external provider test (#2438) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What does this PR do? The test wasn't using the correct virtual environment. Also augment the console width for logs. Signed-off-by: Sébastien Han --- .github/workflows/test-external-providers.yml | 10 ++++++---- llama_stack/distribution/distribution.py | 1 + llama_stack/log.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-external-providers.yml b/.github/workflows/test-external-providers.yml index 06ab7cf3c..cdf18fab7 100644 --- a/.github/workflows/test-external-providers.yml +++ b/.github/workflows/test-external-providers.yml @@ -45,20 +45,22 @@ jobs: - name: Build distro from config file run: | - USE_COPY_NOT_MOUNT=true LLAMA_STACK_DIR=. uv run llama stack build --config tests/external-provider/llama-stack-provider-ollama/custom-distro.yaml + USE_COPY_NOT_MOUNT=true LLAMA_STACK_DIR=. llama stack build --config tests/external-provider/llama-stack-provider-ollama/custom-distro.yaml - name: Start Llama Stack server in background if: ${{ matrix.image-type }} == 'venv' env: INFERENCE_MODEL: "meta-llama/Llama-3.2-3B-Instruct" run: | - uv run pip list - nohup uv run --active llama stack run tests/external-provider/llama-stack-provider-ollama/run.yaml --image-type ${{ matrix.image-type }} > server.log 2>&1 & + # Use the virtual environment created by the build step (name comes from build config) + source ci-test/bin/activate + uv pip list + nohup llama stack run tests/external-provider/llama-stack-provider-ollama/run.yaml --image-type ${{ matrix.image-type }} > server.log 2>&1 & - name: Wait for Llama Stack server to be ready run: | for i in {1..30}; do - if ! grep -q "remote::custom_ollama from /home/runner/.llama/providers.d/remote/inference/custom_ollama.yaml" server.log; then + if ! grep -q "Successfully loaded external provider remote::custom_ollama" server.log; then echo "Waiting for Llama Stack server to load the provider..." sleep 1 else diff --git a/llama_stack/distribution/distribution.py b/llama_stack/distribution/distribution.py index b860d15ab..e37b2c443 100644 --- a/llama_stack/distribution/distribution.py +++ b/llama_stack/distribution/distribution.py @@ -180,6 +180,7 @@ def get_provider_registry( if provider_type_key in ret[api]: logger.warning(f"Overriding already registered provider {provider_type_key} for {api.name}") ret[api][provider_type_key] = spec + logger.info(f"Successfully loaded external provider {provider_type_key}") except yaml.YAMLError as yaml_err: logger.error(f"Failed to parse YAML file {spec_path}: {yaml_err}") raise yaml_err diff --git a/llama_stack/log.py b/llama_stack/log.py index f4184710a..c14967f0a 100644 --- a/llama_stack/log.py +++ b/llama_stack/log.py @@ -115,7 +115,7 @@ def parse_environment_config(env_config: str) -> dict[str, int]: class CustomRichHandler(RichHandler): def __init__(self, *args, **kwargs): - kwargs["console"] = Console(width=120) + kwargs["console"] = Console(width=150) super().__init__(*args, **kwargs) def emit(self, record):