2020-07-25 17:12:19 +08:00
|
|
|
def phone(String ip, String step_label, String cmd) {
|
2021-03-24 08:46:53 +08:00
|
|
|
withCredentials([file(credentialsId: 'id_rsa', variable: 'key_file')]) {
|
2021-01-24 10:34:18 +08:00
|
|
|
def ssh_cmd = """
|
2021-12-05 13:07:57 +08:00
|
|
|
ssh -tt -o StrictHostKeyChecking=no -i ${key_file} 'comma@${ip}' /usr/bin/bash <<'END'
|
2021-01-24 10:34:18 +08:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
export CI=1
|
|
|
|
export TEST_DIR=${env.TEST_DIR}
|
2021-07-05 11:26:38 +08:00
|
|
|
export SOURCE_DIR=${env.SOURCE_DIR}
|
2021-01-24 10:34:18 +08:00
|
|
|
export GIT_BRANCH=${env.GIT_BRANCH}
|
|
|
|
export GIT_COMMIT=${env.GIT_COMMIT}
|
2022-06-21 07:24:51 +08:00
|
|
|
export AZURE_TOKEN='${env.AZURE_TOKEN}'
|
2022-12-08 11:36:30 +08:00
|
|
|
export MAPBOX_TOKEN='${env.MAPBOX_TOKEN}'
|
2021-01-24 10:34:18 +08:00
|
|
|
|
2023-02-06 07:45:01 +08:00
|
|
|
export GIT_SSH_COMMAND="ssh -i /data/gitkey"
|
|
|
|
|
2021-01-24 10:34:18 +08:00
|
|
|
source ~/.bash_profile
|
2021-03-27 04:23:18 +08:00
|
|
|
if [ -f /TICI ]; then
|
|
|
|
source /etc/profile
|
2023-07-22 09:35:29 +08:00
|
|
|
|
|
|
|
if ! systemctl is-active --quiet systemd-resolved; then
|
|
|
|
echo "restarting resolved"
|
|
|
|
sudo systemctl start systemd-resolved
|
|
|
|
sleep 3
|
|
|
|
fi
|
2021-03-27 04:23:18 +08:00
|
|
|
fi
|
2023-05-08 06:43:45 +08:00
|
|
|
if [ -f /data/openpilot/launch_env.sh ]; then
|
2023-05-04 05:26:38 +08:00
|
|
|
source /data/openpilot/launch_env.sh
|
|
|
|
fi
|
|
|
|
|
2021-02-01 10:49:34 +08:00
|
|
|
ln -snf ${env.TEST_DIR} /data/pythonpath
|
|
|
|
|
2020-07-25 17:12:19 +08:00
|
|
|
cd ${env.TEST_DIR} || true
|
|
|
|
${cmd}
|
|
|
|
exit 0
|
2021-01-24 10:34:18 +08:00
|
|
|
|
2021-12-05 13:07:57 +08:00
|
|
|
END"""
|
2021-01-24 10:34:18 +08:00
|
|
|
|
|
|
|
sh script: ssh_cmd, label: step_label
|
2020-07-25 17:12:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def phone_steps(String device_type, steps) {
|
|
|
|
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
|
2022-04-29 13:02:32 +08:00
|
|
|
timeout(time: 20, unit: 'MINUTES') {
|
2020-07-25 17:12:19 +08:00
|
|
|
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
|
|
|
|
steps.each { item ->
|
|
|
|
phone(device_ip, item[0], item[1])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
pipeline {
|
2021-12-01 14:18:43 +08:00
|
|
|
agent none
|
2020-02-12 11:26:34 +08:00
|
|
|
environment {
|
2022-06-12 06:32:12 +08:00
|
|
|
CI = "1"
|
2020-07-25 17:12:19 +08:00
|
|
|
TEST_DIR = "/data/openpilot"
|
2021-07-05 11:26:38 +08:00
|
|
|
SOURCE_DIR = "/data/openpilot_source/"
|
2022-06-21 07:24:51 +08:00
|
|
|
AZURE_TOKEN = credentials('azure_token')
|
2022-12-08 11:36:30 +08:00
|
|
|
MAPBOX_TOKEN = credentials('mapbox_token')
|
2020-02-12 11:26:34 +08:00
|
|
|
}
|
2020-10-16 01:14:50 +08:00
|
|
|
options {
|
2022-12-08 14:21:05 +08:00
|
|
|
timeout(time: 3, unit: 'HOURS')
|
|
|
|
disableConcurrentBuilds(abortPrevious: env.BRANCH_NAME != 'master')
|
2020-10-16 01:14:50 +08:00
|
|
|
}
|
2020-07-04 10:12:05 +08:00
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
stages {
|
2023-02-06 07:45:01 +08:00
|
|
|
stage('build release3-staging') {
|
2022-04-19 08:55:23 +08:00
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
2020-08-09 11:59:32 +08:00
|
|
|
when {
|
|
|
|
branch 'devel-staging'
|
|
|
|
}
|
2022-04-19 08:55:23 +08:00
|
|
|
steps {
|
2022-11-16 12:14:35 +08:00
|
|
|
phone_steps("tici-needs-can", [
|
2023-02-06 07:45:01 +08:00
|
|
|
["build release3-staging & dashcam3-staging", "RELEASE_BRANCH=release3-staging DASHCAM_BRANCH=dashcam3-staging $SOURCE_DIR/release/build_release.sh"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('build nightly') {
|
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
when {
|
|
|
|
branch 'master-ci'
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
phone_steps("tici-needs-can", [
|
|
|
|
["build nightly", "RELEASE_BRANCH=nightly $SOURCE_DIR/release/build_release.sh"],
|
2022-04-19 08:55:23 +08:00
|
|
|
])
|
2020-08-09 11:59:32 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-06 11:21:04 +08:00
|
|
|
stage('openpilot tests') {
|
2020-07-08 05:17:09 +08:00
|
|
|
when {
|
|
|
|
not {
|
|
|
|
anyOf {
|
2021-07-29 13:19:30 +08:00
|
|
|
branch 'master-ci'; branch 'devel'; branch 'devel-staging';
|
|
|
|
branch 'release3'; branch 'release3-staging'; branch 'dashcam3'; branch 'dashcam3-staging';
|
|
|
|
branch 'testing-closet*'; branch 'hotfix-*'
|
2020-07-08 05:17:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-04 10:12:05 +08:00
|
|
|
|
2022-06-12 06:32:12 +08:00
|
|
|
parallel {
|
|
|
|
|
2023-01-23 07:08:36 +08:00
|
|
|
/*
|
2022-06-12 06:32:12 +08:00
|
|
|
stage('simulator') {
|
|
|
|
agent {
|
|
|
|
dockerfile {
|
|
|
|
filename 'Dockerfile.sim_nvidia'
|
|
|
|
dir 'tools/sim'
|
|
|
|
args '--user=root'
|
2020-08-06 11:21:04 +08:00
|
|
|
}
|
2020-07-06 08:56:24 +08:00
|
|
|
}
|
2022-06-12 06:32:12 +08:00
|
|
|
steps {
|
2023-01-11 08:20:27 +08:00
|
|
|
sh "git config --global --add safe.directory '*'"
|
|
|
|
sh "git submodule update --init --recursive"
|
2022-06-12 06:32:12 +08:00
|
|
|
sh "git lfs pull"
|
2022-06-13 12:59:58 +08:00
|
|
|
lock(resource: "", label: "simulator", inversePrecedence: true, quantity: 1) {
|
2022-06-19 10:01:42 +08:00
|
|
|
sh "${WORKSPACE}/tools/sim/build_container.sh"
|
2022-06-13 12:59:58 +08:00
|
|
|
sh "DETACH=1 ${WORKSPACE}/tools/sim/start_carla.sh"
|
|
|
|
sh "${WORKSPACE}/tools/sim/start_openpilot_docker.sh"
|
|
|
|
}
|
2022-06-12 06:32:12 +08:00
|
|
|
}
|
2020-09-30 13:14:54 +08:00
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
2022-06-12 06:32:12 +08:00
|
|
|
sh "docker kill carla_sim || true"
|
|
|
|
sh "rm -rf ${WORKSPACE}/* || true"
|
|
|
|
sh "rm -rf .* || true"
|
2020-09-30 13:14:54 +08:00
|
|
|
}
|
|
|
|
}
|
2022-06-12 06:32:12 +08:00
|
|
|
}
|
2023-01-23 07:08:36 +08:00
|
|
|
*/
|
2020-09-30 13:14:54 +08:00
|
|
|
|
2023-07-22 12:57:27 +08:00
|
|
|
stage('scons build test') {
|
|
|
|
agent {
|
|
|
|
dockerfile {
|
|
|
|
filename 'Dockerfile.openpilot_base'
|
|
|
|
args '--user=root'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh "git config --global --add safe.directory '*'"
|
|
|
|
sh "git submodule update --init --depth=1 --recursive"
|
|
|
|
sh "scons --clean && scons --no-cache -j42"
|
|
|
|
sh "scons --clean && scons --no-cache --random -j42"
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
sh "rm -rf ${WORKSPACE}/* || true"
|
|
|
|
sh "rm -rf .* || true"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-06 02:07:42 +08:00
|
|
|
stage('tizi-tests') {
|
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
steps {
|
|
|
|
phone_steps("tizi", [
|
|
|
|
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["test boardd loopback", "SINGLE_PANDA=1 python selfdrive/boardd/tests/test_boardd_loopback.py"],
|
|
|
|
["test pandad", "python selfdrive/boardd/tests/test_pandad.py"],
|
|
|
|
["test sensord", "cd system/sensord/tests && python -m unittest test_sensord.py"],
|
|
|
|
["test camerad", "python system/camerad/test/test_camerad.py"],
|
|
|
|
["test exposure", "python system/camerad/test/test_exposure.py"],
|
2023-04-07 14:38:16 +08:00
|
|
|
["test amp", "python system/hardware/tici/tests/test_amplifier.py"],
|
2023-06-25 11:04:58 +08:00
|
|
|
["test rawgpsd", "python system/sensord/rawgps/test_rawgps.py"],
|
2023-04-06 02:07:42 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-12 06:32:12 +08:00
|
|
|
stage('build') {
|
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
environment {
|
|
|
|
R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}"
|
|
|
|
}
|
|
|
|
steps {
|
2022-11-12 13:50:09 +08:00
|
|
|
phone_steps("tici-needs-can", [
|
2022-06-12 06:32:12 +08:00
|
|
|
["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR EXTRA_FILES='tools/' ./build_devel.sh"],
|
|
|
|
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
2022-07-09 04:00:43 +08:00
|
|
|
["check dirty", "release/check-dirty.sh"],
|
2022-06-12 06:32:12 +08:00
|
|
|
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
|
2023-05-22 15:48:51 +08:00
|
|
|
["time to onroad", "cd selfdrive/test/ && pytest test_time_to_onroad.py"],
|
2022-06-12 06:32:12 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-12 13:50:09 +08:00
|
|
|
stage('loopback-tests') {
|
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
steps {
|
|
|
|
phone_steps("tici-loopback", [
|
|
|
|
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-12 06:32:12 +08:00
|
|
|
stage('HW + Unit Tests') {
|
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
steps {
|
2022-11-12 13:50:09 +08:00
|
|
|
phone_steps("tici-common", [
|
2022-06-12 06:32:12 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2023-06-06 06:28:38 +08:00
|
|
|
["test pandad", "python selfdrive/boardd/tests/test_pandad.py"],
|
2023-04-06 13:17:57 +08:00
|
|
|
["test power draw", "python system/hardware/tici/tests/test_power_draw.py"],
|
2023-03-09 03:20:49 +08:00
|
|
|
["test loggerd", "python system/loggerd/tests/test_loggerd.py"],
|
|
|
|
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python system/loggerd/tests/test_encoder.py"],
|
2023-03-09 02:56:54 +08:00
|
|
|
["test pigeond", "python system/sensord/tests/test_pigeond.py"],
|
2022-12-02 07:32:59 +08:00
|
|
|
["test manager", "python selfdrive/manager/test/test_manager.py"],
|
2023-07-17 05:39:34 +08:00
|
|
|
["test nav", "pytest selfdrive/navd/tests/"],
|
2022-06-12 06:32:12 +08:00
|
|
|
])
|
|
|
|
}
|
2020-07-06 08:56:24 +08:00
|
|
|
}
|
|
|
|
|
2023-05-04 07:52:20 +08:00
|
|
|
stage('camerad') {
|
2022-06-12 06:32:12 +08:00
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
steps {
|
2023-01-18 11:52:06 +08:00
|
|
|
phone_steps("tici-ar0231", [
|
2022-11-05 07:44:06 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["test camerad", "python system/camerad/test/test_camerad.py"],
|
|
|
|
["test exposure", "python system/camerad/test/test_exposure.py"],
|
|
|
|
])
|
|
|
|
phone_steps("tici-ox03c10", [
|
2022-06-12 06:32:12 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2022-06-20 05:43:49 +08:00
|
|
|
["test camerad", "python system/camerad/test/test_camerad.py"],
|
|
|
|
["test exposure", "python system/camerad/test/test_exposure.py"],
|
2022-06-12 06:32:12 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-12 13:50:09 +08:00
|
|
|
stage('sensord') {
|
2022-11-03 07:34:02 +08:00
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
steps {
|
|
|
|
phone_steps("tici-lsmc", [
|
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2023-03-09 02:56:54 +08:00
|
|
|
["test sensord", "cd system/sensord/tests && python -m unittest test_sensord.py"],
|
2022-11-03 07:34:02 +08:00
|
|
|
])
|
2022-11-12 13:50:09 +08:00
|
|
|
phone_steps("tici-bmx-lsm", [
|
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2023-03-09 02:56:54 +08:00
|
|
|
["test sensord", "cd system/sensord/tests && python -m unittest test_sensord.py"],
|
2022-11-12 13:50:09 +08:00
|
|
|
])
|
2022-11-03 07:34:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-12 06:32:12 +08:00
|
|
|
stage('replay') {
|
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
steps {
|
2023-06-23 05:21:11 +08:00
|
|
|
phone_steps("tici-replay", [
|
2022-06-12 06:32:12 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2023-05-31 11:33:01 +08:00
|
|
|
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
|
2022-06-12 06:32:12 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-12 13:50:09 +08:00
|
|
|
}
|
2020-01-31 05:06:45 +08:00
|
|
|
}
|
2022-11-12 13:50:09 +08:00
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
}
|
|
|
|
}
|