Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
7bcead75
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
403
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
7bcead75
编写于
6月 10, 2020
作者:
M
Megvii Engine Team
提交者:
Xu Xinran
6月 19, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ci(docker): add build-arg option to setup yum and pip mirrors
GitOrigin-RevId: bb7aa875dad45d98a02d675ffe5610848baa4c92
上级
6b2760dd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
81 addition
and
0 deletion
+81
-0
ci/docker_env/manylinux2010/Dockerfile
ci/docker_env/manylinux2010/Dockerfile
+4
-0
ci/docker_env/manylinux2010/brainpp_build_image.sh
ci/docker_env/manylinux2010/brainpp_build_image.sh
+9
-0
ci/docker_env/manylinux2010/init_image.sh
ci/docker_env/manylinux2010/init_image.sh
+3
-0
ci/docker_env/manylinux2010/setup_mirror.sh
ci/docker_env/manylinux2010/setup_mirror.sh
+65
-0
未找到文件。
ci/docker_env/manylinux2010/Dockerfile
浏览文件 @
7bcead75
...
@@ -6,6 +6,10 @@ ENV UID=1024 \
...
@@ -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
ci/docker_env/manylinux2010/brainpp_build_image.sh
0 → 100755
浏览文件 @
7bcead75
#!/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"
ci/docker_env/manylinux2010/init_image.sh
浏览文件 @
7bcead75
...
@@ -21,6 +21,7 @@ do
...
@@ -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
...
@@ -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
...
@@ -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
...
...
ci/docker_env/manylinux2010/setup_mirror.sh
0 → 100755
浏览文件 @
7bcead75
#!/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
"
$@
"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录