Skip to content

Commit

Permalink
try to build some runners
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Sep 29, 2023
1 parent 6ddb8e9 commit 5db14a1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
name: CI
on: [push]
jobs:
Lint-Python:
CI:
runs-on: ubuntu-22.04 # latest at time of writing
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
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
8 changes: 4 additions & 4 deletions runners/s3-benchrunner-cli/benchrunner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
import argparse
import boto3
import boto3 # type: ignore
from dataclasses import dataclass
import json
import os
Expand All @@ -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')
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
6 changes: 2 additions & 4 deletions scripts/lint-python.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 5db14a1

Please sign in to comment.