Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
f258c816
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,发现更多精彩内容 >>
提交
f258c816
编写于
6月 12, 2020
作者:
L
Liu Jiaming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Scripts: retire release-image
上级
248df0e8
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
31 addition
and
107 deletion
+31
-107
apollo_docker.sh
apollo_docker.sh
+31
-107
未找到文件。
apollo_docker.sh
浏览文件 @
f258c816
...
...
@@ -15,18 +15,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
cd
"
${
DIR
}
"
# the machine type, currently support x86_64, aarch64
MACHINE_ARCH
=
$(
uname
-m
)
source
${
DIR
}
/scripts/apollo_base.sh
source
${
DIR
}
/scripts/apollo.bashrc
TIME
=
$(
date
+%Y%m%d_%H%M
)
if
[
-z
"
${
DOCKER_REPO
}
"
]
;
then
DOCKER_REPO
=
apolloauto/apollo
fi
DEV_CONTAINER
=
"apollo_dev_
${
USER
}
"
function
print_usage
()
{
RED
=
'\033[0;31m'
...
...
@@ -35,14 +27,14 @@ function print_usage() {
NONE
=
'\033[0m'
echo
-e
"
\n
${
RED
}
Usage
${
NONE
}
:
.
${
BOLD
}
/apollo_docker.sh
${
NONE
}
[OPTION]"
${
BOLD
}
.
/apollo_docker.sh
${
NONE
}
[OPTION]"
echo
-e
"
\n
${
RED
}
Options
${
NONE
}
:
${
BLUE
}
build
${
NONE
}
: run build only
${
BLUE
}
build_opt
${
NONE
}
: build optimized binary for the code
${
BLUE
}
build_gpu
${
NONE
}
: run build only with Caffe GPU mode support
${
BLUE
}
build_opt_gpu
${
NONE
}
: build optimized binary with Caffe GPU mode support
${
BLUE
}
build_fe
${
NONE
}
: compile frontend
javascript code, this requires all the node_modules to be installed already
${
BLUE
}
build_fe
${
NONE
}
: compile frontend
JS code (requires all required node modules already installed)
${
BLUE
}
buildify
${
NONE
}
: fix style of BUILD files
${
BLUE
}
check
${
NONE
}
: run build/lint/test, please make sure it passes before checking in new code
${
BLUE
}
clean
${
NONE
}
: run Bazel clean
...
...
@@ -50,114 +42,46 @@ function print_usage() {
${
BLUE
}
coverage
${
NONE
}
: generate test coverage report
${
BLUE
}
doc
${
NONE
}
: generate doxygen document
${
BLUE
}
lint
${
NONE
}
: run code style check
${
BLUE
}
usage
${
NONE
}
: print this menu
${
BLUE
}
release
${
NONE
}
: build release version
${
BLUE
}
test
${
NONE
}
: run all unit tests
${
BLUE
}
usage
${
NONE
}
: print this menu
${
BLUE
}
version
${
NONE
}
: display current commit and date
${
BLUE
}
push
${
NONE
}
: pushes the images to Docker hub
${
BLUE
}
gen
${
NONE
}
: generate a docker release image
${
BLUE
}
ota_gen
${
NONE
}
: generate an ota docker release image
"
}
function
start_build_docker
()
{
docker ps
--format
"{{.Names}}"
|
grep
apollo_dev_
$USER
1>/dev/null 2>&1
if
[
$?
!=
0
]
;
then
function
start_docker
()
{
if
docker ps
--format
"{{.Names}}"
|
grep
-q
"
${
DEV_CONTAINER
}
"
;
then
return
fi
# If Google is reachable, we fetch the docker image directly.
if
ping
-q
-c
1
-W
1 www.google.com 1>/dev/null 2>&1
;
then
if
ping
-q
-c
1
-W
1 www.google.com &>/dev/null
;
then
opt
=
""
else
ping
-q
-c
1
-W
1 www.baidu.com 1>/dev/null 2>&1
if
!
ping
-q
-c
1
-W
1 www.baidu.com &>/dev/null
;
then
# If Baidu is unreachable, we use local images.
if
[
$?
-ne
0
]
;
then
opt
=
"-l"
fi
fi
bash docker/scripts/dev_start.sh
${
opt
}
fi
}
function
gen_docker
()
{
IMG
=
"apolloauto/apollo:run-
${
MACHINE_ARCH
}
-20181017_1330"
CACHE_ROOT_DIR
=
"
${
DIR
}
/.cache"
APOLLO_DIR
=
"
${
CACHE_ROOT_DIR
}
/apollo_release/apollo"
if
[
!
-d
"
${
APOLLO_DIR
}
"
]
;
then
echo
"Release directory does not exist!"
# RELEASE_NAME=$(docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}"
function
main
()
{
if
[
$#
-eq
0
]
;
then
print_usage
exit
1
fi
RELEASE_NAME
=
"
${
DOCKER_REPO
}
:release-
${
MACHINE_ARCH
}
-
${
TIME
}
"
DEFAULT_NAME
=
"
${
DOCKER_REPO
}
:release-
${
MACHINE_ARCH
}
-latest"
docker pull
$IMG
echo
"time :
${
TIME
}
"
>>
${
APOLLO_DIR
}
/meta.ini
echo
"tag:
${
RELEASE_NAME
}
"
>>
${
APOLLO_DIR
}
/meta.ini
docker ps
-a
--format
"{{.Names}}"
|
grep
'apollo_release'
1>/dev/null
if
[
$?
==
0
]
;
then
docker stop apollo_release 1>/dev/null
docker
rm
-f
apollo_release 1>/dev/null
fi
docker run
-it
\
-d
\
--name
apollo_release
\
--net
host
\
-v
${
CACHE_ROOT_DIR
}
:/root/mnt
\
-w
/apollo
\
"
$IMG
"
if
[
"
$OTA_RELEASE
"
!=
"1"
]
;
then
docker
exec
apollo_release bash
-c
'cp -Lr /root/mnt/apollo_release/apollo /'
else
RELEASE_TGZ
=
"apollo_release.tar.gz"
SEC_RELEASE_TGZ
=
"sec_apollo_release.tar.gz"
[
-e
"
${
CACHE_ROOT_DIR
}
/
${
RELEASE_TGZ
}
"
]
&&
rm
-f
"
${
CACHE_ROOT_DIR
}
/
${
RELEASE_TGZ
}
"
[
-e
"
${
CACHE_ROOT_DIR
}
/
${
SEC_RELEASE_TGZ
}
"
]
&&
rm
-f
"
${
CACHE_ROOT_DIR
}
/
${
SEC_RELEASE_TGZ
}
"
# generate security release package
tar
czf
"
${
CACHE_ROOT_DIR
}
/
${
RELEASE_TGZ
}
"
-C
"
${
CACHE_ROOT_DIR
}
"
apollo_release
python modules/tools/ota/create_sec_package.py
docker
exec
apollo_release
cp
/root/mnt/
${
SEC_RELEASE_TGZ
}
/root
fi
CONTAINER_ID
=
$(
docker ps |
grep
apollo_release |
awk
'{print $1}'
)
docker commit
"
$CONTAINER_ID
"
"
$DEFAULT_NAME
"
docker tag
"
$DEFAULT_NAME
"
"
$RELEASE_NAME
"
docker stop
"
$CONTAINER_ID
"
}
function
push
()
{
DEFAULT_NAME
=
"
${
DOCKER_REPO
}
:release-
${
MACHINE_ARCH
}
-latest"
LATEST_IMAG_ID
=
$(
docker images
--format
"{{.Repository}}:{{.Tag}} {{.ID}}"
|
grep
"
${
DEFAULT_NAME
}
"
|
cut
-d
" "
-f
2
)
RELEASE_NAME
=
$(
docker images
--format
"{{.Repository}}:{{.Tag}} {{.ID}}"
|
grep
${
LATEST_IMAG_ID
}
|
grep
-v
"
${
DEFAULT_NAME
}
"
|
cut
-d
" "
-f
1
)
docker push
"
$DEFAULT_NAME
"
docker push
"
$RELEASE_NAME
"
}
if
[
$#
==
0
]
;
then
option
=
"
$1
"
case
$option
in
-h
|
--help
)
print_usage
exit
1
fi
start_build_docker
case
$1
in
print_usage
)
print_usage
;;
push
)
push
;;
gen
)
gen_docker
;;
ota_gen
)
OTA_RELEASE
=
1
gen_docker
;;
*
)
# TODO(storypku): fix user account issue
docker
exec
-u
$USER
apollo_dev_
$USER
bash
-c
"./apollo.sh
$@
"
start_docker
docker
exec
-u
"
${
USER
}
"
"
${
DEV_CONTAINER
}
"
bash
-c
"./apollo.sh
$*
"
;;
esac
esac
}
main
"
$@
"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录