diff --git a/docker/build/dev.x86_64.dockerfile b/docker/build/dev.x86_64.dockerfile index 2db2ec1ee342e99304d6f2662db4ae940ce691a6..f2ccee0e9818f3e96bdb500e42ae4ea7d55275dd 100644 --- a/docker/build/dev.x86_64.dockerfile +++ b/docker/build/dev.x86_64.dockerfile @@ -1,4 +1,4 @@ -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 diff --git a/docker/build/installers/post_install.sh b/docker/build/installers/post_install.sh index 9782ef0e7ee8ba47f762b8f136f7a3229f186115..7bb82b507d12dde768ddd88cd278c14e68d62e42 100755 --- a/docker/build/installers/post_install.sh +++ b/docker/build/installers/post_install.sh @@ -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 diff --git a/docker/scripts/cyber_start.sh b/docker/scripts/cyber_start.sh index 9eb10288f26184e430d0d0802fb879eebd9eb87b..b07da7f26a84cb21d849036cc2da509d2e9163e4 100755 --- a/docker/scripts/cyber_start.sh +++ b/docker/scripts/cyber_start.sh @@ -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 diff --git a/docker/scripts/dev_start.sh b/docker/scripts/dev_start.sh index 5322fe581bf8dd76b68d77cb4cb99f40bf642478..3209063649f18daac2feb4ea3701c3b841d1c035 100755 --- a/docker/scripts/dev_start.sh +++ b/docker/scripts/dev_start.sh @@ -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= diff --git a/scripts/apollo_config.sh b/scripts/apollo_config.sh index 54bbb98b67df20b867b80622f0f15211182e777b..3ffabf513fabd7f555f523aeb200bda7d35f9d2f 100755 --- a/scripts/apollo_config.sh +++ b/scripts/apollo_config.sh @@ -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." diff --git a/tools/bootstrap.py b/tools/bootstrap.py index 1748785a6b1b585d6c278e618a118943b743238e..c44d830ac7848199723b167f10a78091d5dd1e23 100755 --- a/tools/bootstrap.py +++ b/tools/bootstrap.py @@ -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)