Skip to content

Commit

Permalink
Refactor benchmarking + fix related warnings and issues (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Jul 30, 2024
1 parent efd93ed commit c7c46fa
Show file tree
Hide file tree
Showing 30 changed files with 208 additions and 502 deletions.
40 changes: 25 additions & 15 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ env:
jobs:
benchmark:
runs-on: ubuntu-latest
env:
GH_EVENT: ${{github.event_name}}
GH_REF: ${{github.head_ref}}
GH_REPO: ${{github.repository}}
EXECUTION_ENV: github-action
strategy:
fail-fast: false
matrix:
ruby: ['3.0', 3.1, 3.2, 3.3]
# Supported ruby versions
ruby: [jruby-9.4, '3.0', 3.1, 3.2, 3.3]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Java
uses: actions/setup-java@v1
Expand All @@ -36,25 +44,27 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Install gems
run: |
bundle config set --local with 'benchmark'
bundle install
- name: Build SDK
run: bundle exec rake codegen:build

- name: Benchmark
run: EXECUTION_ENV=github-action bundle exec rake benchmark:run
- name: Benchmark gems
run: bundle exec rake benchmark:run

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::469596866844:role/aws-sdk-ruby-performance-reporter
role-session-name: benchmark-report
aws-region: us-west-2
role-to-assume: arn:aws:iam::373952703873:role/BenchmarkReporter
role-session-name: benchmark-reporter
aws-region: us-east-1

- name: Archive benchmark report
run: |
GH_REPO=${{github.repository}} GH_REF=${{github.head_ref}} GH_EVENT=${{github.event_name}} bundle exec rake benchmark:archive
- name: Upload benchmark report
run: bundle exec rake benchmark:upload-report

- name: Upload benchmark metrics
run: |
GH_REPO=${{github.repository}} GH_REF=${{github.head_ref}} GH_EVENT=${{github.event_name}} bundle exec rake benchmark:put-metrics
- name: Put benchmark metrics
run: bundle exec rake benchmark:put-metrics
26 changes: 18 additions & 8 deletions .github/workflows/codegen_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ env:
ruby_version: 3.3

jobs:

ruby-rbs-type-check:
whitelabel-rbs:
runs-on: ubuntu-latest

steps:
Expand All @@ -29,10 +28,12 @@ jobs:
with:
ruby-version: ${{ env.ruby_version }}

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install gems
run: bundle install
run: |
bundle config set --local with 'rbs test'
bundle install
- name: Build the SDK
run: bundle exec rake codegen:build
Expand All @@ -43,12 +44,13 @@ jobs:
- name: rbs:test
run: bundle exec rake rbs:white_label

ruby-specs:
codegen-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.0', 3.1, 3.2, 3.3]
# Supported ruby versions
ruby: [jruby-9.4, '3.0', 3.1, 3.2, 3.3]

steps:
- uses: actions/checkout@v4
Expand All @@ -57,13 +59,17 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: ${{ env.java_version }}

- name: Install gems
run: |
bundle config set --local with 'test'
bundle install
- name: Build SDK
run: bundle exec rake codegen:build

Expand All @@ -83,7 +89,11 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby_version }}
bundler-cache: true

- name: Install gems
run: |
bundle config set --local with 'development'
bundle install
- name: Rubocop
run: bundle exec rake rubocop:codegen
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/downstream_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ env:
ruby_version: 3.3

jobs:

aws-sdk-v4-tests:
aws-sdk-ruby-v4-tests:
runs-on: ubuntu-latest

steps:
Expand All @@ -30,9 +29,13 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby_version }}
bundler-cache: true

- name: publish smithy-ruby to maven local
- name: Install gems
run: |
bundle config set --local with 'test'
bundle install
- name: Publish smithy-ruby to mavenLocal
run: bundle exec rake codegen:publish-local

