Skip to content

Commit ac89855

Browse files
authored
Fix code scan warning (#473)
Signed-off-by: zepan <ze.pan@intel.com>
1 parent c71bc68 commit ac89855

File tree

17 files changed

+61
-48
lines changed

17 files changed

+61
-48
lines changed

.github/workflows/docker/code-scan.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ARG UBUNTU_VER=22.04
55
FROM ubuntu:${UBUNTU_VER} as devel
66

7-
ENV LANG C.UTF-8
7+
ENV LANG=C.UTF-8
88

99
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
1010
aspell \

.github/workflows/scripts/codeScan/hadolint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
source /GenAIExamples/.github/workflows/scripts/change_color
77
log_dir=/GenAIExamples/.github/workflows/scripts/codeScan
88

9-
find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 {} \; 2>&1 | tee ${log_dir}/hadolint.log
9+
find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 --ignore DL3013 {} \; 2>&1 | tee ${log_dir}/hadolint.log
1010

1111
if [[ $(grep -c "error" ${log_dir}/hadolint.log) != 0 ]]; then
1212
$BOLD_RED && echo "Error!! Please Click on the artifact button to download and check error details." && $RESET
1313
exit 1
1414
fi
1515

16+
if [[ $(grep -c "warning" ${log_dir}/hadolint.log) != 0 ]]; then
17+
$BOLD_RED && echo "Warning!! Please Click on the artifact button to download and check warning details." && $RESET
18+
exit 1
19+
fi
1620
$BOLD_PURPLE && echo "Congratulations, Hadolint check passed!" && $LIGHT_PURPLE && echo " You can click on the artifact button to see the log details." && $RESET
1721
exit 0

AudioQnA/deprecated/docker/Dockerfile_asr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
FROM python:3.11-slim
22

3-
ENV LANG C.UTF-8
3+
ENV LANG=C.UTF-8
44

55
# Install system dependencies
66
RUN apt-get update \
77
&& apt-get install -y ffmpeg
88

99
COPY ./asr /asr
10-
RUN pip install -r /asr/requirements.txt
10+
RUN pip install --no-cache-dir -r /asr/requirements.txt
1111

1212
WORKDIR /asr
1313

AudioQnA/deprecated/docker/Dockerfile_tts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.9-slim
22

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

66
# Install system dependencies
@@ -16,7 +16,7 @@ ENV OMP_NUM_THREADS=56
1616

1717
RUN git clone https://github.com/RVC-Boss/GPT-SoVITS.git /GPT-SoVITS -b main
1818

19-
RUN pip install -r /GPT-SoVITS/requirements.txt
19+
RUN pip install --no-cache-dir -r /GPT-SoVITS/requirements.txt
2020

2121
COPY ./tts/tts_server.py /GPT-SoVITS/
2222
COPY ./tts/config.py /GPT-SoVITS/

AudioQnA/deprecated/langchain/docker/qna-app/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
FROM python:3.11-slim
66

7-
RUN pip install poetry==1.6.1
7+
RUN pip install --no-cache-dir poetry==1.6.1
88

99
RUN poetry config virtualenvs.create false
1010

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

2323
EXPOSE 8080
2424

25-
CMD exec uvicorn app.server:app --host 0.0.0.0 --port 8080
25+
CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "8080"]

AudioQnA/docker/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
1515
mkdir -p /home/user && \
1616
chown -R user /home/user/
1717

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

21-
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
22-
pip install -r /home/user/GenAIComps/requirements.txt
21+
WORKDIR /home/user/GenAIComps
22+
RUN pip install --no-cache-dir --upgrade pip && \
23+
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
2324

2425
COPY ./audioqna.py /home/user/audioqna.py
2526

ChatQnA/deprecated/langchain/docker/qna-app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ RUN poetry install --no-interaction --no-ansi
2222

2323
EXPOSE 8080
2424

25-
CMD exec uvicorn app.server:app --host 0.0.0.0 --port 8080
25+
CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "8080"]

ChatQnA/docker/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
1515
mkdir -p /home/user && \
1616
chown -R user /home/user/
1717

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

21-
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
22-
pip install -r /home/user/GenAIComps/requirements.txt
21+
WORKDIR /home/user/GenAIComps
22+
RUN pip install --no-cache-dir --upgrade pip && \
23+
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
2324

2425
COPY ./chatqna.py /home/user/chatqna.py
2526

ChatQnA/docker/Dockerfile_guardrails

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ RUN useradd -m -s /bin/bash user && \
1515
mkdir -p /home/user && \
1616
chown -R user /home/user/
1717

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

21-
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
22-
pip install -r /home/user/GenAIComps/requirements.txt
21+
WORKDIR /home/user/GenAIComps
22+
RUN pip install --no-cache-dir --upgrade pip && \
23+
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
2324

2425
COPY ./chatqna_guardrails.py /home/user/chatqna_guardrails.py
2526

CodeGen/docker/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
FROM python:3.11-slim
77

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

1010
RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
1111
libgl1-mesa-glx \
@@ -17,11 +17,12 @@ RUN useradd -m -s /bin/bash user && \
1717
mkdir -p /home/user && \
1818
chown -R user /home/user/
1919

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

23-
RUN cd /home/user/GenAIComps && pip install --no-cache-dir --upgrade pip && \
24-
pip install -r /home/user/GenAIComps/requirements.txt
23+
WORKDIR /home/user/GenAIComps
24+
RUN pip install --no-cache-dir --upgrade pip && \
25+
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
2526

2627
COPY ./codegen.py /home/user/codegen.py
2728

0 commit comments

Comments
 (0)