From 683654b9989234907815f35a605eb620896797a9 Mon Sep 17 00:00:00 2001 From: JoshuaL3000 Date: Fri, 8 Nov 2024 10:37:45 +0000 Subject: [PATCH] Update workflow id Signed-off-by: JoshuaL3000 --- .../tests/3_launch_agent_service.sh | 1 - .../tests/3_launch_and_validate_agent.sh | 66 ------------------- ...> test_compose_vllm_example_wf_on_xeon.sh} | 1 + .../tests/test_compose_vllm_on_xeon.sh | 1 + 4 files changed, 2 insertions(+), 67 deletions(-) delete mode 100644 WorkflowExecAgent/tests/3_launch_and_validate_agent.sh rename WorkflowExecAgent/tests/{test_compose_vllm_example_wf_xeon.sh => test_compose_vllm_example_wf_on_xeon.sh} (99%) diff --git a/WorkflowExecAgent/tests/3_launch_agent_service.sh b/WorkflowExecAgent/tests/3_launch_agent_service.sh index 97706a0c8..874f1f5b8 100644 --- a/WorkflowExecAgent/tests/3_launch_agent_service.sh +++ b/WorkflowExecAgent/tests/3_launch_agent_service.sh @@ -20,7 +20,6 @@ export recursion_limit=25 export temperature=0 export max_new_tokens=1000 export TOOLSET_PATH=$WORKDIR/GenAIExamples/WorkflowExecAgent/tools/ -export workflow_id=9838 function start_agent() { echo "Starting Agent services" diff --git a/WorkflowExecAgent/tests/3_launch_and_validate_agent.sh b/WorkflowExecAgent/tests/3_launch_and_validate_agent.sh deleted file mode 100644 index 5c9e6da58..000000000 --- a/WorkflowExecAgent/tests/3_launch_and_validate_agent.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -set -e - -WORKPATH=$(dirname "$PWD") -workflow_id=9809 -vllm_port=${vllm_port} -[[ -z "$vllm_port" ]] && vllm_port=8084 -export WORKDIR=$WORKPATH/../../ -echo "WORKDIR=${WORKDIR}" -export SDK_BASE_URL=${SDK_BASE_URL} -export SERVING_TOKEN=${SERVING_TOKEN} -export HF_TOKEN=${HUGGINGFACEHUB_API_TOKEN} -export llm_engine=vllm -export ip_address=$(hostname -I | awk '{print $1}') -export llm_endpoint_url=http://${ip_address}:${vllm_port} -export model=mistralai/Mistral-7B-Instruct-v0.3 -export recursion_limit=25 -export temperature=0 -export max_new_tokens=1000 -export TOOLSET_PATH=$WORKDIR/GenAIExamples/WorkflowExecAgent/tools/ - -function start_agent_and_api_server() { - echo "Starting Agent services" - cd $WORKDIR/GenAIExamples/WorkflowExecAgent/docker_compose/intel/cpu/xeon - WORKDIR=$WORKPATH/docker_image_build/ docker compose -f compose_vllm.yaml up -d - echo "Waiting agent service ready" - sleep 5s -} - -function validate() { - local CONTENT="$1" - local EXPECTED_RESULT="$2" - local SERVICE_NAME="$3" - - if echo "$CONTENT" | grep -q "$EXPECTED_RESULT"; then - echo "[ $SERVICE_NAME ] Content is as expected: $CONTENT" - echo "[TEST INFO]: Workflow Executor agent service PASSED" - else - echo "[ $SERVICE_NAME ] Content does not match the expected result: $CONTENT" - echo "[TEST INFO]: Workflow Executor agent service FAILED" - fi -} - -function validate_agent_service() { - echo "----------------Test agent ----------------" - local CONTENT=$(curl http://${ip_address}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{ - "query": "I have a data with gender Female, tenure 55, MonthlyAvgCharges 103.7. Predict if this entry will churn. My workflow id is '${workflow_id}'." - }') - validate "$CONTENT" "The entry is not likely to churn" "workflowexec-agent-endpoint" - docker logs workflowexec-agent-endpoint -} - -function main() { - echo "==================== Start agent ====================" - start_agent_and_api_server - echo "==================== Agent started ====================" - - echo "==================== Validate agent service ====================" - validate_agent_service - echo "==================== Agent service validated ====================" -} - -main diff --git a/WorkflowExecAgent/tests/test_compose_vllm_example_wf_xeon.sh b/WorkflowExecAgent/tests/test_compose_vllm_example_wf_on_xeon.sh similarity index 99% rename from WorkflowExecAgent/tests/test_compose_vllm_example_wf_xeon.sh rename to WorkflowExecAgent/tests/test_compose_vllm_example_wf_on_xeon.sh index 82528548c..561b02554 100644 --- a/WorkflowExecAgent/tests/test_compose_vllm_example_wf_xeon.sh +++ b/WorkflowExecAgent/tests/test_compose_vllm_example_wf_on_xeon.sh @@ -5,6 +5,7 @@ wf_api_port=${wf_api_port} [[ -z "$wf_api_port" ]] && wf_api_port=5000 api_server_url=http://$(hostname -I | awk '{print $1}'):${wf_api_port}/ +workflow_id=9838 query="I have a data with gender Female, tenure 55, MonthlyCharges 103.7, TotalCharges 1840.75. Predict if this entry will churn. My workflow id is ${workflow_id}." validate_result="the prediction is No" diff --git a/WorkflowExecAgent/tests/test_compose_vllm_on_xeon.sh b/WorkflowExecAgent/tests/test_compose_vllm_on_xeon.sh index a316fe073..a42d7bd75 100644 --- a/WorkflowExecAgent/tests/test_compose_vllm_on_xeon.sh +++ b/WorkflowExecAgent/tests/test_compose_vllm_on_xeon.sh @@ -2,6 +2,7 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +workflow_id=9838 query="I have a data with gender Female, tenure 55, MonthlyAvgCharges 103.7. Predict if this entry will churn. My workflow id is '${workflow_id}'." validate_result="The entry is not likely to churn"