Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
78418073
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
78418073
编写于
10月 19, 2020
作者:
S
storypku
提交者:
Liu Jiaming
10月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cyber_start.sh: "-g cn" now uses registry.baidubce.com as registry for China
上级
576d5275
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
30 deletion
+8
-30
docker/scripts/cyber_start.sh
docker/scripts/cyber_start.sh
+8
-30
未找到文件。
docker/scripts/cyber_start.sh
浏览文件 @
78418073
...
...
@@ -41,6 +41,7 @@ USE_GPU_HOST=0
USE_LOCAL_IMAGE
=
0
CUSTOM_VERSION
=
GEOLOC
=
GEO_REGISTRY
=
# Check whether user has agreed license agreement
function
check_agreement
()
{
...
...
@@ -259,29 +260,6 @@ function determine_target_version_and_arch() {
CUSTOM_VERSION
=
"
${
version
}
"
}
function
_geo_specific_config_for_cn
()
{
local
docker_cfg
=
"/etc/docker/daemon.json"
if
[
-e
"
${
docker_cfg
}
"
]
&&
\
jq
'."registry-mirrors"[]'
"
${
docker_cfg
}
"
&>/dev/null
;
then
echo
"Existing registry mirrors in found
${
docker_cfg
}
and will be used."
return
fi
if
[
!
-e
"
${
docker_cfg
}
"
]
;
then
echo
"{
\"
experimental
\"
:true,
\"
registry-mirrors
\"
:[
\
\"
http://hub-mirror.c.163.com
\"
,
\
\"
https://reg-mirror.qiniu.com
\"
,
\
\"
https://dockerhub.azk8s.cn
\"
\
]}"
| jq
-s
".[]"
|
sudo tee
-a
"
${
docker_cfg
}
"
else
local
tmpfile
=
"
$(
mktemp
/tmp/docker.daemon.XXXXXX
)
"
jq
'.+={"registry-mirrors":["http://hub-mirror.c.163.com","https://reg-mirror.qiniu.com","https://dockerhub.azk8s.cn"]}'
\
"
${
docker_cfg
}
"
>
"
${
tmpfile
}
"
sudo cp
-f
"
${
tmpfile
}
"
"
${
docker_cfg
}
"
fi
service docker restart
}
function
geo_specific_config
()
{
local
geo
=
"
$1
"
if
[[
-z
"
${
geo
}
"
]]
;
then
...
...
@@ -289,7 +267,7 @@ function geo_specific_config() {
fi
info
"Setup geolocation specific configurations for
${
geo
}
"
if
[[
"
${
geo
}
"
==
"cn"
]]
;
then
_geo_specific_config_for_cn
GEO_REGISTRY
=
"registry.baidubce.com"
fi
}
...
...
@@ -372,11 +350,11 @@ function setup_devices_and_mount_volumes() {
local
os_release
=
"
$(
lsb_release
-rs
)
"
case
"
${
os_release
}
"
in
1
4
.04
)
warning
"[Deprecated] Support for Ubuntu 1
4
.04 will be removed"
\
1
6
.04
)
warning
"[Deprecated] Support for Ubuntu 1
6
.04 will be removed"
\
"in the near future. Please upgrade to ubuntu 18.04+."
;;
1
6.04|1
8.04|20.04|
*
)
18.04|20.04|
*
)
## Question(storypku): Any special considerations here ?
if
[[
"
${
HOST_ARCH
}
"
==
"
${
TARGET_ARCH
}
"
]]
;
then
volumes
=
"
${
volumes
}
-v /dev:/dev"
...
...
@@ -420,9 +398,11 @@ function docker_pull_if_needed() {
return
fi
# Note(storypku): use may-be-modified ${DOCKER_REPO}
image
=
"
${
DOCKER_REPO
}
:
${
image
##*
:
}
"
echo
"Start pulling docker image:
${
image
}
"
if
[[
-n
"
${
GEO_REGISTRY
}
"
]]
;
then
image
=
"
${
GEO_REGISTRY
}
/
${
image
}
"
fi
if
!
${
DOCKER_PULL_CMD
}
"
${
image
}
"
;
then
error
"Failed to pull docker image:
${
image
}
"
exit
1
...
...
@@ -535,8 +515,6 @@ function main() {
geo_specific_config
"
${
GEOLOC
}
"
docker_pull_if_needed
"
${
image
}
"
"
${
USE_LOCAL_IMAGE
}
"
image
=
"
${
DOCKER_REPO
}
:
${
CUSTOM_VERSION
}
"
remove_existing_cyber_container
determine_gpu_use_host
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录