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}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2021-01-24 10:34:18 +08:00
|
|
|
if [ -f /EON ]; then
|
2022-03-31 06:43:47 +08:00
|
|
|
# kill all old procs in the openpilot cpuset
|
|
|
|
while read p; do
|
|
|
|
kill "\$p" || true
|
|
|
|
done < /dev/cpuset/app/tasks
|
|
|
|
|
2021-01-24 10:34:18 +08:00
|
|
|
echo \$\$ > /dev/cpuset/app/tasks || true
|
2022-03-31 06:43:47 +08:00
|
|
|
|
2021-01-24 10:34:18 +08:00
|
|
|
mkdir -p /dev/shm
|
|
|
|
chmod 777 /dev/shm
|
|
|
|
fi
|
|
|
|
|
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) {
|
2021-11-16 09:34:16 +08:00
|
|
|
timeout(time: 60, 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 {
|
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/"
|
2020-02-12 11:26:34 +08:00
|
|
|
}
|
2020-10-16 01:14:50 +08:00
|
|
|
options {
|
2021-11-16 09:34:16 +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 {
|
2021-11-30 14:57:13 +08:00
|
|
|
stage('build releases') {
|
2020-08-09 11:59:32 +08:00
|
|
|
when {
|
|
|
|
branch 'devel-staging'
|
|
|
|
}
|
2021-07-29 13:19:30 +08:00
|
|
|
|
2021-11-30 14:57:13 +08:00
|
|
|
parallel {
|
|
|
|
stage('release2') {
|
2021-12-01 14:18:43 +08:00
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
2021-11-30 14:57:13 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("eon-build", [
|
|
|
|
["build release2-staging & dashcam-staging", "PUSH=1 $SOURCE_DIR/release/build_release.sh"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('release3') {
|
2021-12-01 14:18:43 +08:00
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
2021-11-30 14:57:13 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("tici", [
|
|
|
|
["build release3-staging & dashcam3-staging", "PUSH=1 $SOURCE_DIR/release/build_release.sh"],
|
|
|
|
])
|
|
|
|
}
|
2021-07-29 13:19:30 +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 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-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
|
|
|
|
2020-08-09 11:59:32 +08:00
|
|
|
stages {
|
2020-08-06 11:21:04 +08:00
|
|
|
stage('On-device Tests') {
|
2021-12-01 14:18:43 +08:00
|
|
|
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
|
2020-08-06 11:21:04 +08:00
|
|
|
stages {
|
2020-08-09 11:59:32 +08:00
|
|
|
stage('parallel tests') {
|
|
|
|
parallel {
|
2021-11-19 15:43:09 +08:00
|
|
|
stage('C2: build') {
|
2020-08-09 11:59:32 +08:00
|
|
|
steps {
|
2021-01-13 08:24:34 +08:00
|
|
|
phone_steps("eon-build", [
|
2021-11-19 15:43:09 +08:00
|
|
|
["build master-ci", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"],
|
2021-07-05 11:26:38 +08:00
|
|
|
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
2021-03-05 18:03:23 +08:00
|
|
|
["test manager", "python selfdrive/manager/test/test_manager.py"],
|
2021-01-17 10:11:53 +08:00
|
|
|
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
|
2020-08-09 11:59:32 +08:00
|
|
|
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
2020-08-06 11:21:04 +08:00
|
|
|
|
2021-11-19 15:43:09 +08:00
|
|
|
stage('C2: replay') {
|
2020-08-09 11:59:32 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("eon2", [
|
2021-05-29 14:08:08 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
|
2020-08-09 11:59:32 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
2020-08-06 11:21:04 +08:00
|
|
|
|
2021-11-19 15:43:09 +08:00
|
|
|
stage('C2: HW + Unit Tests') {
|
2020-08-09 11:59:32 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("eon", [
|
2021-05-25 10:52:54 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2021-10-26 00:44:04 +08:00
|
|
|
["test sounds", "python selfdrive/ui/tests/test_soundd.py"],
|
|
|
|
["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"],
|
2021-01-25 09:54:03 +08:00
|
|
|
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
|
|
|
|
["test encoder", "python selfdrive/loggerd/tests/test_encoder.py"],
|
2021-02-02 07:15:29 +08:00
|
|
|
["test logcatd", "python selfdrive/logcatd/tests/test_logcatd_android.py"],
|
2021-09-11 08:03:54 +08:00
|
|
|
["test updater", "python selfdrive/hardware/eon/test_neos_updater.py"],
|
2020-08-09 11:59:32 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
2020-08-06 11:21:04 +08:00
|
|
|
|
2021-04-14 06:08:00 +08:00
|
|
|
/*
|
|
|
|
stage('Power Consumption Tests') {
|
|
|
|
steps {
|
|
|
|
lock(resource: "", label: "c2-zookeeper", inversePrecedence: true, variable: 'device_ip', quantity: 1) {
|
2021-05-04 12:53:28 +08:00
|
|
|
timeout(time: 90, unit: 'MINUTES') {
|
2021-04-14 06:08:00 +08:00
|
|
|
sh script: "/home/batman/tools/zookeeper/enable_and_wait.py $device_ip 120", label: "turn on device"
|
|
|
|
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
|
2021-06-02 08:12:32 +08:00
|
|
|
phone(device_ip, "build", "scons -j4 && sync")
|
2021-04-14 06:08:00 +08:00
|
|
|
sh script: "/home/batman/tools/zookeeper/disable.py $device_ip", label: "turn off device"
|
|
|
|
sh script: "/home/batman/tools/zookeeper/enable_and_wait.py $device_ip 120", label: "turn on device"
|
|
|
|
sh script: "/home/batman/tools/zookeeper/check_consumption.py 60 3", label: "idle power consumption after boot"
|
|
|
|
sh script: "/home/batman/tools/zookeeper/ignition.py 1", label: "go onroad"
|
|
|
|
sh script: "/home/batman/tools/zookeeper/check_consumption.py 60 10", label: "onroad power consumption"
|
|
|
|
sh script: "/home/batman/tools/zookeeper/ignition.py 0", label: "go offroad"
|
|
|
|
sh script: "/home/batman/tools/zookeeper/check_consumption.py 60 2", label: "idle power consumption offroad"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2021-11-19 15:43:09 +08:00
|
|
|
stage('C3: build') {
|
2021-02-01 10:49:34 +08:00
|
|
|
environment {
|
|
|
|
R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}"
|
|
|
|
}
|
2021-01-24 10:34:18 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("tici", [
|
2021-11-19 15:43:09 +08:00
|
|
|
["build master-ci", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"],
|
|
|
|
["build openpilot", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["test manager", "python selfdrive/manager/test/test_manager.py"],
|
2021-04-12 06:56:17 +08:00
|
|
|
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
|
2021-11-19 15:43:09 +08:00
|
|
|
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
|
2021-01-24 10:34:18 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-19 15:43:09 +08:00
|
|
|
stage('C3: HW + Unit Tests') {
|
2021-07-03 07:29:57 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("tici2", [
|
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2021-11-06 05:31:13 +08:00
|
|
|
["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"],
|
2021-07-03 07:29:57 +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"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-19 15:43:09 +08:00
|
|
|
stage('C2: camerad') {
|
2021-10-23 14:21:40 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("eon-party", [
|
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["test camerad", "python selfdrive/camerad/test/test_camerad.py"],
|
|
|
|
["test exposure", "python selfdrive/camerad/test/test_exposure.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-19 15:43:09 +08:00
|
|
|
stage('C3: camerad') {
|
2021-04-01 07:48:10 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("tici-party", [
|
2021-05-25 10:52:54 +08:00
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
2021-04-01 07:48:10 +08:00
|
|
|
["test camerad", "python selfdrive/camerad/test/test_camerad.py"],
|
2021-05-19 03:07:48 +08:00
|
|
|
["test exposure", "python selfdrive/camerad/test/test_exposure.py"],
|
2021-04-01 07:48:10 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-25 07:59:19 +08:00
|
|
|
stage('C3: replay') {
|
|
|
|
steps {
|
|
|
|
phone_steps("tici-party", [
|
|
|
|
["build", "cd selfdrive/manager && ./build.py"],
|
|
|
|
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-06 11:21:04 +08:00
|
|
|
}
|
|
|
|
}
|
2021-04-12 06:05:14 +08:00
|
|
|
|
|
|
|
stage('Push master-ci') {
|
|
|
|
when {
|
|
|
|
branch 'master'
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
phone_steps("eon-build", [
|
2021-07-05 11:26:38 +08:00
|
|
|
["push devel", "cd $SOURCE_DIR/release && PUSH='master-ci' ./build_devel.sh"],
|
2021-04-12 06:05:14 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-06 08:56:24 +08:00
|
|
|
}
|
2020-09-30 13:14:54 +08:00
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
cleanWs()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-06 08:56:24 +08:00
|
|
|
}
|
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-01-24 10:34:18 +08:00
|
|
|
|