Fix code scan warning (#473)

Signed-off-by: zepan <ze.pan@intel.com>
This commit is contained in:
ZePan110
2024-08-02 09:31:30 +08:00
committed by GitHub
parent c71bc68c9c
commit ac89855ff8
17 changed files with 61 additions and 48 deletions

View File

@@ -4,7 +4,7 @@
ARG UBUNTU_VER=22.04 ARG UBUNTU_VER=22.04
FROM ubuntu:${UBUNTU_VER} as devel FROM ubuntu:${UBUNTU_VER} as devel
ENV LANG C.UTF-8 ENV LANG=C.UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
aspell \ aspell \

View File

@@ -6,12 +6,16 @@
source /GenAIExamples/.github/workflows/scripts/change_color source /GenAIExamples/.github/workflows/scripts/change_color
log_dir=/GenAIExamples/.github/workflows/scripts/codeScan log_dir=/GenAIExamples/.github/workflows/scripts/codeScan
find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 {} \; 2>&1 | tee ${log_dir}/hadolint.log find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 --ignore DL3013 {} \; 2>&1 | tee ${log_dir}/hadolint.log
if [[ $(grep -c "error" ${log_dir}/hadolint.log) != 0 ]]; then if [[ $(grep -c "error" ${log_dir}/hadolint.log) != 0 ]]; then
$BOLD_RED && echo "Error!! Please Click on the artifact button to download and check error details." && $RESET $BOLD_RED && echo "Error!! Please Click on the artifact button to download and check error details." && $RESET
exit 1 exit 1
fi fi
if [[ $(grep -c "warning" ${log_dir}/hadolint.log) != 0 ]]; then
$BOLD_RED && echo "Warning!! Please Click on the artifact button to download and check warning details." && $RESET
exit 1
fi
$BOLD_PURPLE && echo "Congratulations, Hadolint check passed!" && $LIGHT_PURPLE && echo " You can click on the artifact button to see the log details." && $RESET $BOLD_PURPLE && echo "Congratulations, Hadolint check passed!" && $LIGHT_PURPLE && echo " You can click on the artifact button to see the log details." && $RESET
exit 0 exit 0

View File

@@ -1,13 +1,13 @@
FROM python:3.11-slim FROM python:3.11-slim
ENV LANG C.UTF-8 ENV LANG=C.UTF-8
# Install system dependencies # Install system dependencies
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y ffmpeg && apt-get install -y ffmpeg
COPY ./asr /asr COPY ./asr /asr
RUN pip install -r /asr/requirements.txt RUN pip install --no-cache-dir -r /asr/requirements.txt
WORKDIR /asr WORKDIR /asr

View File

@@ -1,6 +1,6 @@
FROM python:3.9-slim FROM python:3.9-slim
ENV LANG C.UTF-8 ENV LANG=C.UTF-8
ENV PYTHONPATH=/home/user:/GPT-SoVITS/GPT_SoVITS ENV PYTHONPATH=/home/user:/GPT-SoVITS/GPT_SoVITS
# Install system dependencies # Install system dependencies
@@ -16,7 +16,7 @@ ENV OMP_NUM_THREADS=56
RUN git clone https://github.com/RVC-Boss/GPT-SoVITS.git /GPT-SoVITS -b main RUN git clone https://github.com/RVC-Boss/GPT-SoVITS.git /GPT-SoVITS -b main
RUN pip install -r /GPT-SoVITS/requirements.txt RUN pip install --no-cache-dir -r /GPT-SoVITS/requirements.txt
COPY ./tts/tts_server.py /GPT-SoVITS/ COPY ./tts/tts_server.py /GPT-SoVITS/
COPY ./tts/config.py /GPT-SoVITS/ COPY ./tts/config.py /GPT-SoVITS/

View File

@@ -4,7 +4,7 @@
FROM python:3.11-slim FROM python:3.11-slim
RUN pip install poetry==1.6.1 RUN pip install --no-cache-dir poetry==1.6.1
RUN poetry config virtualenvs.create false RUN poetry config virtualenvs.create false
@@ -22,4 +22,4 @@ RUN poetry install --no-interaction --no-ansi
EXPOSE 8080 EXPOSE 8080
CMD exec uvicorn app.server:app --host 0.0.0.0 --port 8080 CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "8080"]

View File

@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user/
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./audioqna.py /home/user/audioqna.py COPY ./audioqna.py /home/user/audioqna.py

View File

@@ -22,4 +22,4 @@ RUN poetry install --no-interaction --no-ansi
EXPOSE 8080 EXPOSE 8080
CMD exec uvicorn app.server:app --host 0.0.0.0 --port 8080 CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "8080"]

View File

@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user/
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./chatqna.py /home/user/chatqna.py COPY ./chatqna.py /home/user/chatqna.py

View File

@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user/
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./chatqna_guardrails.py /home/user/chatqna_guardrails.py COPY ./chatqna_guardrails.py /home/user/chatqna_guardrails.py

View File

@@ -5,7 +5,7 @@
FROM python:3.11-slim FROM python:3.11-slim
ENV LANG C.UTF-8 ENV LANG=C.UTF-8
RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \ libgl1-mesa-glx \
@@ -17,11 +17,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user/
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./codegen.py /home/user/codegen.py COPY ./codegen.py /home/user/codegen.py

View File

@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user/
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./code_translation.py /home/user/code_translation.py COPY ./code_translation.py /home/user/code_translation.py

View File

@@ -23,4 +23,4 @@ RUN poetry install --no-interaction --no-ansi
EXPOSE 8080 EXPOSE 8080
CMD exec uvicorn app.server:app --host 0.0.0.0 --port 8080 CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "8080"]

View File

@@ -14,11 +14,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./docsum.py /home/user/docsum.py COPY ./docsum.py /home/user/docsum.py

View File

@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user/
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./faqgen.py /home/user/faqgen.py COPY ./faqgen.py /home/user/faqgen.py

View File

@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user/
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./searchqna.py /home/user/searchqna.py COPY ./searchqna.py /home/user/searchqna.py

View File

@@ -3,4 +3,4 @@
FROM ghcr.io/huggingface/tgi-gaudi:1.2.1 FROM ghcr.io/huggingface/tgi-gaudi:1.2.1
RUN pip install peft==0.6.2 RUN pip install --no-cache-dir peft==0.6.2

View File

@@ -25,11 +25,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \ mkdir -p /home/user && \
chown -R user /home/user/ chown -R user /home/user/
RUN cd /home/user/ && \ WORKDIR /home/user/
git clone https://github.com/opea-project/GenAIComps.git RUN git clone https://github.com/opea-project/GenAIComps.git
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \ WORKDIR /home/user/GenAIComps
pip install -r /home/user/GenAIComps/requirements.txt RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
COPY ./translation.py /home/user/translation.py COPY ./translation.py /home/user/translation.py