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 3b80d97f7d.

* bump timeout
old-commit-hash: 1f37de1870
pull/32199/head
Justin Newberry 1 year ago committed by GitHub
parent 1f334fdf8a
commit 6a395a599b
  1. 10
      Jenkinsfile
  2. 6
      release/create_casync_agnos_release.py

10
Jenkinsfile vendored

@ -105,7 +105,7 @@ def pcStage(String stageName, Closure body) {
checkout scm 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) { def openpilot_base = retryWithDelay (3, 15) {
return docker.build("openpilot-base:build-${env.GIT_COMMIT}", "-f Dockerfile.openpilot_base .") 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) { lock(resource: "", label: 'pc', inversePrecedence: true, quantity: 1) {
openpilot_base.inside(dockerArgs) { openpilot_base.inside(dockerArgs) {
timeout(time: 20, unit: 'MINUTES') { timeout(time: 25, unit: 'MINUTES') {
try { try {
retryWithDelay (3, 15) { retryWithDelay (3, 15) {
sh "git config --global --add safe.directory '*'" 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"], ["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"], ["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"
}
} }
) )
} }

@ -3,6 +3,7 @@ import argparse
import json import json
import pathlib import pathlib
import tempfile import tempfile
import time
from openpilot.common.basedir import BASEDIR from openpilot.common.basedir import BASEDIR
from openpilot.system.hardware.tici.agnos import StreamingDecompressor, unsparsify, noop, AGNOS_MANIFEST_FILE from openpilot.system.hardware.tici.agnos import StreamingDecompressor, unsparsify, noop, AGNOS_MANIFEST_FILE
from openpilot.system.updated.casync.common import create_casync_from_file from openpilot.system.updated.casync.common import create_casync_from_file
@ -35,6 +36,7 @@ if __name__ == "__main__":
for entry in manifest: for entry in manifest:
print(f"creating casync agnos build from {entry}") print(f"creating casync agnos build from {entry}")
start = time.monotonic()
downloader = StreamingDecompressor(entry['url']) downloader = StreamingDecompressor(entry['url'])
parse_func = unsparsify if entry['sparse'] else noop parse_func = unsparsify if entry['sparse'] else noop
@ -48,4 +50,8 @@ if __name__ == "__main__":
for chunk in parsed_chunks: for chunk in parsed_chunks:
f.write(chunk) 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']}") create_casync_from_file(entry_path, output_dir, f"agnos-{args.version}-{entry['name']}")
print(f"created casnc in {time.monotonic() - start}")

Loading…
Cancel
Save