2020-07-25 17:12:19 +08:00
|
|
|
def phone(String ip, String step_label, String cmd) {
|
|
|
|
def ci_env = "CI=1 TEST_DIR=${env.TEST_DIR} GIT_BRANCH=${env.GIT_BRANCH} GIT_COMMIT=${env.GIT_COMMIT}"
|
|
|
|
|
|
|
|
withCredentials([file(credentialsId: 'id_rsa_public', variable: 'key_file')]) {
|
|
|
|
sh label: step_label,
|
|
|
|
script: """
|
|
|
|
ssh -tt -o StrictHostKeyChecking=no -i ${key_file} -p 8022 root@${ip} '${ci_env} /usr/bin/bash -le' <<'EOF'
|
|
|
|
echo \$\$ > /dev/cpuset/app/tasks || true
|
|
|
|
echo \$PPID > /dev/cpuset/app/tasks || true
|
|
|
|
mkdir -p /dev/shm
|
|
|
|
chmod 777 /dev/shm
|
|
|
|
cd ${env.TEST_DIR} || true
|
|
|
|
${cmd}
|
|
|
|
exit 0
|
|
|
|
EOF"""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def phone_steps(String device_type, steps) {
|
|
|
|
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
|
|
|
|
timeout(time: 60, unit: 'MINUTES') {
|
|
|
|
phone(device_ip, "kill old processes", "pkill -f comma || true")
|
|
|
|
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 {
|
2020-08-06 11:21:04 +08:00
|
|
|
agent none
|
2020-02-12 11:26:34 +08:00
|
|
|
environment {
|
|
|
|
COMMA_JWT = credentials('athena-test-jwt')
|
2020-07-25 17:12:19 +08:00
|
|
|
TEST_DIR = "/data/openpilot"
|
2020-02-12 11:26:34 +08:00
|
|
|
}
|
2020-07-04 10:12:05 +08:00
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
stages {
|
2020-08-09 11:59:32 +08:00
|
|
|
|
|
|
|
stage('Release Build') {
|
2020-08-13 03:47:32 +08:00
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'python:3.7.3'
|
|
|
|
args '--user=root'
|
|
|
|
}
|
|
|
|
}
|
2020-08-09 11:59:32 +08:00
|
|
|
when {
|
|
|
|
branch 'devel-staging'
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
phone_steps("eon-build", [
|
|
|
|
["build release2-staging and dashcam-staging", "cd release && PUSH=1 ./build_release2.sh"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-06 11:21:04 +08:00
|
|
|
stage('openpilot tests') {
|
2020-07-08 05:17:09 +08:00
|
|
|
when {
|
|
|
|
not {
|
|
|
|
anyOf {
|
2020-08-09 11:59:32 +08:00
|
|
|
branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'
|
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('PC tests') {
|
|
|
|
agent {
|
|
|
|
dockerfile {
|
2020-08-24 09:18:19 +08:00
|
|
|
filename 'Dockerfile.openpilotci'
|
2020-08-06 11:21:04 +08:00
|
|
|
args '--privileged --shm-size=1G --user=root'
|
|
|
|
}
|
2020-07-08 05:17:09 +08:00
|
|
|
}
|
2020-08-06 11:21:04 +08:00
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
sh 'scons -j$(nproc)'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
// fix permissions since docker runs as another user
|
|
|
|
sh "chmod -R 777 ."
|
|
|
|
}
|
2020-06-05 09:57:25 +08:00
|
|
|
}
|
|
|
|
}
|
2020-08-09 11:59:32 +08:00
|
|
|
*/
|
2020-07-04 10:12:05 +08:00
|
|
|
|
2020-08-06 11:21:04 +08:00
|
|
|
stage('On-device Tests') {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'python:3.7.3'
|
|
|
|
args '--user=root'
|
|
|
|
}
|
2020-01-31 05:06:45 +08:00
|
|
|
}
|
2020-08-09 11:59:32 +08:00
|
|
|
|
2020-08-06 11:21:04 +08:00
|
|
|
stages {
|
2020-08-09 11:59:32 +08:00
|
|
|
stage('parallel tests') {
|
|
|
|
parallel {
|
2020-08-06 11:21:04 +08:00
|
|
|
|
2020-08-09 11:59:32 +08:00
|
|
|
stage('Devel Build') {
|
|
|
|
environment {
|
|
|
|
CI_PUSH = "${env.BRANCH_NAME == 'master' ? 'master-ci' : ' '}"
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
phone_steps("eon", [
|
|
|
|
["build devel", "cd release && CI_PUSH=${env.CI_PUSH} ./build_devel.sh"],
|
|
|
|
["test openpilot", "nosetests -s selfdrive/test/test_openpilot.py"],
|
|
|
|
["test cpu usage", "cd selfdrive/test/ && ./test_cpu_usage.py"],
|
|
|
|
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
|
2020-08-11 12:52:26 +08:00
|
|
|
["test spinner build", "cd selfdrive/ui/spinner && make clean && make"],
|
|
|
|
["test text window build", "cd selfdrive/ui/text && make clean && make"],
|
2020-08-09 11:59:32 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
2020-08-06 11:21:04 +08:00
|
|
|
|
2020-08-09 11:59:32 +08:00
|
|
|
stage('Replay Tests') {
|
|
|
|
steps {
|
|
|
|
phone_steps("eon2", [
|
|
|
|
["camerad/modeld replay", "cd selfdrive/test/process_replay && ./camera_replay.py"],
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
2020-08-06 11:21:04 +08:00
|
|
|
|
2020-08-13 02:39:21 +08:00
|
|
|
stage('HW + Unit Tests') {
|
2020-08-09 11:59:32 +08:00
|
|
|
steps {
|
|
|
|
phone_steps("eon", [
|
|
|
|
["build cereal", "SCONS_CACHE=1 scons -j4 cereal/"],
|
|
|
|
["test sounds", "nosetests -s selfdrive/test/test_sounds.py"],
|
|
|
|
["test boardd loopback", "nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"],
|
2020-08-13 02:39:21 +08:00
|
|
|
//["test updater", "python installer/updater/test_updater.py"],
|
2020-08-09 11:59:32 +08:00
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
2020-08-06 11:21:04 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2020-07-06 08:56:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-31 05:06:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|