Build release2 and dashcam in CI (#1834)

* start building release2 in CI

* build script

* bring over changes from test branch

* fix build release test

* remove references to test branches

* ucnomment push

* fix duplicate remove

* two commits for dashcam

* need the key
old-commit-hash: c715661656
commatwo_master
Adeeb Shihadeh 5 years ago committed by GitHub
parent d627c6f268
commit 44afc4ae3c
  1. 2
      .github/workflows/test.yaml
  2. 30
      Jenkinsfile
  3. 54
      release/build_release2.sh
  4. 5
      release/files_common
  5. 28
      selfdrive/test/id_rsa
  6. 4
      selfdrive/test/phone_ci.py
  7. 28
      tools/ssh/key/id_rsa
  8. 1
      tools/ssh/key/id_rsa

@ -39,7 +39,7 @@ jobs:
# need these so docker copy won't fail # need these so docker copy won't fail
cp Pipfile Pipfile.lock .pylintrc .coveragerc-app .pre-commit-config.yaml $TEST_DIR cp Pipfile Pipfile.lock .pylintrc .coveragerc-app .pre-commit-config.yaml $TEST_DIR
cd $TEST_DIR cd $TEST_DIR
mkdir laika laika_repo tools release mkdir laika laika_repo tools
- name: Build Docker image - name: Build Docker image
run: cd $TEST_DIR && eval "$BUILD" run: cd $TEST_DIR && eval "$BUILD"
- name: Build openpilot and run quick check - name: Build openpilot and run quick check

30
Jenkinsfile vendored

@ -7,14 +7,42 @@ pipeline {
} }
environment { environment {
COMMA_JWT = credentials('athena-test-jwt') COMMA_JWT = credentials('athena-test-jwt')
CI_PUSH = "${env.BRANCH_NAME == 'master' ? 'master-ci' : ''}"
} }
stages { stages {
stage('Release Build') {
when {
branch 'devel-staging'
}
steps {
lock(resource: "", label: 'eon', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
timeout(time: 60, unit: 'MINUTES') {
dir(path: 'selfdrive/test') {
sh 'pip install paramiko'
sh 'python phone_ci.py "cd release && PUSH=1 ./build_release2.sh"'
}
}
}
}
}
stage('On-device Tests') { stage('On-device Tests') {
when {
not {
anyOf {
branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'
}
}
}
parallel { parallel {
stage('Build') { stage('Build') {
environment {
CI_PUSH = "${env.BRANCH_NAME == 'master' ? 'master-ci' : ''}"
}
steps { steps {
lock(resource: "", label: 'eon', inversePrecedence: true, variable: 'eon_ip', quantity: 1){ lock(resource: "", label: 'eon', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
timeout(time: 30, unit: 'MINUTES') { timeout(time: 30, unit: 'MINUTES') {

@ -8,24 +8,32 @@ export GIT_AUTHOR_EMAIL="user@comma.ai"
export GIT_SSH_COMMAND="ssh -i /data/gitkey" export GIT_SSH_COMMAND="ssh -i /data/gitkey"
# Create folders # set CLEAN to build outside of CI
rm -rf /data/openpilot if [ ! -z "$CLEAN" ]; then
mkdir -p /data/openpilot # Create folders
cd /data/openpilot rm -rf /data/openpilot
mkdir -p /data/openpilot
# Create git repo cd /data/openpilot
git init
git remote add origin git@github.com:commaai/openpilot.git # Create git repo
git fetch origin devel git init
git remote add origin git@github.com:commaai/openpilot.git
git fetch origin devel-staging
else
cd /data/openpilot
git clean -xdf
git branch -D release2-staging || true
fi
git fetch origin release2-staging git fetch origin release2-staging
git fetch origin dashcam-staging git fetch origin dashcam-staging
# Checkout devel
#git checkout origin/devel
#git clean -xdf
# Create release2 with no history # Create release2 with no history
git checkout --orphan release2-staging origin/devel if [ ! -z "$CLEAN" ]; then
git checkout --orphan release2-staging origin/devel-staging
else
git checkout --orphan release2-staging
fi
VERSION=$(cat selfdrive/common/version.h | awk -F\" '{print $2}') VERSION=$(cat selfdrive/common/version.h | awk -F\" '{print $2}')
git commit -m "openpilot v$VERSION" git commit -m "openpilot v$VERSION"
@ -55,7 +63,7 @@ find . -name '*.o' -delete
find . -name '*.os' -delete find . -name '*.os' -delete
find . -name '*.pyc' -delete find . -name '*.pyc' -delete
find . -name '__pycache__' -delete find . -name '__pycache__' -delete
rm .sconsign.dblite rm -rf .sconsign.dblite Jenkinsfile release/
# Restore phonelibs # Restore phonelibs
git checkout phonelibs/ git checkout phonelibs/
@ -70,11 +78,15 @@ git commit --amend -m "openpilot v$VERSION"
# Print committed files that are normally gitignored # Print committed files that are normally gitignored
#git status --ignored #git status --ignored
# Push to release2-staging if [ ! -z "$PUSH" ]; then
git push -f origin release2-staging git remote set-url origin git@github.com:commaai/openpilot.git
# Push to release2-staging
git push -f origin release2-staging
# Create dashcam release # Create dashcam release
git rm selfdrive/car/*/carcontroller.py git rm selfdrive/car/*/carcontroller.py
git commit -m "create dashcam release from release2" git commit -m "create dashcam release from release2"
git push -f origin release2-staging:dashcam-staging git push -f origin release2-staging:dashcam-staging
fi

@ -58,6 +58,8 @@ common/api/__init__.py
models/supercombo.dlc models/supercombo.dlc
models/dmonitoring_model_q.dlc models/dmonitoring_model_q.dlc
release/build_release2.sh
selfdrive/version.py selfdrive/version.py
selfdrive/__init__.py selfdrive/__init__.py
@ -314,10 +316,11 @@ selfdrive/thermald/thermald.py
selfdrive/thermald/power_monitoring.py selfdrive/thermald/power_monitoring.py
selfdrive/test/__init__.py selfdrive/test/__init__.py
selfdrive/test/id_rsa
selfdrive/test/helpers.py selfdrive/test/helpers.py
selfdrive/test/phone_ci.py
selfdrive/test/test_openpilot.py selfdrive/test/test_openpilot.py
selfdrive/test/test_fingerprints.py selfdrive/test/test_fingerprints.py
selfdrive/test/test_car_models.py
selfdrive/test/test_cpu_usage.py selfdrive/test/test_cpu_usage.py
selfdrive/ui/SConscript selfdrive/ui/SConscript

@ -0,0 +1,28 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC+iXXq30Tq+J5N
Kat3KWHCzcmwZ55nGh6WggAqECa5CasBlM9VeROpVu3beA+5h0MibRgbD4DMtVXB
t6gEvZ8nd04E7eLA9LTZyFDZ7SkSOVj4oXOQsT0GnJmKrASW5KslTWqVzTfo2XCt
Z+004ikLxmyFeBO8NOcErW1pa8gFdQDToH9FrA7kgysic/XVESTOoe7XlzRoe/eZ
acEQ+jtnmFd21A4aEADkk00Ahj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wiAOb8GozSl
s5YD1E1iKwEULloHnK6BIh6P5v8q7J6uf/xdqoKMjlWBHgq6/roxKvkSPA1DOZ3l
jTadcgKFnRUmc+JT9p/ZbCxkA/ALFg8++G+0ghECgYA8vG3M/utweLvq4RI7l7U7
b+i2BajfK2OmzNi/xugfeLjY6k2tfQGRuv6ppTjehtji2uvgDWkgjJUgPfZpir3I
RsVMUiFgloWGHETOy0Qvc5AwtqTJFLTD1Wza2uBilSVIEsg6Y83Gickh+ejOmEsY
6co17RFaAZHwGfCFFjO76Q==
-----END RSA PRIVATE KEY-----

@ -19,7 +19,7 @@ def run_on_phone(test_cmd):
ssh = paramiko.SSHClient() ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
key_file = open(os.path.join(os.path.dirname(__file__), "../../tools/ssh/key/id_rsa")) key_file = open(os.path.join(os.path.dirname(__file__), "id_rsa"))
key = paramiko.RSAKey.from_private_key(key_file) key = paramiko.RSAKey.from_private_key(key_file)
print("SSH to phone at {}".format(eon_ip)) print("SSH to phone at {}".format(eon_ip))
@ -52,6 +52,8 @@ def run_on_phone(test_cmd):
conn.send(f"cd {SOURCE_DIR}\n") conn.send(f"cd {SOURCE_DIR}\n")
conn.send("git reset --hard\n") conn.send("git reset --hard\n")
conn.send("git fetch origin\n") conn.send("git fetch origin\n")
conn.send("find . -maxdepth 1 -not -path './.git' -not -name '.' -not -name '..' -exec rm -rf '{}' \\;\n")
conn.send(f"git reset --hard {commit}\n")
conn.send(f"git checkout {commit}\n") conn.send(f"git checkout {commit}\n")
conn.send("git clean -xdf\n") conn.send("git clean -xdf\n")
conn.send("git submodule update --init\n") conn.send("git submodule update --init\n")

@ -1,28 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC+iXXq30Tq+J5N
Kat3KWHCzcmwZ55nGh6WggAqECa5C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