From 5db14a1d2ee85770adda8e34208980dbe2873f59 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 29 Sep 2023 12:28:55 -0700 Subject: [PATCH] try to build some runners --- .github/workflows/ci.yml | 17 +++++++++++++++-- runners/s3-benchrunner-cli/benchrunner.py | 8 ++++---- scripts/lint-python.py | 6 ++---- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4cf9a475..cbd6f6da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI on: [push] jobs: - Lint-Python: + CI: runs-on: ubuntu-22.04 # latest at time of writing steps: - uses: actions/checkout@v4 @@ -9,4 +9,17 @@ jobs: with: python-version: '3.9' # default version on Amazon Linux 2023 - run: python -m pip install -r scripts/requirements.txt - - run: python scripts/lint-python.py + + - name: Lint Python scripts + run: python scripts/lint-python.py + + - name: Check that benchmark files are up to date + run: | + python scripts/build-benchmarks.py + git diff --exit-code + + - name: Build s3-benchrunner-c + run: python runners/s3-benchrunner-c/scripts/build.py + + - name: Build s3-benchrunner-crt-java + run: python runners/s3-benchrunner-crt-java/scripts/build.py diff --git a/runners/s3-benchrunner-cli/benchrunner.py b/runners/s3-benchrunner-cli/benchrunner.py index fd539a8f..da24e6e8 100755 --- a/runners/s3-benchrunner-cli/benchrunner.py +++ b/runners/s3-benchrunner-cli/benchrunner.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import argparse -import boto3 +import boto3 # type: ignore from dataclasses import dataclass import json import os @@ -10,7 +10,7 @@ import sys import tempfile import time -from typing import Optional +from typing import Optional, Tuple PARSER = argparse.ArgumentParser( description='Benchmark runner for AWS CLI') @@ -127,7 +127,7 @@ def _derive_cli_config(self) -> str: ''] # blank line at end of file return '\n'.join(lines) - def _derive_cli_cmd(self) -> (list[str], Optional[str]): + def _derive_cli_cmd(self) -> Tuple[list[str], Optional[bytes]]: """ Figures out single CLI command that will do everything in the benchmark. Exits with skip code if we can't do this benchmark in one CLI command. @@ -138,7 +138,7 @@ def _derive_cli_cmd(self) -> (list[str], Optional[str]): first_task = self.config.tasks[0] cmd = ['aws', 's3', 'cp'] - stdin = None + stdin: Optional[bytes] = None if num_tasks == 1: # doing 1 file is simple, just name the src and dst diff --git a/scripts/lint-python.py b/scripts/lint-python.py index f7a278c7..06b5e2b8 100755 --- a/scripts/lint-python.py +++ b/scripts/lint-python.py @@ -22,12 +22,10 @@ def get_script_dirs() -> list[str]: # add this scripts/ dir dirs.append(root.joinpath('scripts')) - # add each runner's scripts/ dir + # add each runner dir for runner_child in root.joinpath('runners').iterdir(): if runner_child.is_dir(): - runner_scripts = runner_child.joinpath('scripts') - if runner_scripts.is_dir(): - dirs.append(runner_scripts) + dirs.append(runner_child) return [str(i) for i in dirs]