From 1f37de1870f127cd8c1c9943b026fe952fd34b8d Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Thu, 11 Apr 2024 17:51:26 -0700 Subject: [PATCH] jenkins: publish casync agnos alongside builds (#32177) * 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 3b80d97f7d436bc5b2cc29caf6bff1671f7f3f71. * bump timeout --- Jenkinsfile | 10 ++++++++-- release/create_casync_agnos_release.py | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 660755046e4ff8..418404071affd6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ 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 .") @@ -113,7 +113,7 @@ def pcStage(String stageName, Closure body) { 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 '*'" @@ -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" + } } ) } diff --git a/release/create_casync_agnos_release.py b/release/create_casync_agnos_release.py index 60934b8c18810a..513ff02abf1ac4 100755 --- a/release/create_casync_agnos_release.py +++ b/release/create_casync_agnos_release.py @@ -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 @@ -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 @@ -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}")