From bc67bd2fcd8343065c9a60bd29dbcd7315916f45 Mon Sep 17 00:00:00 2001 From: Tianqi Chen Date: Mon, 11 May 2020 09:04:28 -0700 Subject: [PATCH] [CI] Update ci-cpu to bionic (#5554) --- docker/Dockerfile.ci_cpu | 12 +++---- docker/install/ubuntu1804_install_llvm.sh | 40 +++++++++++++++++++++ docker/install/ubuntu1804_install_python.sh | 32 +++++++++++++++++ docker/install/ubuntu_install_nnpack.sh | 2 +- docker/install/ubuntu_install_redis.sh | 5 ++- docker/install/ubuntu_install_tflite.sh | 4 +-- 6 files changed, 82 insertions(+), 13 deletions(-) create mode 100755 docker/install/ubuntu1804_install_llvm.sh create mode 100755 docker/install/ubuntu1804_install_python.sh diff --git a/docker/Dockerfile.ci_cpu b/docker/Dockerfile.ci_cpu index abd7c0d04dab..f1a928a5a0d6 100644 --- a/docker/Dockerfile.ci_cpu +++ b/docker/Dockerfile.ci_cpu @@ -16,22 +16,22 @@ # under the License. # CI docker CPU env -# tag: v0.55 -FROM ubuntu:16.04 +# tag: v0.62 +FROM ubuntu:18.04 RUN apt-get update --fix-missing COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh RUN bash /install/ubuntu_install_core.sh -COPY install/ubuntu_install_python.sh /install/ubuntu_install_python.sh -RUN bash /install/ubuntu_install_python.sh +COPY install/ubuntu1804_install_python.sh /install/ubuntu1804_install_python.sh +RUN bash /install/ubuntu1804_install_python.sh COPY install/ubuntu_install_python_package.sh /install/ubuntu_install_python_package.sh RUN bash /install/ubuntu_install_python_package.sh -COPY install/ubuntu_install_llvm.sh /install/ubuntu_install_llvm.sh -RUN bash /install/ubuntu_install_llvm.sh +COPY install/ubuntu1804_install_llvm.sh /install/ubuntu1804_install_llvm.sh +RUN bash /install/ubuntu1804_install_llvm.sh # Rust env (build early; takes a while) COPY install/ubuntu_install_rust.sh /install/ubuntu_install_rust.sh diff --git a/docker/install/ubuntu1804_install_llvm.sh b/docker/install/ubuntu1804_install_llvm.sh new file mode 100755 index 000000000000..4f7c9df7ac8e --- /dev/null +++ b/docker/install/ubuntu1804_install_llvm.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# 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. + +set -e +set -u +set -o pipefail + +echo deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main\ + >> /etc/apt/sources.list.d/llvm.list +echo deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main\ + >> /etc/apt/sources.list.d/llvm.list + + +echo deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main\ + >> /etc/apt/sources.list.d/llvm.list +echo deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main\ + >> /etc/apt/sources.list.d/llvm.list + +echo deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main\ + >> /etc/apt/sources.list.d/llvm.list +echo deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main\ + >> /etc/apt/sources.list.d/llvm.list + +wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - +apt-get update && apt-get install -y llvm-9 llvm-10 llvm-11 clang-9 clang-10 clang-11 diff --git a/docker/install/ubuntu1804_install_python.sh b/docker/install/ubuntu1804_install_python.sh new file mode 100755 index 000000000000..6b4d6fb4f727 --- /dev/null +++ b/docker/install/ubuntu1804_install_python.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# 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. + +set -e +set -u +set -o pipefail + +# install python and pip, don't modify this, modify install_python_package.sh +apt-get update +apt-get install -y software-properties-common +apt-get install -y python3-dev python3-setuptools + +# Install pip +cd /tmp && wget -q https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py + +# Pin pip version +pip3 install pip==19.3.1 diff --git a/docker/install/ubuntu_install_nnpack.sh b/docker/install/ubuntu_install_nnpack.sh index 6eb94ae6f5c2..744f76a162bb 100755 --- a/docker/install/ubuntu_install_nnpack.sh +++ b/docker/install/ubuntu_install_nnpack.sh @@ -20,7 +20,7 @@ set -e set -u set -o pipefail -apt-get update && apt-get install -y --no-install-recommends git cmake +apt-get update && apt-get install -y --no-install-recommends git cmake python-setuptools git clone https://github.com/Maratyszcza/NNPACK NNPACK git clone https://github.com/Maratyszcza/pthreadpool NNPACK/pthreadpool diff --git a/docker/install/ubuntu_install_redis.sh b/docker/install/ubuntu_install_redis.sh index 9679fddf1894..939b36679b53 100755 --- a/docker/install/ubuntu_install_redis.sh +++ b/docker/install/ubuntu_install_redis.sh @@ -6,9 +6,9 @@ # 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 @@ -21,5 +21,4 @@ set -u set -o pipefail apt-get update && apt-get install -y redis-server -pip2 install xgboost psutil pip3 install xgboost psutil diff --git a/docker/install/ubuntu_install_tflite.sh b/docker/install/ubuntu_install_tflite.sh index f7ed4841b328..123ff520d725 100755 --- a/docker/install/ubuntu_install_tflite.sh +++ b/docker/install/ubuntu_install_tflite.sh @@ -29,7 +29,6 @@ cd .. # Install flatbuffers python packages. pip3 install flatbuffers -pip2 install flatbuffers # Build the TFLite static library, necessary for building with TFLite ON. # The library is built at: @@ -69,9 +68,8 @@ cat <__init__.py name = "tflite" EOM -# Install tflite over python2 and python3 +# Install tflite over python3 python3 setup.py install -python2 setup.py install cd .. rm -rf tflite