Skip to content

Commit

Permalink
jenkins: publish casync agnos alongside builds (commaai#32177)
Browse files Browse the repository at this point in the history
* publish agnos

* test it

* more logging and fix

* remove this for a quick test

* time logging

* revert that

* space

* Revert "test it"

This reverts commit 3b80d97.

* bump timeout
  • Loading branch information
jnewb1 authored Apr 12, 2024
1 parent ee9d12a commit 1f37de1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ def pcStage(String stageName, Closure body) {

checkout scm

def dockerArgs = "--user=batman -v /tmp/comma_download_cache:/tmp/comma_download_cache -v /tmp/scons_cache:/tmp/scons_cache -e PYTHONPATH=${env.WORKSPACE} --cpus=8 --memory 16g -e PYTEST_ADDOPTS='-n8'";
def dockerArgs = "--user=batman -v /tmp/comma_download_cache:/tmp/comma_download_cache -v /tmp/scons_cache:/tmp/scons_cache -e PYTHONPATH=${env.WORKSPACE} -e AZURE_TOKEN_OPENPILOT_RELEASES='${env.AZURE_TOKEN_OPENPILOT_RELEASES}' --cpus=8 --memory 16g -e PYTEST_ADDOPTS='-n8'";

def openpilot_base = retryWithDelay (3, 15) {
return docker.build("openpilot-base:build-${env.GIT_COMMIT}", "-f Dockerfile.openpilot_base .")
}

lock(resource: "", label: 'pc', inversePrecedence: true, quantity: 1) {
openpilot_base.inside(dockerArgs) {
timeout(time: 20, unit: 'MINUTES') {
timeout(time: 25, unit: 'MINUTES') {
try {
retryWithDelay (3, 15) {
sh "git config --global --add safe.directory '*'"
Expand Down Expand Up @@ -158,6 +158,12 @@ def build_release(String channel_name) {
["create manifest", "$SOURCE_DIR/release/create_release_manifest.py /data/openpilot /data/manifest.json && cat /data/manifest.json"],
["upload and cleanup ${channel_name}", "PYTHONWARNINGS=ignore $SOURCE_DIR/release/upload_casync_release.py /data/casync && rm -rf /data/casync"],
])
},
"publish agnos": {
pcStage("publish agnos") {
sh "release/create_casync_agnos_release.py /tmp/casync/agnos /tmp/casync_tmp"
sh "PYTHONWARNINGS=ignore ${env.WORKSPACE}/release/upload_casync_release.py /tmp/casync"
}
}
)
}
Expand Down
6 changes: 6 additions & 0 deletions release/create_casync_agnos_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import pathlib
import tempfile
import time
from openpilot.common.basedir import BASEDIR
from openpilot.system.hardware.tici.agnos import StreamingDecompressor, unsparsify, noop, AGNOS_MANIFEST_FILE
from openpilot.system.updated.casync.common import create_casync_from_file
Expand Down Expand Up @@ -35,6 +36,7 @@

for entry in manifest:
print(f"creating casync agnos build from {entry}")
start = time.monotonic()
downloader = StreamingDecompressor(entry['url'])

parse_func = unsparsify if entry['sparse'] else noop
Expand All @@ -48,4 +50,8 @@
for chunk in parsed_chunks:
f.write(chunk)

print(f"downloaded in {time.monotonic() - start}")

start = time.monotonic()
create_casync_from_file(entry_path, output_dir, f"agnos-{args.version}-{entry['name']}")
print(f"created casnc in {time.monotonic() - start}")

0 comments on commit 1f37de1

Please sign in to comment.