diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 1f465bbef9..e6854dbce2 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -5,10 +5,12 @@ on: paths: - 'ci/**' - 'core/**' + - 'docker/**' pull_request: paths: - 'ci/**' - 'core/**' + - 'docker/**' jobs: ubuntu: @@ -23,6 +25,11 @@ jobs: steps: - name: Checkout Milvus uses: actions/checkout@v1 + - name: Check Dockerfile + uses: mgrachev/action-hadolint@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-check # Default is github-pr-check - name: Docker Pull shell: bash run: | @@ -65,6 +72,11 @@ jobs: steps: - name: Checkout Milvus uses: actions/checkout@v1 + - name: Check Dockerfile + uses: mgrachev/action-hadolint@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-check # Default is github-pr-check - name: Docker Pull shell: bash run: | diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000000..44fab0b27a --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,4 @@ +ignored: + - DL3003 + - DL3007 + - DL3008 diff --git a/core/src/index/thirdparty/SPTAG/Dockerfile b/core/src/index/thirdparty/SPTAG/Dockerfile index 7c1acd25e4..59c8c70166 100644 --- a/core/src/index/thirdparty/SPTAG/Dockerfile +++ b/core/src/index/thirdparty/SPTAG/Dockerfile @@ -6,9 +6,13 @@ COPY AnnService ./AnnService/ COPY Test ./Test/ COPY Wrappers ./Wrappers/ -RUN apt-get update && apt-get -y install wget build-essential \ +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update && apt-get install -y --no-install-recommends wget build-essential \ # remove the following if you don't want to build the wrappers - openjdk-8-jdk python3-pip swig + openjdk-8-jdk python3-pip swig && \ + apt-get remove --purge -y && \ + rm -rf /var/lib/apt/lists/* # cmake >= 3.12 is required RUN wget "https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4-Linux-x86_64.tar.gz" -q -O - \ diff --git a/core/src/index/thirdparty/faiss/Dockerfile b/core/src/index/thirdparty/faiss/Dockerfile index 418fb2929e..9da42ef70f 100644 --- a/core/src/index/thirdparty/faiss/Dockerfile +++ b/core/src/index/thirdparty/faiss/Dockerfile @@ -22,7 +22,7 @@ WORKDIR /opt/faiss # --with-cuda=/usr/local/cuda-8.0 RUN ./configure --prefix=/usr --libdir=/usr/lib64 --without-cuda -RUN make -j $(nproc) +RUN make -j "$(nproc)" RUN make -C python RUN make test RUN make install diff --git a/docker/build_env/cpu/centos7/Dockerfile b/docker/build_env/cpu/centos7/Dockerfile index 80db8d2a80..39068cc0a4 100644 --- a/docker/build_env/cpu/centos7/Dockerfile +++ b/docker/build_env/cpu/centos7/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM centos:centos7 SHELL ["/bin/bash", "-o", "pipefail", "-c"] diff --git a/docker/build_env/cpu/ubuntu16.04/Dockerfile b/docker/build_env/cpu/ubuntu16.04/Dockerfile index add4ce5f9b..425ea7c8aa 100644 --- a/docker/build_env/cpu/ubuntu16.04/Dockerfile +++ b/docker/build_env/cpu/ubuntu16.04/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM ubuntu:16.04 ENV DEBIAN_FRONTEND noninteractive diff --git a/docker/build_env/cpu/ubuntu18.04/Dockerfile b/docker/build_env/cpu/ubuntu18.04/Dockerfile index 0f8b696db4..b9ea30e56f 100644 --- a/docker/build_env/cpu/ubuntu18.04/Dockerfile +++ b/docker/build_env/cpu/ubuntu18.04/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM ubuntu:18.04 ENV DEBIAN_FRONTEND noninteractive diff --git a/docker/build_env/gpu/centos7/Dockerfile b/docker/build_env/gpu/centos7/Dockerfile index 185aad6555..25015c8c4f 100644 --- a/docker/build_env/gpu/centos7/Dockerfile +++ b/docker/build_env/gpu/centos7/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM nvidia/cuda:10.1-devel-centos7 ENV NVIDIA_DRIVER_CAPABILITIES compute,utility diff --git a/docker/build_env/gpu/ubuntu16.04/Dockerfile b/docker/build_env/gpu/ubuntu16.04/Dockerfile index c443b9b109..a2e19816e1 100644 --- a/docker/build_env/gpu/ubuntu16.04/Dockerfile +++ b/docker/build_env/gpu/ubuntu16.04/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM nvidia/cuda:10.1-devel-ubuntu16.04 ENV NVIDIA_DRIVER_CAPABILITIES compute,utility diff --git a/docker/build_env/gpu/ubuntu18.04/Dockerfile b/docker/build_env/gpu/ubuntu18.04/Dockerfile index ab636ac778..c010b64736 100644 --- a/docker/build_env/gpu/ubuntu18.04/Dockerfile +++ b/docker/build_env/gpu/ubuntu18.04/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM nvidia/cuda:10.1-devel-ubuntu18.04 ENV NVIDIA_DRIVER_CAPABILITIES compute,utility diff --git a/docker/deploy/cpu/centos7/Dockerfile b/docker/deploy/cpu/centos7/Dockerfile index c6c731a26c..04bf8a015b 100644 --- a/docker/deploy/cpu/centos7/Dockerfile +++ b/docker/deploy/cpu/centos7/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM centos:centos7 RUN yum install -y epel-release && \ diff --git a/docker/deploy/cpu/ubuntu16.04/Dockerfile b/docker/deploy/cpu/ubuntu16.04/Dockerfile index 43f3a81cdb..31bebff208 100644 --- a/docker/deploy/cpu/ubuntu16.04/Dockerfile +++ b/docker/deploy/cpu/ubuntu16.04/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM ubuntu:16.04 RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/docker/deploy/cpu/ubuntu18.04/Dockerfile b/docker/deploy/cpu/ubuntu18.04/Dockerfile index d3655417d3..d7913a640d 100644 --- a/docker/deploy/cpu/ubuntu18.04/Dockerfile +++ b/docker/deploy/cpu/ubuntu18.04/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM ubuntu:18.04 RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/docker/deploy/gpu/centos7/Dockerfile b/docker/deploy/gpu/centos7/Dockerfile index 36bf88fcf1..3b7fac4403 100644 --- a/docker/deploy/gpu/centos7/Dockerfile +++ b/docker/deploy/gpu/centos7/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM nvidia/cuda:10.1-devel-centos7 ENV NVIDIA_DRIVER_CAPABILITIES compute,utility diff --git a/docker/deploy/gpu/ubuntu16.04/Dockerfile b/docker/deploy/gpu/ubuntu16.04/Dockerfile index fd7f09ee65..5ada80cd18 100644 --- a/docker/deploy/gpu/ubuntu16.04/Dockerfile +++ b/docker/deploy/gpu/ubuntu16.04/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM nvidia/cuda:10.1-devel-ubuntu16.04 ENV NVIDIA_DRIVER_CAPABILITIES compute,utility diff --git a/docker/deploy/gpu/ubuntu18.04/Dockerfile b/docker/deploy/gpu/ubuntu18.04/Dockerfile index a3940223d5..9640b6e976 100644 --- a/docker/deploy/gpu/ubuntu18.04/Dockerfile +++ b/docker/deploy/gpu/ubuntu18.04/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM nvidia/cuda:10.1-devel-ubuntu18.04 ENV NVIDIA_DRIVER_CAPABILITIES compute,utility diff --git a/docker/test_env/Dockerfile b/docker/test_env/Dockerfile index f913e7b2d2..363f3493e2 100644 --- a/docker/test_env/Dockerfile +++ b/docker/test_env/Dockerfile @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + FROM python:3.6.8-jessie SHELL ["/bin/bash", "-o", "pipefail", "-c"] diff --git a/shards/Dockerfile b/shards/Dockerfile index 594640619e..92509dd0a4 100644 --- a/shards/Dockerfile +++ b/shards/Dockerfile @@ -1,10 +1,12 @@ FROM python:3.6 -RUN apt update && apt install -y \ +RUN apt-get update && apt-get install -y --no-install-recommends \ less \ - telnet + telnet && \ + apt-get remove --purge -y && \ + rm -rf /var/lib/apt/lists/* RUN mkdir /source WORKDIR /source -ADD ./requirements.txt ./ +COPY ./requirements.txt ./ RUN pip install -r requirements.txt COPY . . -CMD python mishards/main.py +CMD ["python", "mishards/main.py"] diff --git a/tests/milvus_python_test/Dockerfile b/tests/milvus_python_test/Dockerfile index ec78b943dc..dbc3f14ced 100644 --- a/tests/milvus_python_test/Dockerfile +++ b/tests/milvus_python_test/Dockerfile @@ -3,12 +3,13 @@ FROM python:3.6.8-jessie LABEL Name=megasearch_engine_test Version=0.0.1 WORKDIR /app -ADD . /app +COPY . /app RUN apt-get update && apt-get install -y --no-install-recommends \ libc-dev build-essential && \ python3 -m pip install -r requirements.txt && \ - apt-get remove --purge -y + apt-get remove --purge -y && \ + rm -rf /var/lib/apt/lists/* ENTRYPOINT [ "/app/docker-entrypoint.sh" ] CMD [ "start" ] \ No newline at end of file