  
      docker.image('ghcr.io/commaai/alpine-ssh').inside('--user=root') {
        lock(resource: "", label: deviceType, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
          timeout(time: 20, unit: 'MINUTES') {
            device(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
            steps.each { item ->
              device(device_ip, item[0], item[1])
            }
          }
        }
 
</s> remove     def dockerArgs = '--user=root -v /tmp/comma_download_cache:/tmp/comma_download_cache';
 </s> add     def dockerArgs = '--user=root -v /tmp/comma_download_cache:/tmp/comma_download_cache -v /tmp/scons_cache:/tmp/scons_cache'; </s> remove def deviceStage(String stageName, String deviceType, def steps) {
 </s> add def deviceStage(String stageName, String deviceType, List env, def steps) { </s> remove     stage('git checkout') {
      checkout scm
    }

 </s> add  </s> remove           sh "scons --clean && scons --no-cache --random -j42"

          // car tests
          sh "INTERNAL_SEG_CNT=500 INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt FILEREADER_CACHE=1 \
 </s> add           sh label: "test multi-threaded build", script: "scons --no-cache --random -j42"
        }
      },
      'car tests': {
        pcStage("car tests") {
          sh "scons -j30"
          sh label: "test_models.py", script: "INTERNAL_SEG_CNT=250 INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt FILEREADER_CACHE=1 \
          device(device_ip, "git checkout", extra + "\n" + readFile("selfdrive/test/setup_device_ci.sh"))
  
      docker.image('ghcr.io/commaai/alpine-ssh').inside('--user=root') {
        lock(resource: "", label: deviceType, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
          timeout(time: 20, unit: 'MINUTES') {
          device(device_ip, "git checkout", extra + "\n" + readFile("selfdrive/test/setup_device_ci.sh"))
            steps.each { item ->
              device(device_ip, item[0], item[1])
            }
          }
        }
keep keep keep keep replace keep keep keep keep keep
 jenkins speedup (#29869)

* jenkins speedup

* cleanup 
Jenkinsfile