update ui dockerfile copy path (#196)
Signed-off-by: chensuyue <suyue.chen@intel.com>
This commit is contained in:
7
.github/workflows/E2E_test_with_compose.yml
vendored
7
.github/workflows/E2E_test_with_compose.yml
vendored
@@ -38,7 +38,8 @@ jobs:
|
|||||||
id: get-test-matrix
|
id: get-test-matrix
|
||||||
run: |
|
run: |
|
||||||
set -xe
|
set -xe
|
||||||
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | \
|
merged_commit=$(git log -1 --format='%H')
|
||||||
|
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${merged_commit} | \
|
||||||
grep -vE '.github|README.md|*.txt|deprecate|kubernetes')
|
grep -vE '.github|README.md|*.txt|deprecate|kubernetes')
|
||||||
examples=$(printf '%s\n' "${changed_files[@]}" | grep '/' | cut -d'/' -f1 | sort -u)
|
examples=$(printf '%s\n' "${changed_files[@]}" | grep '/' | cut -d'/' -f1 | sort -u)
|
||||||
run_matrix="{\"include\":["
|
run_matrix="{\"include\":["
|
||||||
@@ -46,7 +47,7 @@ jobs:
|
|||||||
run_hardware=""
|
run_hardware=""
|
||||||
if [ $(printf '%s\n' "${changed_files[@]}" | grep ${example} | grep -c gaudi) != 0 ]; then run_hardware="gaudi"; fi
|
if [ $(printf '%s\n' "${changed_files[@]}" | grep ${example} | grep -c gaudi) != 0 ]; then run_hardware="gaudi"; fi
|
||||||
if [ $(printf '%s\n' "${changed_files[@]}" | grep ${example} | grep -c xeon) != 0 ]; then run_hardware="xeon ${run_hardware}"; fi
|
if [ $(printf '%s\n' "${changed_files[@]}" | grep ${example} | grep -c xeon) != 0 ]; then run_hardware="xeon ${run_hardware}"; fi
|
||||||
if [ $run_hardware = "" ]; then run_hardware="xeon"; fi
|
if [ "$run_hardware" = "" ]; then run_hardware="xeon"; fi
|
||||||
for hw in ${run_hardware}; do
|
for hw in ${run_hardware}; do
|
||||||
run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"${hw}\"},"
|
run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"${hw}\"},"
|
||||||
done
|
done
|
||||||
@@ -81,7 +82,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd ${{ github.workspace }}/$example/tests
|
cd ${{ github.workspace }}/$example/tests
|
||||||
example_l=$(echo $example | tr '[:upper:]' '[:lower:]')
|
example_l=$(echo $example | tr '[:upper:]' '[:lower:]')
|
||||||
timeout 20m bash test_${example_l}_on_${hardware}.sh
|
if [ -f test_${example_l}_on_${hardware}.sh ]; then timeout 20m bash test_${example_l}_on_${hardware}.sh; else echo "Test script not found, skip test!"; fi
|
||||||
|
|
||||||
- name: Clean up container
|
- name: Clean up container
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ FROM node:20.11.1
|
|||||||
RUN apt-get update -y && apt-get install -y git
|
RUN apt-get update -y && apt-get install -y git
|
||||||
|
|
||||||
# Copy the front-end code repository
|
# Copy the front-end code repository
|
||||||
COPY ../svelte /home/user/svelte
|
COPY svelte /home/user/svelte
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /home/user/svelte
|
WORKDIR /home/user/svelte
|
||||||
|
|||||||
@@ -57,9 +57,17 @@ function start_services() {
|
|||||||
|
|
||||||
# Start Docker Containers
|
# Start Docker Containers
|
||||||
# TODO: Replace the container name with a test-specific name
|
# TODO: Replace the container name with a test-specific name
|
||||||
docker compose -f docker_compose.yaml up -d
|
|
||||||
|
|
||||||
sleep 1m # Waits 1 minutes
|
docker compose -f docker_compose.yaml up -d
|
||||||
|
n=0
|
||||||
|
until [[ "$n" -ge 200 ]]; do
|
||||||
|
docker logs tgi-gaudi-server > tgi_service_start.log
|
||||||
|
if grep -q Connected tgi_service_start.log; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1s
|
||||||
|
n=$((n+1))
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_microservices() {
|
function validate_microservices() {
|
||||||
@@ -75,7 +83,7 @@ function validate_microservices() {
|
|||||||
docker logs tei-embedding-gaudi-server >> ${LOG_PATH}/embed.log
|
docker logs tei-embedding-gaudi-server >> ${LOG_PATH}/embed.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:6000/v1/embeddings \
|
curl http://${ip_address}:6000/v1/embeddings \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -87,7 +95,7 @@ function validate_microservices() {
|
|||||||
docker logs embedding-tei-server >> ${LOG_PATH}/embeddings.log
|
docker logs embedding-tei-server >> ${LOG_PATH}/embeddings.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
export PATH="${HOME}/miniforge3/bin:$PATH"
|
export PATH="${HOME}/miniforge3/bin:$PATH"
|
||||||
source activate
|
source activate
|
||||||
@@ -102,7 +110,7 @@ function validate_microservices() {
|
|||||||
docker logs retriever-redis-server >> ${LOG_PATH}/retrieval.log
|
docker logs retriever-redis-server >> ${LOG_PATH}/retrieval.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:8808/rerank \
|
curl http://${ip_address}:8808/rerank \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -114,7 +122,7 @@ function validate_microservices() {
|
|||||||
docker logs tei-xeon-server >> ${LOG_PATH}/rerank.log
|
docker logs tei-xeon-server >> ${LOG_PATH}/rerank.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:8000/v1/reranking \
|
curl http://${ip_address}:8000/v1/reranking \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -126,7 +134,7 @@ function validate_microservices() {
|
|||||||
docker logs reranking-tei-gaudi-server >> ${LOG_PATH}/reranking.log
|
docker logs reranking-tei-gaudi-server >> ${LOG_PATH}/reranking.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 1m
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:8008/generate \
|
curl http://${ip_address}:8008/generate \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -138,7 +146,7 @@ function validate_microservices() {
|
|||||||
docker logs tgi-gaudi-server >> ${LOG_PATH}/generate.log
|
docker logs tgi-gaudi-server >> ${LOG_PATH}/generate.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:9000/v1/chat/completions \
|
curl http://${ip_address}:9000/v1/chat/completions \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -150,7 +158,7 @@ function validate_microservices() {
|
|||||||
docker logs llm-tgi-gaudi-server >> ${LOG_PATH}/completions.log
|
docker logs llm-tgi-gaudi-server >> ${LOG_PATH}/completions.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_megaservice() {
|
function validate_megaservice() {
|
||||||
@@ -195,9 +203,14 @@ function stop_docker() {
|
|||||||
function main() {
|
function main() {
|
||||||
|
|
||||||
stop_docker
|
stop_docker
|
||||||
|
begin_time=$(date +%s)
|
||||||
build_docker_images
|
build_docker_images
|
||||||
|
start_time=$(date +%s)
|
||||||
start_services
|
start_services
|
||||||
|
end_time=$(date +%s)
|
||||||
|
minimal_duration=$((end_time-start_time))
|
||||||
|
maximal_duration=$((end_time-begin_time))
|
||||||
|
echo "Mega service start minimal duration is "$minimal_duration"s, maximal duration(including docker image build) is "$maximal_duration"s"
|
||||||
|
|
||||||
validate_microservices
|
validate_microservices
|
||||||
validate_megaservice
|
validate_megaservice
|
||||||
|
|||||||
@@ -49,9 +49,17 @@ function start_services() {
|
|||||||
|
|
||||||
# Start Docker Containers
|
# Start Docker Containers
|
||||||
# TODO: Replace the container name with a test-specific name
|
# TODO: Replace the container name with a test-specific name
|
||||||
docker compose -f docker_compose.yaml up -d
|
|
||||||
|
|
||||||
sleep 2m # Waits 1 minutes
|
docker compose -f docker_compose.yaml up -d
|
||||||
|
n=0
|
||||||
|
until [[ "$n" -ge 200 ]]; do
|
||||||
|
docker logs tgi-service > tgi_service_start.log
|
||||||
|
if grep -q Connected tgi_service_start.log; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1s
|
||||||
|
n=$((n+1))
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_microservices() {
|
function validate_microservices() {
|
||||||
@@ -67,7 +75,7 @@ function validate_microservices() {
|
|||||||
docker logs tei-embedding-server >> ${LOG_PATH}/embed.log
|
docker logs tei-embedding-server >> ${LOG_PATH}/embed.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:6000/v1/embeddings \
|
curl http://${ip_address}:6000/v1/embeddings \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -78,7 +86,7 @@ function validate_microservices() {
|
|||||||
docker logs embedding-tei-server >> ${LOG_PATH}/embeddings.log
|
docker logs embedding-tei-server >> ${LOG_PATH}/embeddings.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1m # retrieval can't curl as expected, try to wait for more time
|
||||||
|
|
||||||
export PATH="${HOME}/miniforge3/bin:$PATH"
|
export PATH="${HOME}/miniforge3/bin:$PATH"
|
||||||
source activate
|
source activate
|
||||||
@@ -93,7 +101,7 @@ function validate_microservices() {
|
|||||||
docker logs retriever-redis-server >> ${LOG_PATH}/retrieval.log
|
docker logs retriever-redis-server >> ${LOG_PATH}/retrieval.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:8808/rerank \
|
curl http://${ip_address}:8808/rerank \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -105,7 +113,7 @@ function validate_microservices() {
|
|||||||
docker logs tei-xeon-server >> ${LOG_PATH}/rerank.log
|
docker logs tei-xeon-server >> ${LOG_PATH}/rerank.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:8000/v1/reranking\
|
curl http://${ip_address}:8000/v1/reranking\
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -116,7 +124,7 @@ function validate_microservices() {
|
|||||||
docker logs reranking-tei-xeon-server >> ${LOG_PATH}/reranking.log
|
docker logs reranking-tei-xeon-server >> ${LOG_PATH}/reranking.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 30s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:9009/generate \
|
curl http://${ip_address}:9009/generate \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -127,7 +135,7 @@ function validate_microservices() {
|
|||||||
docker logs tgi-service >> ${LOG_PATH}/generate.log
|
docker logs tgi-service >> ${LOG_PATH}/generate.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
|
|
||||||
curl http://${ip_address}:9000/v1/chat/completions \
|
curl http://${ip_address}:9000/v1/chat/completions \
|
||||||
-X POST \
|
-X POST \
|
||||||
@@ -139,12 +147,12 @@ function validate_microservices() {
|
|||||||
docker logs llm-tgi-server >> ${LOG_PATH}/completions.log
|
docker logs llm-tgi-server >> ${LOG_PATH}/completions.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 5s
|
sleep 1s
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_megaservice() {
|
function validate_megaservice() {
|
||||||
# Curl the Mega Service
|
# Curl the Mega Service
|
||||||
curl http://${ip_address}:8888/v1/chatqna -H "Content-Type: application/json" -d '{
|
http_proxy="" curl http://${ip_address}:8888/v1/chatqna -H "Content-Type: application/json" -d '{
|
||||||
"model": "Intel/neural-chat-7b-v3-3",
|
"model": "Intel/neural-chat-7b-v3-3",
|
||||||
"messages": "What is the revenue of Nike in 2023?"}' > ${LOG_PATH}/curl_megaservice.log
|
"messages": "What is the revenue of Nike in 2023?"}' > ${LOG_PATH}/curl_megaservice.log
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
@@ -186,8 +194,14 @@ function main() {
|
|||||||
|
|
||||||
stop_docker
|
stop_docker
|
||||||
|
|
||||||
|
begin_time=$(date +%s)
|
||||||
build_docker_images
|
build_docker_images
|
||||||
|
start_time=$(date +%s)
|
||||||
start_services
|
start_services
|
||||||
|
end_time=$(date +%s)
|
||||||
|
minimal_duration=$((end_time-start_time))
|
||||||
|
maximal_duration=$((end_time-begin_time))
|
||||||
|
echo "Mega service start minimal duration is "$minimal_duration"s, maximal duration(including docker image build) is "$maximal_duration"s"
|
||||||
|
|
||||||
validate_microservices
|
validate_microservices
|
||||||
validate_megaservice
|
validate_megaservice
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ FROM node:20.11.1
|
|||||||
RUN apt-get update -y && apt-get install -y git
|
RUN apt-get update -y && apt-get install -y git
|
||||||
|
|
||||||
# Copy the front-end code repository
|
# Copy the front-end code repository
|
||||||
COPY ../svelte /home/user/svelte
|
COPY svelte /home/user/svelte
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /home/user/svelte
|
WORKDIR /home/user/svelte
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ FROM node:20.11.1
|
|||||||
RUN apt-get update -y && apt-get install -y git
|
RUN apt-get update -y && apt-get install -y git
|
||||||
|
|
||||||
# Copy the front-end code repository
|
# Copy the front-end code repository
|
||||||
COPY ../svelte /home/user/svelte
|
COPY svelte /home/user/svelte
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /home/user/svelte
|
WORKDIR /home/user/svelte
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ FROM node:20.11.1
|
|||||||
RUN apt-get update -y && apt-get install -y git
|
RUN apt-get update -y && apt-get install -y git
|
||||||
|
|
||||||
# Copy the front-end code repository
|
# Copy the front-end code repository
|
||||||
COPY ../svelte /home/user/svelte
|
COPY svelte /home/user/svelte
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /home/user/svelte
|
WORKDIR /home/user/svelte
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ FROM node:20.11.1
|
|||||||
RUN apt-get update -y && apt-get install -y git
|
RUN apt-get update -y && apt-get install -y git
|
||||||
|
|
||||||
# Copy the front-end code repository
|
# Copy the front-end code repository
|
||||||
COPY ../svelte /home/user/svelte
|
COPY svelte /home/user/svelte
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /home/user/svelte
|
WORKDIR /home/user/svelte
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ FROM node:20.11.1
|
|||||||
RUN apt-get update -y && apt-get install -y git
|
RUN apt-get update -y && apt-get install -y git
|
||||||
|
|
||||||
# Copy the front-end code repository
|
# Copy the front-end code repository
|
||||||
COPY ../svelte /home/user/svelte
|
COPY svelte /home/user/svelte
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /home/user/svelte
|
WORKDIR /home/user/svelte
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ FROM node:20.11.1
|
|||||||
RUN apt-get update -y && apt-get install -y git
|
RUN apt-get update -y && apt-get install -y git
|
||||||
|
|
||||||
# Copy the front-end code repository
|
# Copy the front-end code repository
|
||||||
COPY ../svelte /home/user/svelte
|
COPY svelte /home/user/svelte
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /home/user/svelte
|
WORKDIR /home/user/svelte
|
||||||
|
|||||||
Reference in New Issue
Block a user