update ui dockerfile copy path (#196)

Signed-off-by: chensuyue <suyue.chen@intel.com>
This commit is contained in:
chen, suyue
2024-05-29 00:44:49 +08:00
committed by GitHub
parent 3f26d06d3a
commit 259cd50ef1
10 changed files with 58 additions and 30 deletions

View File

@@ -38,7 +38,8 @@ jobs:
id: get-test-matrix
run: |
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')
examples=$(printf '%s\n' "${changed_files[@]}" | grep '/' | cut -d'/' -f1 | sort -u)
run_matrix="{\"include\":["
@@ -46,7 +47,7 @@ jobs:
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 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
run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"${hw}\"},"
done
@@ -81,7 +82,7 @@ jobs:
run: |
cd ${{ github.workspace }}/$example/tests
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
env:

View File

@@ -5,7 +5,7 @@ FROM node:20.11.1
RUN apt-get update -y && apt-get install -y git
# Copy the front-end code repository
COPY ../svelte /home/user/svelte
COPY svelte /home/user/svelte
# Set the working directory
WORKDIR /home/user/svelte

View File

@@ -57,9 +57,17 @@ function start_services() {
# Start Docker Containers
# 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() {
@@ -75,7 +83,7 @@ function validate_microservices() {
docker logs tei-embedding-gaudi-server >> ${LOG_PATH}/embed.log
exit 1
fi
sleep 5s
sleep 1s
curl http://${ip_address}:6000/v1/embeddings \
-X POST \
@@ -87,7 +95,7 @@ function validate_microservices() {
docker logs embedding-tei-server >> ${LOG_PATH}/embeddings.log
exit 1
fi
sleep 5s
sleep 1s
export PATH="${HOME}/miniforge3/bin:$PATH"
source activate
@@ -102,7 +110,7 @@ function validate_microservices() {
docker logs retriever-redis-server >> ${LOG_PATH}/retrieval.log
exit 1
fi
sleep 5s
sleep 1s
curl http://${ip_address}:8808/rerank \
-X POST \
@@ -114,7 +122,7 @@ function validate_microservices() {
docker logs tei-xeon-server >> ${LOG_PATH}/rerank.log
exit 1
fi
sleep 5s
sleep 1s
curl http://${ip_address}:8000/v1/reranking \
-X POST \
@@ -126,7 +134,7 @@ function validate_microservices() {
docker logs reranking-tei-gaudi-server >> ${LOG_PATH}/reranking.log
exit 1
fi
sleep 1m
sleep 1s
curl http://${ip_address}:8008/generate \
-X POST \
@@ -138,7 +146,7 @@ function validate_microservices() {
docker logs tgi-gaudi-server >> ${LOG_PATH}/generate.log
exit 1
fi
sleep 5s
sleep 1s
curl http://${ip_address}:9000/v1/chat/completions \
-X POST \
@@ -150,7 +158,7 @@ function validate_microservices() {
docker logs llm-tgi-gaudi-server >> ${LOG_PATH}/completions.log
exit 1
fi
sleep 5s
sleep 1s
}
function validate_megaservice() {
@@ -195,9 +203,14 @@ function stop_docker() {
function main() {
stop_docker
begin_time=$(date +%s)
build_docker_images
start_time=$(date +%s)
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_megaservice

View File

@@ -49,9 +49,17 @@ function start_services() {
# Start Docker Containers
# 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() {
@@ -67,7 +75,7 @@ function validate_microservices() {
docker logs tei-embedding-server >> ${LOG_PATH}/embed.log
exit 1
fi
sleep 5s
sleep 1s
curl http://${ip_address}:6000/v1/embeddings \
-X POST \
@@ -78,7 +86,7 @@ function validate_microservices() {
docker logs embedding-tei-server >> ${LOG_PATH}/embeddings.log
exit 1
fi
sleep 5s
sleep 1m # retrieval can't curl as expected, try to wait for more time
export PATH="${HOME}/miniforge3/bin:$PATH"
source activate
@@ -93,7 +101,7 @@ function validate_microservices() {
docker logs retriever-redis-server >> ${LOG_PATH}/retrieval.log
exit 1
fi
sleep 5s
sleep 1s
curl http://${ip_address}:8808/rerank \
-X POST \
@@ -105,7 +113,7 @@ function validate_microservices() {
docker logs tei-xeon-server >> ${LOG_PATH}/rerank.log
exit 1
fi
sleep 5s
sleep 1s
curl http://${ip_address}:8000/v1/reranking\
-X POST \
@@ -116,7 +124,7 @@ function validate_microservices() {
docker logs reranking-tei-xeon-server >> ${LOG_PATH}/reranking.log
exit 1
fi
sleep 30s
sleep 1s
curl http://${ip_address}:9009/generate \
-X POST \
@@ -127,7 +135,7 @@ function validate_microservices() {
docker logs tgi-service >> ${LOG_PATH}/generate.log
exit 1
fi
sleep 5s
sleep 1s
curl http://${ip_address}:9000/v1/chat/completions \
-X POST \
@@ -139,12 +147,12 @@ function validate_microservices() {
docker logs llm-tgi-server >> ${LOG_PATH}/completions.log
exit 1
fi
sleep 5s
sleep 1s
}
function validate_megaservice() {
# 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",
"messages": "What is the revenue of Nike in 2023?"}' > ${LOG_PATH}/curl_megaservice.log
exit_code=$?
@@ -186,8 +194,14 @@ function main() {
stop_docker
begin_time=$(date +%s)
build_docker_images
start_time=$(date +%s)
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_megaservice

View File

@@ -5,7 +5,7 @@ FROM node:20.11.1
RUN apt-get update -y && apt-get install -y git
# Copy the front-end code repository
COPY ../svelte /home/user/svelte
COPY svelte /home/user/svelte
# Set the working directory
WORKDIR /home/user/svelte

View File

@@ -5,7 +5,7 @@ FROM node:20.11.1
RUN apt-get update -y && apt-get install -y git
# Copy the front-end code repository
COPY ../svelte /home/user/svelte
COPY svelte /home/user/svelte
# Set the working directory
WORKDIR /home/user/svelte

View File

@@ -5,7 +5,7 @@ FROM node:20.11.1
RUN apt-get update -y && apt-get install -y git
# Copy the front-end code repository
COPY ../svelte /home/user/svelte
COPY svelte /home/user/svelte
# Set the working directory
WORKDIR /home/user/svelte

View File

@@ -5,7 +5,7 @@ FROM node:20.11.1
RUN apt-get update -y && apt-get install -y git
# Copy the front-end code repository
COPY ../svelte /home/user/svelte
COPY svelte /home/user/svelte
# Set the working directory
WORKDIR /home/user/svelte

View File

@@ -5,7 +5,7 @@ FROM node:20.11.1
RUN apt-get update -y && apt-get install -y git
# Copy the front-end code repository
COPY ../svelte /home/user/svelte
COPY svelte /home/user/svelte
# Set the working directory
WORKDIR /home/user/svelte

View File

@@ -5,7 +5,7 @@ FROM node:20.11.1
RUN apt-get update -y && apt-get install -y git
# Copy the front-end code repository
COPY ../svelte /home/user/svelte
COPY svelte /home/user/svelte
# Set the working directory
WORKDIR /home/user/svelte