Skip to content

Commit

Permalink
Merge branch 'main' into neo4j_k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
lvliang-intel authored Jan 28, 2025
2 parents 1a57dc1 + 63c66a0 commit 8049e5e
Show file tree
Hide file tree
Showing 84 changed files with 964 additions and 1,033 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/docker/compose/animation-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,3 @@ services:
build:
dockerfile: comps/animation/src/Dockerfile
image: ${REGISTRY:-opea}/animation:${TAG:-latest}
wav2lip:
build:
dockerfile: comps/third_parties/wav2lip/src/Dockerfile
image: ${REGISTRY:-opea}/wav2lip:${TAG:-latest}
wav2lip-gaudi:
build:
dockerfile: comps/third_parties/wav2lip/src/Dockerfile.intel_hpu
image: ${REGISTRY:-opea}/wav2lip-gaudi:${TAG:-latest}
2 changes: 1 addition & 1 deletion .github/workflows/pr-helm-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
Chart-test:
needs: [job1]
if: always() && ${{ needs.job1.outputs.run_matrix.service.length }} > 0
if: always() && ${{ fromJSON(needs.job1.outputs.run_matrix).length != 0 }}
uses: ./.github/workflows/_run-helm-chart.yml
strategy:
matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/push-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,28 @@ jobs:
- name: Get Test Services
id: get-services
run: |
set -x
base_commit=$(git rev-parse HEAD~1)
merged_commit=$(git log -1 --format='%H')
# git diff --name-only ${base_commit} ${merged_commit} | grep -E "cores|comps/__init__.py" | grep -Ev ".md"
# if [ $? -eq 0 ]; then
if git diff --name-only ${base_commit} ${merged_commit} | grep -E "cores|comps/__init__.py" | grep -Ev ".md"; then
echo "ALL image build!!!"
services=$(basename -a .github/workflows/docker/compose/*-compose.yaml | sed 's/-compose.yaml//' | jq -R '.' )
else
changed_src="$(git diff --name-only ${base_commit} ${merged_commit} | grep 'src/' | grep -vE '\.md')" || true
changed_yamls="$(git diff --name-only ${base_commit} ${merged_commit} | grep '.github/workflows/docker/compose/')" || true
services=$(printf '%s\n' "${changed_src[@]}" | cut -d'/' -f2 | grep -vE '\.py' | sort -u | jq -R '.' ) || true
while IFS= read -r line; do
filename=$(basename "$line" -compose.yaml)
echo "$line $(printf '%s\n' "$filename" | jq -R '.' )"
services+=" $(printf '%s\n' "$filename" | jq -R '.' )" || true
done <<< "$changed_yamls"
[[ -n "$changed_src" ]] && services=$(printf '%s\n' "${changed_src[@]}" | cut -d'/' -f2 | grep -vE '\.py' | sort -u | jq -R '.' ) || true
if [[ -n "$changed_yamls" ]]; then
while IFS= read -r line; do
filename=$(basename "$line" -compose.yaml)
echo "$line $(printf '%s\n' "$filename" | jq -R '.' )"
services+=" $(printf '%s\n' "$filename" | jq -R '.' )" || true
done <<< "$changed_yamls"
else
echo "No changes in YAML files."
fi
fi
echo "services=$(echo "$services" | jq -sc 'unique | sort')"
Expand All @@ -56,6 +62,7 @@ jobs:

image-build:
needs: get-build-matrix
if: ${{ fromJSON(needs.get-build-matrix.outputs.services).length != 0 }}
strategy:
matrix:
service: ${{ fromJSON(needs.get-build-matrix.outputs.services) }}
Expand All @@ -65,6 +72,7 @@ jobs:
steps:
- name: Clean up Working Directory
run: |
echo "matrix.service=${{ matrix.service }}"
sudo rm -rf ${{github.workspace}}/*
- name: Checkout out Repo
Expand Down
4 changes: 0 additions & 4 deletions comps/agent/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

USER user

COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip setuptools && \
Expand All @@ -28,8 +26,6 @@ RUN pip install --no-cache-dir --upgrade pip setuptools && \

ENV PYTHONPATH=/home/user

USER root

RUN mkdir -p /home/user/comps/agent/src/status && chown -R user /home/user/comps/agent/src/status

USER user
Expand Down
3 changes: 1 addition & 2 deletions comps/animation/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ FROM python:3.11-slim
RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/
USER user

ENV LANG=C.UTF-8
ARG ARCH=cpu
Expand All @@ -18,7 +17,7 @@ RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/comps/animation/src/requirements.txt ;

ENV PYTHONPATH=$PYTHONPATH:/home/user

USER user
WORKDIR /home/user/comps/animation/src

ENTRYPOINT ["python3", "opea_animation_microservice.py"]
3 changes: 1 addition & 2 deletions comps/asr/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ FROM python:3.11-slim
RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/
USER user

ENV LANG=C.UTF-8
ARG ARCH=cpu
Expand All @@ -22,7 +21,7 @@ RUN pip install --no-cache-dir --upgrade pip setuptools && \
fi

ENV PYTHONPATH=$PYTHONPATH:/home/user

USER user
WORKDIR /home/user/comps/asr/src

ENTRYPOINT ["python", "opea_asr_microservice.py"]
4 changes: 1 addition & 3 deletions comps/asr/src/integrations/dependency/whisper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ RUN apt-get update \

COPY --chown=user:user comps /home/user/comps

USER user

RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/comps/asr/src/requirements.txt && \
if [ "${ARCH}" = "cpu" ]; then \
Expand All @@ -29,7 +27,7 @@ RUN pip install --no-cache-dir --upgrade pip setuptools && \
fi

ENV PYTHONPATH=$PYTHONPATH:/home/user

USER user
WORKDIR /home/user/comps/asr/src/integrations/dependency/whisper

ENTRYPOINT ["python", "whisper_server.py", "--device", "cpu"]
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ RUN apt-get update \

COPY --chown=user:user comps /home/user/comps

USER user

# Install requirements and optimum habana
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/comps/asr/src/requirements.txt && \
pip install --no-cache-dir optimum[habana]

ENV PYTHONPATH=$PYTHONPATH:/home/users

USER user
WORKDIR /home/user/comps/asr/src/integrations/dependency/whisper

ENTRYPOINT ["python", "whisper_server.py", "--device", "hpu"]
4 changes: 2 additions & 2 deletions comps/chathistory/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

USER user

COPY comps /home/user/comps
COPY requirements.txt /home/user/

Expand All @@ -25,6 +23,8 @@ RUN pip install --no-cache-dir --upgrade pip setuptools && \

ENV PYTHONPATH=$PYTHONPATH:/home/user

USER user

WORKDIR /home/user/comps/chathistory/src

ENTRYPOINT ["python", "opea_chathistory_microservice.py"]
Loading

0 comments on commit 8049e5e

Please sign in to comment.