Skip to content

Commit

Permalink
Fix code scan warning (#473)
Browse files Browse the repository at this point in the history
Signed-off-by: zepan <ze.pan@intel.com>
  • Loading branch information
ZePan110 authored Aug 2, 2024
1 parent c71bc68 commit ac89855
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker/code-scan.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ARG UBUNTU_VER=22.04
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 \
aspell \
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/scripts/codeScan/hadolint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
source /GenAIExamples/.github/workflows/scripts/change_color
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
$BOLD_RED && echo "Error!! Please Click on the artifact button to download and check error details." && $RESET
exit 1
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
exit 0
4 changes: 2 additions & 2 deletions AudioQnA/deprecated/docker/Dockerfile_asr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM python:3.11-slim

ENV LANG C.UTF-8
ENV LANG=C.UTF-8

# Install system dependencies
RUN apt-get update \
&& apt-get install -y ffmpeg

COPY ./asr /asr
RUN pip install -r /asr/requirements.txt
RUN pip install --no-cache-dir -r /asr/requirements.txt

WORKDIR /asr

Expand Down
4 changes: 2 additions & 2 deletions AudioQnA/deprecated/docker/Dockerfile_tts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.9-slim

ENV LANG C.UTF-8
ENV LANG=C.UTF-8
ENV PYTHONPATH=/home/user:/GPT-SoVITS/GPT_SoVITS

# Install system dependencies
Expand All @@ -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 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/config.py /GPT-SoVITS/
Expand Down
4 changes: 2 additions & 2 deletions AudioQnA/deprecated/langchain/docker/qna-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

Expand All @@ -22,4 +22,4 @@ RUN poetry install --no-interaction --no-ansi

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"]
9 changes: 5 additions & 4 deletions AudioQnA/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down
2 changes: 1 addition & 1 deletion ChatQnA/deprecated/langchain/docker/qna-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ RUN poetry install --no-interaction --no-ansi

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"]
9 changes: 5 additions & 4 deletions ChatQnA/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down
9 changes: 5 additions & 4 deletions ChatQnA/docker/Dockerfile_guardrails
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down
11 changes: 6 additions & 5 deletions CodeGen/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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 \
libgl1-mesa-glx \
Expand All @@ -17,11 +17,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down
9 changes: 5 additions & 4 deletions CodeTrans/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ RUN poetry install --no-interaction --no-ansi

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"]
9 changes: 5 additions & 4 deletions DocSum/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down
9 changes: 5 additions & 4 deletions FaqGen/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down
9 changes: 5 additions & 4 deletions SearchQnA/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down
2 changes: 1 addition & 1 deletion Translation/deprecated/serving/tgi_gaudi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

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
9 changes: 5 additions & 4 deletions Translation/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

RUN cd /home/user/ && \
git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
pip install -r /home/user/GenAIComps/requirements.txt
WORKDIR /home/user/GenAIComps
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

Expand Down

0 comments on commit ac89855

Please sign in to comment.