- name: v4 setup and build
Expand Down
49 changes: 31 additions & 18 deletions .github/workflows/hearth_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,53 @@ env:
ruby_version: 3.3

jobs:
rspec:
hearth-rbs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.0', 3.1, 3.2, 3.3]

steps:
- uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
ruby-version: ${{ env.ruby_version }}

- name: Unit tests
run: rake test:hearth
- name: Install gems
run: |
bundle config set --local with 'rbs test'
bundle install
- name: Steep
run: rake steep:hearth

- name: RBS
run: rake rbs:hearth

type-check:
hearth-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Supported ruby versions
ruby: [jruby-9.4, '3.0', 3.1, 3.2, 3.3]

steps:
- uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby_version }}
bundler-cache: true
ruby-version: ${{ matrix.ruby }}

- name: Steep Check
run: rake steep:hearth
- name: Install gems
run: |
bundle config set --local with 'test'
bundle install
- name: RBS Validate
run: rake rbs:hearth
- name: Test
run: rake test:hearth

rubocop:
hearth-rubocop:
runs-on: ubuntu-latest

steps:
Expand All @@ -60,7 +69,11 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby_version }}
bundler-cache: true

- name: Install gems
run: |
bundle config set --local with 'development'
bundle install
- name: Rubocop
run: rake rubocop:hearth
28 changes: 16 additions & 12 deletions .github/workflows/rails_codegen_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ env:
ruby_version: 3.3

jobs:
ruby-rbs-type-check:
railsjson-rbs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v1
with:
Expand All @@ -28,10 +30,10 @@ jobs:
with:
ruby-version: ${{ env.ruby_version }}

- uses: actions/checkout@v2

- name: Install gems
run: bundle install
run: |
bundle config set --local with 'rbs test'
bundle install
- name: Build SDK
run: bundle exec rake codegen:build
Expand All @@ -42,28 +44,30 @@ jobs:
- name: RBS Checks
run: bundle exec rake rbs:rails_json

ruby-specs:
railsjson-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.0', 3.1, 3.2, 3.3]
ruby: [jruby-9.4, '3.0', 3.1, 3.2, 3.3]

steps:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: ${{ env.java_version }}

- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Install gems
run: bundle install
run: |
bundle config set --local with 'test'
bundle install
- name: Build SDK
run: bundle exec rake codegen:build
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tasks/benchmark"]
path = tasks/benchmark
url = [email protected]:aws/aws-sdk-ruby-benchmark-tools.git
21 changes: 12 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@ gem 'jmespath'
gem 'rake', require: false
gem 'rexml'

group :benchmark do
gem 'memory_profiler'

# required for uploading archive/metrics
gem 'aws-sdk-cloudwatch'
gem 'aws-sdk-s3'
end

group :development do
gem 'byebug'
gem 'rbs'
gem 'byebug', platforms: :ruby
gem 'rubocop'
gem 'rubocop-rake'
gem 'steep'
end

group :docs do
gem 'yard'
end

group :benchmark do
gem 'memory_profiler'

# required for uploading archive/metrics
gem 'aws-sdk-cloudwatch'
gem 'aws-sdk-s3'
group :rbs do
gem 'rbs', platforms: :ruby
gem 'steep', platforms: :ruby
end

group :test do
Expand Down
3 changes: 3 additions & 0 deletions codegen/projections/rails_json/rails_json.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Gem::Specification.new do |spec|
spec.version = File.read(File.expand_path('VERSION', __dir__)).strip
spec.author = 'Amazon Web Services'
spec.summary = 'RailsJson Protocol Test Service'
spec.homepage = 'https://github.com/smithy-lang/smithy-ruby'
spec.files = Dir['lib/**/*.rb', 'VERSION']
spec.license = 'Apache-2.0'

spec.required_ruby_version = '>= 3.0'
spec.add_runtime_dependency 'hearth', '~> 1.0.0.pre3'
end
Loading

0 comments on commit c7c46fa

Please sign in to comment.