Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add s3-benchrunner-c for testing aws-c-s3 #2

Merged
merged 8 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions benchmarks/Test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
graebm marked this conversation as resolved.
Show resolved Hide resolved
"version": 1,
"comment": "Test benchmark",
"maxRepeatCount": 3,
"maxRepeatSecs": 10,
"checksum": "none",
"filesOnDisk": true,
"tasks": [
{"type": "download", "key": "1MiB/1", "size": "1MiB"}
]
}
1,010 changes: 1,010 additions & 0 deletions benchmarks/UploadMax.json

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions runners/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Benchmark Runners

A runner must be built for each library we want to test.
For example, [s3-benchrunner-c](s3-benchrunner-c/) tests the
[aws-c-s3](https://github.com/awslabs/aws-c-s3/) library.

# Running

All runners have the same command line interface:

`runner-cmd <benchmark.json> <bucket> <region> <target-throughput-Gbps>`

* `runner-cmd`: Command to launch runner (e.g. `java -jar target/s3-benchrunner.java`)
* `<benchmark.json>`: Path to benchmark JSON file (see: [benchmarks/](../benchmarks))
* `<bucket>`: S3 bucket name (e.g. "my-test-bucket")
* `<region>`: AWS Region (e.g. "us-west-2")
* `<target-throughput-Gbps>`: Target throughput, in gigabits per second. Floating point allowed. Enter the EC2 type's "Network Bandwidth (Gbps)" (e.g. "100.0" for [c5n.18xlarge](https://aws.amazon.com/ec2/instance-types/c5/))

Your machine must have AWS credentials for accessing the bucket.
Most runners should search for AWS credentials
[something like this](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#configure-precedence).
26 changes: 26 additions & 0 deletions runners/s3-benchrunner-c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.22)
cmake_policy(VERSION 3.22...3.24)
project(s3-benchrunner-c CXX)

add_executable(${PROJECT_NAME} benchrunner.cpp)

install(TARGETS ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_BINDIR})

set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20)

if(NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "-fno-exceptions;-fno-rtti")
endif()

# dependencies
include(FetchContent)

# using this JSON library because it's simple, and they documented how to integrate with CMake
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz)
FetchContent_MakeAvailable(json)

find_package(aws-c-s3 REQUIRED)
graebm marked this conversation as resolved.
Show resolved Hide resolved

target_link_libraries(${PROJECT_NAME} AWS::aws-c-s3 nlohmann_json)
graebm marked this conversation as resolved.
Show resolved Hide resolved
22 changes: 22 additions & 0 deletions runners/s3-benchrunner-c/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# s3-benchrunner-c

s3-benchrunner for [aws-c-s3](https://github.com/awslabs/aws-c-s3)

## Building

First, follow the build/install directions for [aws-c-s3](https://github.com/awslabs/aws-c-s3#building).

Build with `-DCMAKE_BUILD_TYPE=Release` for performance testing or `Debug` for debugging.

If you didn't install to a system directory, you'll need to set
`CMAKE_PREFIX_PATH=<s3-install-dir>` in the following steps:

```sh
cd aws-crt-s3-benchmarks/runners/s3-benchrunner-c
cmake -S . -B build -DCMAKE_PREFIX_PATH={aws-c-s3-install-dir} -DCMAKE_BUILD_TYPE={Release,RelWithDebInfo,Debug}
cmake --build build
```

## Running

See [instructions here](../README.md)
Loading