Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

73 lines
2.7 KiB
Python
Executable File

#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ===----------------------------------------------------------------------===##
import argparse
import logging
import pathlib
import subprocess
import sys
import tempfile
def main(argv):
parser = argparse.ArgumentParser(
prog='submit-benchmarks',
description='Submit a LNT JSON report to a LNT server.')
parser.add_argument('report', type=pathlib.Path,
help='Path to the LNT JSON report to submit.')
parser.add_argument('--lnt-url', type=str, required=True,
help='The URL of the LNT instance to submit results to.')
parser.add_argument('--test-suite', type=str, required=True,
help='The name of the test suite for reporting LNT results.')
parser.add_argument('--dry-run', action='store_true',
help='Do not actually perform any action. Use with -vv to see what would be executed.')
parser.add_argument('-v', '--verbose', action='count', default=0,
help='Verbosity level: passing the option multiple times increases the level.')
args = parser.parse_args(argv)
if args.verbose == 0:
logging.basicConfig(level=logging.INFO)
elif args.verbose >= 1:
logging.basicConfig(level=logging.DEBUG)
def run(command, **kwargs):
command = [str(c) for c in command]
logging.debug(f'$ {" ".join(command)}')
if args.dry_run:
return
try:
if not args.verbose:
if 'stdout' not in kwargs:
kwargs['stdout'] = subprocess.PIPE
if 'stderr' not in kwargs:
kwargs['stderr'] = subprocess.PIPE
subprocess.run(command, check=True, **kwargs)
except subprocess.CalledProcessError as e:
if e.stdout:
sys.stdout.write(e.stdout.decode())
if e.stderr:
sys.stderr.write(e.stderr.decode())
raise
with tempfile.TemporaryDirectory() as tmp:
tmp = pathlib.Path(tmp)
logging.info('Installing LNT')
run(['python3', '-m', 'venv', tmp / '.venv'])
run([tmp / '.venv/bin/pip', 'install', 'llvm-lnt'])
logging.info(f'Submitting results to {args.lnt_url}')
submission_url = f'{args.lnt_url}/db_default/v4/{args.test_suite}/submitRun'
run([tmp / '.venv/bin/lnt', 'submit', '--ignore-regressions', '--merge', 'append',
submission_url, args.report.resolve()])
if __name__ == '__main__':
main(sys.argv[1:])