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