Skip to content

Commit

Permalink
update image build for gaudi (#316)
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <[email protected]>
  • Loading branch information
chensuyue authored Jul 17, 2024
1 parent f2995ab commit fe3d22a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/reuse-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ jobs:
id: build-microservice-image
env:
micro_service: ${{ inputs.micro_service }}
hardware: ${{ matrix.node }}
run: |
bash .github/workflows/scripts/docker_images_build_push.sh ${micro_service}
bash .github/workflows/scripts/docker_images_build_push.sh ${micro_service} ${hardware}
18 changes: 12 additions & 6 deletions .github/workflows/scripts/docker_images_build_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ function docker_build() {
IMAGE_NAME=$1
micro_service=$2
dockerfile_path=${WORKSPACE}/comps/${micro_service}
if [ -f "$dockerfile_path/Dockerfile" ]; then
DOCKERFILE_PATH="$dockerfile_path/Dockerfile"
elif [ -f "$dockerfile_path/docker/Dockerfile" ]; then
DOCKERFILE_PATH="$dockerfile_path/docker/Dockerfile"
if [[ "$IMAGE_NAME" == *"gaudi" ]]; then
dockerfile_name="Dockerfile_hpu"
else
dockerfile_name="Dockerfile"
fi
if [ -f "$dockerfile_path/$dockerfile_name" ]; then
DOCKERFILE_PATH="$dockerfile_path/$dockerfile_name"
elif [ -f "$dockerfile_path/docker/$dockerfile_name" ]; then
DOCKERFILE_PATH="$dockerfile_path/docker/$dockerfile_name"
else
echo "Dockerfile not found"
exit 1
Expand All @@ -29,6 +34,7 @@ function docker_build() {
}

micro_service=$1
hardware=$(echo $2 | cut -d- -f3)
case ${micro_service} in
"asr"|"tts")
IMAGE_NAME="opea/${micro_service}"
Expand All @@ -55,10 +61,10 @@ case ${micro_service} in
IMAGE_NAME="opea/web-retriever-chroma"
;;
"tts/speecht5")
IMAGE_NAME="opea/speecht5"
if [ "${hardware}" == "gaudi" ]; then IMAGE_NAME="opea/speecht5-gaudi"; else IMAGE_NAME="opea/speecht5"; fi
;;
"asr/whisper")
IMAGE_NAME="opea/whisper"
if [ "${hardware}" == "gaudi" ]; then IMAGE_NAME="opea/whisper-gaudi"; else IMAGE_NAME="opea/whisper"; fi
;;
*)
echo "Not supported yet"
Expand Down
4 changes: 2 additions & 2 deletions comps/asr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ docker build -t opea/whisper:latest --build-arg https_proxy=$https_proxy --build

```bash
cd ../..
docker build -t opea/whisper:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/asr/whisper/Dockerfile_hpu .
docker build -t opea/whisper-gaudi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/asr/whisper/Dockerfile_hpu .
```

### 2.1.2 ASR Service Image
Expand All @@ -95,7 +95,7 @@ docker run -p 7066:7066 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$htt
- Gaudi2 HPU

```bash
docker run -p 7066:7066 --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy opea/whisper:latest
docker run -p 7066:7066 --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy opea/whisper-gaudi:latest
```

### 2.2.2 Start ASR service
Expand Down
4 changes: 2 additions & 2 deletions comps/tts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ docker build -t opea/speecht5:latest --build-arg https_proxy=$https_proxy --buil

```bash
cd ../..
docker build -t opea/speecht5:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/tts/speecht5/Dockerfile_hpu .
docker build -t opea/speecht5-gaudi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/tts/speecht5/Dockerfile_hpu .
```

### 2.1.2 TTS Service Image
Expand All @@ -71,7 +71,7 @@ docker run -p 7055:7055 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$htt
- Gaudi2 HPU

```bash
docker run -p 7055:7055 --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy opea/speecht5:latest
docker run -p 7055:7055 --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy opea/speecht5-gaudi:latest
```

### 2.2.2 Start TTS service
Expand Down

0 comments on commit fe3d22a

Please sign in to comment.