Skip to content

Commit 770bb89

Browse files
authored
Benchmark refactor (#3074)
1 parent e812244 commit 770bb89

22 files changed

+402
-733
lines changed

.github/workflows/benchmark.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ jobs:
1717
benchmark:
1818
runs-on: ubuntu-latest
1919
env:
20+
GH_EVENT: ${{github.event_name}}
2021
GH_REF: ${{github.head_ref}}
2122
GH_REPO: ${{github.repository}}
22-
GH_EVENT: ${{github.event_name}}
23+
EXECUTION_ENV: github-action
2324
strategy:
2425
fail-fast: false
2526
matrix:
26-
ruby: [jruby-9.2, 2.6, 2.7, 3.2, 3.3]
27+
# Supported ruby versions (except 2.5 - benchmarks missing)
28+
ruby: [2.6, 2.7, '3.0', 3.1, 3.2, 3.3, jruby-9.3, jruby-9.4]
2729

2830
steps:
2931
- name: Setup Ruby
@@ -32,29 +34,31 @@ jobs:
3234
ruby-version: ${{ matrix.ruby }}
3335

3436
- uses: actions/checkout@v4
37+
with:
38+
submodules: recursive
3539

3640
- name: Install gems
3741
run: |
38-
bundle config set --local without 'docs repl development'
42+
bundle config set --local without 'development docs rbs repl'
3943
bundle install
4044
41-
- name: SDK Build
45+
- name: Build SDK
4246
run: bundle exec rake build
4347

44-
- name: Benchmark
48+
- name: Benchmark gems
4549
env:
4650
JRUBY_OPTS: -J-Xmx4g
47-
run: EXECUTION_ENV=github-action bundle exec rake benchmark
51+
run: bundle exec rake benchmark:run
4852

49-
- name: configure aws credentials
53+
- name: Configure AWS credentials
5054
uses: aws-actions/configure-aws-credentials@v4
5155
with:
52-
role-to-assume: arn:aws:iam::469596866844:role/aws-sdk-ruby-performance-reporter
53-
role-session-name: benchmark-report
54-
aws-region: us-west-2
56+
role-to-assume: arn:aws:iam::373952703873:role/BenchmarkReporter
57+
role-session-name: benchmark-reporter
58+
aws-region: us-east-1
5559

56-
- name: Archive benchmark report
57-
run: bundle exec rake benchmark:archive
60+
- name: Upload benchmark report
61+
run: bundle exec rake benchmark:upload-report
5862

59-
- name: Upload benchmark metrics
63+
- name: Put benchmark metrics
6064
run: bundle exec rake benchmark:put-metrics

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
sig:
16+
rbs-test:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
fail-fast: false
@@ -30,20 +30,21 @@ jobs:
3030

3131
- name: Install gems
3232
run: |
33-
bundle config set --local with 'build signature'
33+
bundle config set --local with 'build rbs'
3434
bundle install
3535
36-
- name: SDK Build
36+
- name: Build SDK
3737
run: bundle exec rake build
3838

39-
- name: rbs testing
39+
- name: RBS Test
4040
run: bundle exec rake rbs:test
4141

4242
test:
4343
runs-on: ubuntu-latest
4444
strategy:
4545
fail-fast: false
4646
matrix:
47+
# Supported ruby versions
4748
ruby: [2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, jruby-9.2, jruby-9.3, jruby-9.4]
4849
env: [KITCHEN_SINK, CRT]
4950

@@ -55,19 +56,19 @@ jobs:
5556

5657
- uses: actions/checkout@v4
5758

58-
- name: Setup environment
59+
- name: Setup ENV
5960
run: |
6061
echo "${{ matrix.env }}=1" >> $GITHUB_ENV
6162
6263
- name: Install gems
6364
run: |
64-
bundle config set --local without 'docs repl development'
65+
bundle config set --local with 'build test'
6566
bundle install
6667
67-
- name: SDK Build
68+
- name: Build SDK
6869
run: bundle exec rake build
6970

70-
- name: Tests
71+
- name: Test
7172
env:
7273
JRUBY_OPTS: -J-Xmx4g
7374
run: bundle exec rake test:spec

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/Gemfile.lock
88
/coverage
99
*.gem
10+
benchmark_report.json
1011

1112
/scratchpad
1213
.idea

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tasks/benchmark"]
2+
path = tasks/benchmark
3+
url = git@github.com:aws/aws-sdk-ruby-benchmark-tools.git

Gemfile

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,41 @@ gem 'rake', require: false
88
gem 'aws-crt' if ENV['CRT']
99
gem 'http-2'
1010
gem 'jmespath'
11+
if defined?(JRUBY_VERSION)
12+
# get the latest jruby-openssl to support sigv4a
13+
# see: https://github.com/jruby/jruby-openssl/issues/30
14+
gem 'jruby-openssl'
15+
end
1116

1217
# protocol parsers
1318
gem 'json'
1419
gem 'nokogiri', '>= 1.6.8.1'
1520
gem 'oga'
1621
gem 'rexml', '= 3.2.6' # Temporary Workaround (https://github.com/ruby/rexml/issues/131)
17-
1822
# These protocol parsers do not have java gems
1923
unless defined?(JRUBY_VERSION)
2024
gem 'libxml-ruby'
2125
gem 'oj'
2226
gem 'ox'
2327
end
2428

25-
if defined?(JRUBY_VERSION)
26-
# get the latest jruby-openssl to support sigv4a
27-
# see: https://github.com/jruby/jruby-openssl/issues/30
28-
gem 'jruby-openssl'
29-
end
30-
31-
group :test do
32-
gem 'addressable'
33-
gem 'cucumber'
34-
gem 'webmock'
29+
group :benchmark do
30+
gem 'memory_profiler'
3531

36-
gem 'multipart-post'
37-
gem 'rspec'
32+
# required for uploading report/putting metrics
33+
gem 'aws-sdk-cloudwatch'
34+
gem 'aws-sdk-s3'
3835
end
3936

4037
group :build do
4138
gem 'kramdown'
4239
gem 'mustache'
4340
end
4441

42+
group :development do
43+
gem 'rubocop', '1.28.0'
44+
end
45+
4546
group :docs do
4647
gem 'rdiscount', platforms: :ruby
4748
# When updating yard, override app.js from upstream to:
@@ -52,19 +53,19 @@ group :docs do
5253
gem 'yard-sitemap', '~> 1.0'
5354
end
5455

55-
group :repl do
56-
gem 'pry'
56+
group :rbs do
57+
gem 'rbs', platforms: :ruby
5758
end
5859

59-
group :development do
60-
gem 'rubocop', '1.28.0'
60+
group :repl do
61+
gem 'pry'
6162
end
6263

63-
group :benchmark do
64-
gem 'benchmark'
65-
gem 'memory_profiler'
66-
end
64+
group :test do
65+
gem 'addressable'
66+
gem 'cucumber'
67+
gem 'webmock'
6768

68-
group :signature do
69-
gem 'rbs', platforms: :ruby
69+
gem 'multipart-post'
70+
gem 'rspec'
7071
end

0 commit comments

Comments
 (0)