提交 30cc0eaf 编写于 作者: S storypku 提交者: Xiangquan Xiao

Docker|Bazel: bugfix for "apollo.sh config"

introduced also new cyber|dev.x86_64 images with deviceQuery
上级 1597ae45
FROM apolloauto/apollo:cyber-x86_64-18.04-20200823_0434
FROM apolloauto/apollo:cyber-x86_64-18.04-20200914_0704
ARG GEOLOC
ARG BUILD_STAGE
......
......@@ -24,6 +24,8 @@ build_stage="$1"; shift
[ -d /tmp/installers ] && rm -rf /tmp/installers
echo "stage=${build_stage}" > /etc/apollo.conf
if [[ "${build_stage}" == "cyber" ]]; then
# https://stackoverflow.com/questions/25193161/chfn-pam-system-error-intermittently-in-docker-hub-builds
ln -s -f /bin/true /usr/bin/chfn
......
......@@ -20,7 +20,7 @@ source "${APOLLO_ROOT_DIR}/scripts/apollo.bashrc"
# CACHE_ROOT_DIR="${APOLLO_ROOT_DIR}/.cache"
VERSION_X86_64="cyber-x86_64-18.04-20200823_0434"
VERSION_X86_64="cyber-x86_64-18.04-20200914_0704"
# ARMV8
# VERSION_AARCH64="cyber-aarch64-18.04-20200717_0327"
# L4T
......
......@@ -30,7 +30,7 @@ SUPPORTED_ARCHS=" x86_64 aarch64 "
HOST_ARCH="$(uname -m)"
TARGET_ARCH="$(uname -m)"
VERSION_X86_64="dev-x86_64-18.04-20200908_0211"
VERSION_X86_64="dev-x86_64-18.04-20200914_0742"
VERSION_AARCH64="dev-aarch64-18.04-20200829_1811"
USER_VERSION_OPT=
......
......@@ -31,9 +31,9 @@ function run_bootstrap() {
function print_usage() {
info "Usage: $0 [Options]"
info "Options:"
info "${TAB}-i|--interactive Run in interactive mode"
info "${TAB}--noninteractive Run in non-interactive mode"
info "${TAB}-h|--help Show this message and exit"
info "${TAB}-i|--interactive Run in interactive mode"
info "${TAB}-n|--noninteractive Run in non-interactive mode"
info "${TAB}-h|--help Show this message and exit"
}
function main() {
......@@ -58,7 +58,7 @@ function main() {
ok "Successfully configured ${mycfg} in interactive mode."
exit 0
;;
--noninteractive)
-n | --noninteractive)
info "Configure ${mycfg} in non-interactive mode"
run_bootstrap --interactive false
ok "Successfully configured ${mycfg} in non-interactive mode."
......
......@@ -59,6 +59,7 @@ _APOLLO_BAZELRC = '.apollo.bazelrc'
_APOLLO_CURRENT_BAZEL_VERSION = None
_APOLLO_MIN_BAZEL_VERSION = '2.0.0'
_APOLLO_INSIDE_DOCKER = True
_APOLLO_DOCKER_STAGE = "dev"
_INTERACTIVE_MODE = True
......@@ -75,6 +76,17 @@ def inside_docker():
return os.path.isfile('/.dockerenv')
def docker_stage():
if not inside_docker():
return "dev"
with open("/etc/apollo.conf") as f:
for line in f:
line = line.strip()
if line.startswith("stage="):
return line.split("=")[-1]
return "dev"
def default_root_dir():
current_dir = os.path.dirname(__file__)
if len(current_dir) == 0:
......@@ -943,6 +955,7 @@ def main():
global _APOLLO_CURRENT_BAZEL_VERSION
global _APOLLO_INSIDE_DOCKER
global _INTERACTIVE_MODE
global _APOLLO_DOCKER_STAGE
parser = argparse.ArgumentParser()
parser.add_argument(
......@@ -960,7 +973,7 @@ def main():
_APOLLO_ROOT_DIR = default_root_dir()
_APOLLO_BAZELRC = os.path.join(_APOLLO_ROOT_DIR, args.output_file)
_APOLLO_INSIDE_DOCKER = inside_docker()
_APOLLO_DOCKER_STAGE = docker_stage()
_INTERACTIVE_MODE = args.interactive
# Make a copy of os.environ to be clear when functions and getting and setting
......@@ -982,11 +995,13 @@ def main():
setup_python(environ_cp)
environ_cp['TF_NEED_CUDA'] = '1'
environ_cp['TF_NEED_TENSORRT'] = '1'
# build:gpu --config=using_cuda
write_to_bazelrc('build:gpu --config=cuda')
write_to_bazelrc('build:gpu --config=tensorrt')
if _APOLLO_DOCKER_STAGE == "dev":
environ_cp['TF_NEED_TENSORRT'] = '1'
write_to_bazelrc('build:gpu --config=tensorrt')
write_blank_line_to_bazelrc()
setup_cuda_family_config(environ_cp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册