what_works.sh 6.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/usr/bin/env bash

###############################################################################
# Copyright 2020 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# For development only! Will remove before merging to master!
19 20 21 22
# Testing steps:
# 1. Start container: ./docker/scripts/dev_start.sh
# 2. Login to container: ./docker/scripts/dev_into.sh
# 3. Run this script.
23 24 25
###############################################################################

cd "$( dirname "${BASH_SOURCE[0]}" )"
26

S
storypku 已提交
27 28 29
FLAG_PKG="libatlas-base-dev"
if dpkg -l |grep -q "${FLAG_PKG}"; then
    echo "${FLAG_PKG} already installed"
30
else
S
storypku 已提交
31
    sudo apt-get -y update
S
storypku 已提交
32
    sudo apt-get -y install ${FLAG_PKG} libpython2.7-dev
33
fi
34 35
echo "/opt/apollo/pkgs/caffe/lib" | sudo tee -a /etc/ld.so.conf.d/apollo.conf
sudo ldconfig
36

37 38 39
# Fail on first failure.
set -e

40
./apollo6.sh config --noninteractive
41

42
function bazel_build_with_dist_cache() {
S
storypku 已提交
43 44
    # bazel build -c opt --distdir=/apollo/.cache/distdir "$@"
    bazel build --distdir=/apollo/.cache/distdir "$@"
45 46 47
}

function bazel_test_with_dist_cache() {
S
storypku 已提交
48
    bazel test --distdir=/apollo/.cache/distdir "$@"
49 50
}

51
# Working parts.
52
bazel_build_with_dist_cache \
X
Xiangquan Xiao 已提交
53 54 55 56
    //cyber/... \
    //modules/bridge/... \
    //modules/canbus/... \
    //modules/common/... \
57
    //modules/map/...    \
X
Xiangquan Xiao 已提交
58
    //modules/control/... \
X
Xiangquan Xiao 已提交
59
    //modules/data/... \
X
Xiangquan Xiao 已提交
60 61 62
    //modules/monitor/... \
    //modules/routing/... \
    //modules/storytelling/... \
S
storypku 已提交
63
    //modules/transform/... \
64
    //modules/v2x/... \
S
storypku 已提交
65
    //modules/dreamview/... \
66
    //modules/guardian/... \
67
    //modules/localization/... \
68
    //modules/prediction/... \
69
    //modules/contrib/... \
70
    //modules/planning/... \
71
    //modules/perception/... \
S
storypku 已提交
72
    //modules/third_party_perception/...
X
Xiangquan Xiao 已提交
73

74
bazel_test_with_dist_cache \
X
Xiangquan Xiao 已提交
75 76 77 78 79
    //cyber/... \
    //modules/bridge/... \
    //modules/canbus/... \
    //modules/common/... \
    //modules/control/... \
X
Xiangquan Xiao 已提交
80
    //modules/data/... \
X
Xiangquan Xiao 已提交
81 82 83
    //modules/monitor/... \
    //modules/routing/... \
    //modules/storytelling/... \
S
storypku 已提交
84
    //modules/transform/... \
85
    //modules/v2x/... \
S
storypku 已提交
86
    //modules/dreamview/... \
87
    //modules/guardian/... \
88
    //modules/map/... \
89
    //modules/contrib/... \
S
storypku 已提交
90
    //modules/third_party_perception/...
S
storypku 已提交
91

S
storypku 已提交
92
# Drivers: OK
S
storypku 已提交
93
bash scripts/install_esdcan_library.sh install
94 95
bazel_build_with_dist_cache //modules/drivers/...
bazel_test_with_dist_cache //modules/drivers/...
S
storypku 已提交
96
bash scripts/install_esdcan_library.sh uninstall
97

