diff --git a/docker/mace-dev-lite/Dockerfile b/docker/mace-dev-lite/Dockerfile index 05f7cf742baee1d724826c0238a0a9691f98d17d..12741bffce39b3eca12cefdc220cc25cd56c742c 100644 --- a/docker/mace-dev-lite/Dockerfile +++ b/docker/mace-dev-lite/Dockerfile @@ -50,8 +50,8 @@ RUN curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/py ENV PATH /root/.pyenv/bin:/root/.pyenv/shims/:${PATH} RUN eval "$(pyenv init -)" RUN eval "$(pyenv virtualenv-init -)" -RUN pyenv install 2.7.14 && pyenv install 3.6.3 -RUN pyenv global 2.7.14 +RUN pyenv install 3.6.3 +RUN pyenv global 3.6.3 # Setup vim RUN apt-get install -y --no-install-recommends \ @@ -98,46 +98,44 @@ RUN mkdir -p /opt/sdk && \ yes | android update sdk --no-ui -a --filter tools,platform-tools,${ANDROID_API_LEVELS},build-tools-${ANDROID_BUILD_TOOLS_VERSION} RUN ${ANDROID_HOME}/tools/bin/sdkmanager "cmake;3.6.4111459" -# Download NDK +# Download NDK 19c RUN cd /opt/ && \ - wget -q https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip && \ - unzip -q android-ndk-r15c-linux-x86_64.zip && \ - rm -f android-ndk-r15c-linux-x86_64.zip + wget -q https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip && \ + unzip -q android-ndk-r19c-linux-x86_64.zip && \ + rm -f android-ndk-r19c-linux-x86_64.zip ENV ANDROID_NDK_VERSION r19c ENV ANDROID_NDK_HOME /opt/android-ndk-${ANDROID_NDK_VERSION} -# add to PATH -ENV PATH ${PATH}:${ANDROID_NDK_HOME} - # Install tools RUN apt-get install -y --no-install-recommends \ android-tools-adb +# fix docker in docker error: `error while loading shared libraries: libltdl.so.7` +# refer to: https://github.com/jenkinsci/docker/issues/506 +RUN apt-get install -y libltdl7 + RUN pip install --upgrade pip RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com setuptools RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ - numpy>=1.14.0 \ - scipy \ - jinja2 \ - pyyaml \ + numpy==1.15.4 \ + scipy==1.2.0 \ + Jinja2==2.10 \ + PyYAML==3.13 \ sh==1.12.14 \ pycodestyle==2.4.0 \ - filelock \ - PTable + filelock==3.0.10 \ + PTable==0.9.2 -# Install Tensorflow RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ tensorflow==1.8.0 # Install pytorch (refer to: https://pytorch.org/get-started/locally/) -RUN pip install future==0.17.1 torchvision_nightly -RUN pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html +RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ + future==0.17.1 \ + Pillow==5.4.1 \ + torch==1.1.0 \ + torchvision==0.2.2.post3 -# Install ONNX RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ onnx==1.3.0 \ onnx-tf==1.2.0 - -# fix docker in docker error: `error while loading shared libraries: libltdl.so.7` -# refer to: https://github.com/jenkinsci/docker/issues/506 -RUN apt-get install -y libltdl7 diff --git a/docker/mace-dev/Dockerfile b/docker/mace-dev/Dockerfile index 4b8182618df37fa58bcdbb5d9e748aae31c0f094..e5296ca36cdb873bb911399e5a24d0fa04b97dae 100644 --- a/docker/mace-dev/Dockerfile +++ b/docker/mace-dev/Dockerfile @@ -9,66 +9,25 @@ RUN apt-get install -y --no-install-recommends \ screen \ htop -RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ - sphinx \ - sphinx-autobuild \ - sphinx_rtd_theme \ - recommonmark - -# ============ Install same deps for python3 ============ RUN pyenv global 3.6.3 -# Install tools -RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com setuptools -RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ - "numpy>=1.14.0" \ - scipy \ - jinja2 \ - pyyaml \ - sh==1.12.14 \ - pycodestyle==2.4.0 \ - filelock \ - PTable - -# Install Tensorflow -RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ - tensorflow==1.8.0 - -# Install pytorch (refer to: https://pytorch.org/get-started/locally/) -RUN pip install future==0.17.1 torchvision_nightly -RUN pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html - -# Install ONNX -RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ - onnx==1.3.0 \ - onnx-tf==1.2.0 - RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ sphinx \ sphinx-autobuild \ sphinx_rtd_theme \ recommonmark -RUN pyenv global 2.7.14 -# ============ End installing same deps for python3 ============ - - # Customize vim -RUN mkdir -p ~/.vim/autoload ~/.vim/bundle && \ - curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim -RUN mkdir -p ~/.vim/bundle -RUN cd ~/.vim/bundle && \ - git clone https://github.com/scrooloose/nerdtree.git && \ - git clone https://github.com/vim-syntastic/syntastic.git && \ - git clone https://github.com/vim-airline/vim-airline.git && \ - git clone https://github.com/altercation/vim-colors-solarized.git && \ - git clone https://github.com/bazelbuild/vim-ft-bzl.git && \ - git clone https://github.com/google/vim-maktaba.git && \ - git clone https://github.com/google/vim-codefmt.git -RUN curl -LSso ~/.vimrc https://gist.githubusercontent.com/llhe/71c5802919debd5825c100c0135478a7/raw/16a35020cc65f9c25d0cf8f11a3ba7b345a1271d/.vimrc +RUN git clone --recursive https://github.com/llhe/vimrc.git && \ + cd vimrc && \ + rm -rf ~/.vim && \ + rm -rf ~/.vimrc && \ + ln -s `pwd`/vim ~/.vim && \ + ln -s `pwd`/vimrc ~/.vimrc + # Upgrade CMake -RUN wget https://cmake.org/files/v3.11/cmake-3.11.3-Linux-x86_64.tar.gz -P /tmp/ && \ +RUN wget -q https://cmake.org/files/v3.11/cmake-3.11.3-Linux-x86_64.tar.gz -P /tmp/ && \ tar zxf /tmp/cmake-3.11.3-Linux-x86_64.tar.gz --strip-components=1 -C /usr/local/ && \ update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force && \ rm -f /tmp/cmake-3.11.3-Linux-x86_64.tar.gz @@ -106,7 +65,7 @@ RUN cd /opt && \ # Mirror of https://cnbj1.fds.api.xiaomi.com/mace/third-party/gcc-linaro/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz RUN cd /opt && \ - wget -q https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz + wget -q https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz && \ tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz && \ rm -rf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz diff --git a/docker/update_images.sh b/docker/update_images.sh index 156256d9334d8be09adb2b6865b9600d962f79d2..022cb9efd688a3462f2c895968faea6956d50742 100755 --- a/docker/update_images.sh +++ b/docker/update_images.sh @@ -11,15 +11,15 @@ if [ $BUILD_DIR_NAME != $CURRENT_DIR_NAME ]; then fi # build images -docker build -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite ./mace-dev-lite || exit 1 -docker build -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev ./mace-dev-lite || exit 1 -docker build -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/gitlab-runner ./gitlab-runner || exit 1 +docker build --network host -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite ./mace-dev-lite +docker build --network host -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev ./mace-dev +docker build --network host -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/gitlab-runner ./gitlab-runner if grep -lq registry.cn-hangzhou.aliyuncs.com ~/.docker/config.json; then # update images to repository - docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite || exit 1 - docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev || exit 1 - docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/gitlab-runner || exit 1 + docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite + docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev + docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/gitlab-runner else echo "Login docker registry server is needed!" exit 1