GitOrigin-RevId: bb7aa875da
tags/v0.5.0
@@ -6,6 +6,10 @@ ENV UID=1024 \ | |||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:/opt/cudnn/lib64:/opt/tensorrt/lib \ | LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:/opt/cudnn/lib64:/opt/tensorrt/lib \ | ||||
CPATH=${CPATH}:/usr/local/cuda/include:/opt/cudnn/include:/opt/tensorrt/include | CPATH=${CPATH}:/usr/local/cuda/include:/opt/cudnn/include:/opt/tensorrt/include | ||||
ARG platform | |||||
COPY setup_mirror.sh . | |||||
RUN ./setup_mirror.sh "$platform" | |||||
ADD init_image.sh /tmp | ADD init_image.sh /tmp | ||||
RUN /tmp/init_image.sh && rm -f /tmp/init_image.sh | RUN /tmp/init_image.sh && rm -f /tmp/init_image.sh | ||||
@@ -0,0 +1,9 @@ | |||||
#!/bin/bash | |||||
cd $(dirname $0) | |||||
docker build -t env_manylinux2010:latest . \ | |||||
--build-arg platform="brainpp" \ | |||||
--build-arg http_proxy="http://proxy.i.brainpp.cn:3128" \ | |||||
--build-arg https_proxy="http://proxy.i.brainpp.cn:3128" \ | |||||
--build-arg no_proxy="brainpp.cn,.brainpp.ml,.megvii-inc.com,.megvii-op.org,127.0.0.1,localhost" |
@@ -21,6 +21,7 @@ do | |||||
done | done | ||||
pushd /home >/dev/null | pushd /home >/dev/null | ||||
echo "Install swig" | |||||
curl -sSL ${SWIG_URL} | tar xz | curl -sSL ${SWIG_URL} | tar xz | ||||
pushd swig-3.0.12 >/dev/null | pushd swig-3.0.12 >/dev/null | ||||
mkdir build | mkdir build | ||||
@@ -32,6 +33,7 @@ pushd /home >/dev/null | |||||
popd >/dev/null | popd >/dev/null | ||||
rm -rf swig-3.0.12 | rm -rf swig-3.0.12 | ||||
echo "Install llvm" | |||||
curl -sSL ${LLVM_URL} | tar xz | curl -sSL ${LLVM_URL} | tar xz | ||||
pushd llvm-release_60 >/dev/null | pushd llvm-release_60 >/dev/null | ||||
mkdir build | mkdir build | ||||
@@ -44,6 +46,7 @@ pushd /home >/dev/null | |||||
popd >/dev/null | popd >/dev/null | ||||
rm -rf llvm-release_60 | rm -rf llvm-release_60 | ||||
echo "Install clang" | |||||
curl -sSL ${CLANG_URL} | tar xz | curl -sSL ${CLANG_URL} | tar xz | ||||
pushd clang-release_60 >/dev/null | pushd clang-release_60 >/dev/null | ||||
mkdir build | mkdir build | ||||
@@ -0,0 +1,65 @@ | |||||
#!/bin/bash | |||||
set -e | |||||
function set_tuna_yum_mirror() { | |||||
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak | |||||
local repo=/etc/yum.repos.d/CentOS-Base.repo | |||||
local plugin=/etc/yum/pluginconf.d/fastestmirror.conf | |||||
sed -i "s/mirrorlist=/#mirrorlist=/g" $repo | |||||
sed -i "s/#baseurl/baseurl/g" $repo | |||||
sed -i "s/mirror.centos.org/mirrors.tuna.tsinghua.edu.cn/g" $repo | |||||
sed -i "s/http/https/g" $repo | |||||
sed -i "s/enabled=1/enabled=0/g" $plugin | |||||
yum clean all | |||||
# Build on brainpp unable to pull epel reo metadata so disable this | |||||
# https://unix.stackexchange.com/questions/148144/unable-to-pull-epel-repository-metadata | |||||
yum --disablerepo="epel" update nss | |||||
yum makecache | |||||
} | |||||
function set_epel() { | |||||
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup | |||||
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup | |||||
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo | |||||
} | |||||
function set_yum_mirror() { | |||||
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup | |||||
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo | |||||
yum makecache | |||||
} | |||||
function set_pip_mirror() { | |||||
cat > /etc/pip.conf <<EOF | |||||
[global] | |||||
timeout = 180 | |||||
index-url = https://mirrors.aliyun.com/pypi/simple | |||||
extra-index-url = | |||||
http://mirrors.i.brainpp.cn/pypi/simple/ | |||||
http://pypi.i.brainpp.cn/brain/dev/+simple | |||||
https://pypi.tuna.tsinghua.edu.cn/simple | |||||
trusted-host = | |||||
mirrors.i.brainpp.cn | |||||
pypi.i.brainpp.cn | |||||
pypi.tuna.tsinghua.edu.cn | |||||
mirrors.aliyun.com | |||||
EOF | |||||
} | |||||
function main() { | |||||
local platform=$1 | |||||
case $platform in | |||||
brainpp) | |||||
set_epel | |||||
set_yum_mirror | |||||
set_pip_mirror | |||||
;; | |||||
*) | |||||
echo "No setup required" | |||||
;; | |||||
esac | |||||
} | |||||
main "$@" |