S
storypku 已提交
98
# Perception: 7 test failures + 2 flaky
S
storypku 已提交
99
bazel_test_with_dist_cache $(bazel query //modules/perception/... \
S
storypku 已提交
100 101 102 103 104 105 106
	except //modules/perception/lidar/lib/detection/lidar_point_pillars:point_pillars_test \
	except //modules/perception/camera/test:camera_lib_obstacle_transformer_multicue_multicue_obstacle_transformer_test \
	except //modules/perception/camera/test:camera_lib_obstacle_detector_yolo_yolo_obstacle_detector_test \
	except //modules/perception/camera/test:camera_lib_obstacle_detector_yolo_region_output_test \
	except //modules/perception/camera/test:camera_lib_lane_postprocessor_darkscnn_lane_postprocessor_test \
	except //modules/perception/camera/test:camera_lib_lane_detector_darkscnn_lane_detector_test \
	except //modules/perception/camera/test:camera_app_obstacle_camera_perception_test \
S
storypku 已提交
107
)
S
storypku 已提交
108 109 110
# Flaky
# //modules/perception/camera/test:camera_lib_lane_postprocessor_denseline_lane_postprocessor_test
# //modules/perception/camera/test:camera_lib_lane_detector_denseline_lane_detector_test
S
storypku 已提交
111

112
bazel_build_with_dist_cache //modules/tools/...
S
storypku 已提交
113 114 115
bazel_test_with_dist_cache $(bazel query //modules/tools/... \
    except //modules/tools/visualizer/... \
)
116

S
storypku 已提交
117
# Localization: 3 test failures
118
bazel_test_with_dist_cache $(bazel query //modules/localization/... \
S
storypku 已提交
119 120 121
    except //modules/localization/ndt/ndt_locator:ndt_lidar_locator_test \
    except //modules/localization/msf/local_pyramid_map/pyramid_map:pyramid_map_test \
    except //modules/localization/msf/local_pyramid_map/pyramid_map:pyramid_map_pool_test \
122
)
123

124
# Prediction: 4 test failures
125 126 127 128 129 130 131
bazel_test_with_dist_cache $(bazel query //modules/prediction/... \
    except //modules/prediction/predictor/single_lane:single_lane_predictor_test \
    except //modules/prediction/container/obstacles:obstacle_test \
    except //modules/prediction/container/obstacles:obstacle_clusters_test \
    except //modules/prediction/common:road_graph_test \
)

132 133 134 135 136 137 138 139 140 141
# Planning: 7 test failures
bazel_test_with_dist_cache $(bazel query //modules/planning/... \
    except //modules/planning/tasks/learning_model:learning_model_inference_task_test \
    except //modules/planning/reference_line:qp_spline_reference_line_smoother_test   \
    except //modules/planning/open_space/trajectory_smoother:dual_variable_warm_start_osqp_interface_test \
    except //modules/planning/math/smoothing_spline:osqp_spline_2d_solver_test  \
    except //modules/planning/math/smoothing_spline:osqp_spline_1d_solver_test  \
    except //modules/planning/learning_based/model_inference:model_inference_test   \
    except //modules/planning/integration_tests:sunnyvale_big_loop_test \
)
S
storypku 已提交
142 143 144

# FIXME(all): inference_demo crashed
# bazel run //modules/planning/tools:inference_demo
145

146 147
echo "########################### All check passed! ###########################"

148 149
# In-progress parts. Feel free to claim by adding your name in TODO and move it

X
Xiangquan Xiao 已提交
150 151 152 153 154 155 156 157 158 159
# TODO(?): apollo.sh build
# TODO(?): apollo.sh test
# TODO(?): apollo.sh lint
# TODO(?): apollo.sh check
# TODO(?): bstart; apollo.sh check
# TODO(?): replay-engine image which is compatible with docker_dev branch.
# TODO(?): Integrate pycodestyle (or similar) into "apollo.sh lint" to lint python code.
#          See https://pypi.org/project/pycodestyle/
# TODO(?): Use py_library, py_binary, py_test to manage python code:
#          See https://docs.bazel.build/versions/master/be/python.html
S
storypku 已提交
160
# TODO(Kecheng Xu): modules/tools/configurator/configurator.py: 2to3
S
storypku 已提交
161
# TODO(storypku): cyber.aarch64 docker image
162
# TODO(storypku): tools/workspace.bzl to re-org WORKSPACE.in
163
# TODO(?): no break for cpu only build