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}'
|
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
|
|
|
|
fi
|
2021-01-24 10:34:18 +08:00
|
|
|
|
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')
|
2020-02-12 11:26:34 +08:00
|
|
|
}
|
2020-10-16 01:14:50 +08:00
|
|
|
options {
|
2022-04-29 13:02:32 +08:00
|
|
|
timeout(time: 4, unit: 'HOURS')
|
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 {
|
2022-04-19 08:55:23 +08:00
|
|
|
stage('build release3') {
|
|
|
|
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", [
|
2022-04-19 08:55:23 +08:00
|
|
|
["build release3-staging & dashcam3-staging", "PUSH=1 $SOURCE_DIR/release/build_release.sh"],
|
|
|
|
])
|
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 {
|
|
|
|
|
|
|
|
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 {
|
|
|
|
sh "git config --global --add safe.directory ${WORKSPACE}"
|
|
|
|
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
|
|
|
}
|
2020-09-30 13:14:54 +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"],
|
|
|
|
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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"],
|
2022-10-07 06:01:57 +08:00
|
|
|
["test power draw", "python system/hardware/tici/test_power_draw.py"],
|
2022-06-12 06:32:12 +08:00
|
|
|
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
|
|
|
|
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"],
|
2022-09-01 14:12:26 +08:00
|
|
|
["test pigeond", "python selfdrive/sensord/tests/test_pigeond.py"],
|
2022-12-02 07:32:59 +08:00
|
|
|
["test manager", "python selfdrive/manager/test/test_manager.py"],
|
2022-06-12 06:32:12 +08:00
|
|
|
])
|
|
|
|
}
|
2020-07-06 08:56:24 +08:00
|
|
|
}
|
|
|
|
|
2022-11-05 07:44:06 +08:00
|
|
|
stage('camerad-ar') {
|
2022-06-12 06:32:12 +08:00
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
steps {
|
2022-11-05 07:44:06 +08:00
|
|
|
phone_steps("tici-ar0321", [
|
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["test camerad", "python system/camerad/test/test_camerad.py"],
|
|
|
|
["test exposure", "python system/camerad/test/test_exposure.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('camerad-ox') {
|
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
|
|
|
steps {
|
|
|
|
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"],
|
|
|
|
["test sensord", "cd selfdrive/sensord/tests && python -m unittest test_sensord.py"],
|
|
|
|
])
|
2022-11-12 13:50:09 +08:00
|
|
|
phone_steps("tici-bmx-lsm", [
|
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["test sensord", "cd selfdrive/sensord/tests && python -m unittest test_sensord.py"],
|
|
|
|
])
|
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 {
|
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"],
|
|
|
|
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|