Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e922c73
perf-testing wip
andimarek May 29, 2021
d8d6f9b
perf-testing wip
andimarek May 29, 2021
98433b6
perf-testing wip
andimarek May 29, 2021
5fa2c01
perf-testing wip
andimarek May 29, 2021
2fed57b
perf-testing wip
andimarek May 30, 2021
339cc5e
perf-testing wip
andimarek May 30, 2021
f0b70df
perf-testing wip
andimarek May 30, 2021
db22150
perf-testing wip
andimarek May 30, 2021
d5ad048
wip 1
andimarek May 30, 2021
0274a77
wip 2
andimarek May 30, 2021
59abbc8
wip 2
andimarek May 30, 2021
05ff5da
wip 2
andimarek May 30, 2021
cb150d1
wip 2
andimarek May 30, 2021
c63842e
wip 2
andimarek May 30, 2021
660983b
wip 2
andimarek May 30, 2021
12ce8d1
wip 2
andimarek May 30, 2021
1d1c6e1
wip 2
andimarek May 30, 2021
217c575
wip 2
andimarek May 30, 2021
f09a554
wip 3
andimarek May 30, 2021
ab7833e
wip 3
andimarek May 30, 2021
0264c00
wip 3
andimarek May 30, 2021
868a9eb
wip 3
andimarek May 30, 2021
0ef9da4
wip 3
andimarek May 30, 2021
31ac3fe
wip 3
andimarek May 30, 2021
3bea7fd
increase timeout
andimarek May 30, 2021
a0fa347
print jmh results
andimarek May 31, 2021
f4dcb48
wait, install aws sdk
andimarek May 31, 2021
3fae0be
Merge remote-tracking branch 'origin/perf-testing' into perf-testing
andimarek May 31, 2021
f429ff2
copy results to s3
andimarek Jun 1, 2021
ebbf936
copy results to s3
andimarek Jun 1, 2021
c4b0a70
copy results to s3
andimarek Jun 1, 2021
9e1f39b
fix sha
andimarek Jun 1, 2021
3bdf19e
check performance result work
andimarek Jun 1, 2021
0bb8a5f
limit tests for now
andimarek Jun 1, 2021
deb1bfa
check results
andimarek Jun 2, 2021
bce2a00
check results
andimarek Jun 2, 2021
bbad45c
check results
andimarek Jun 2, 2021
77a7ec0
check results
andimarek Jun 2, 2021
bf4a960
check results
andimarek Jun 2, 2021
0985c54
check results
andimarek Jun 2, 2021
a7cd397
run all JMH test
andimarek Jun 2, 2021
336de0a
wip
andimarek Jun 3, 2021
16ee1ec
fail process if `run` fails
andimarek Jun 3, 2021
36d344a
error handling
andimarek Jun 3, 2021
40f5bb9
error handling
andimarek Jun 3, 2021
04c4943
error handling
andimarek Jun 3, 2021
3e6c3e0
just ignore unknown benchmark mode
andimarek Jun 3, 2021
3eed416
handle multiple results per hash
andimarek Jun 4, 2021
22b53c7
test GH action trigger
kocabas Jan 24, 2022
645ef77
trigger GH action
kocabas Jan 24, 2022
14ffed8
Update performance.yml
kocabas Jan 27, 2022
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
84 changes: 84 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Performance tests
on:
push:
branches:
- master
- perf-testing

jobs:
performance_tests:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CDK_DEFAULT_ACCOUNT: ${{ secrets.CDK_DEFAULT_ACCOUNT }}
CDK_DEFAULT_REGION: us-west-2
AWS_REGION: us-west-2
defaults:
run:
working-directory: ./perf-cdk
steps:
- uses: actions/checkout@v1
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: '8.0.282'
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: build jmh jar
run: RELEASE_VERSION="jmh" ./gradlew clean jmhJar
working-directory: ./
- run: npm install -g aws-cdk
- run: npm install -g typescript
- run: npm i
- id: cdk_deploy
run: |
cdk deploy --require-approval never -O deploy-output.json
echo "::set-output name=host_ip::$(jq -r .PerfCdkStack.simpleinstance1output deploy-output.json)"
- run: echo ${{ steps.cdk_deploy.outputs.host_ip }}
- name: Wait for ssh ready
run: timeout 30 sh -c 'until nc -z $0 $1; do sleep 0.1; done' ${{ steps.cdk_deploy.outputs.host_ip }} 22
- run: ls -l build/libs/graphql-java-jmh.jar
working-directory: ./
- name: Copy jar
uses: appleboy/scp-action@master
with:
host: ${{ steps.cdk_deploy.outputs.host_ip }}
username: ec2-user
key: ${{ secrets.EC2_USER_KEY }}
port: 22
source: "build/libs/graphql-java-jmh.jar"
target: "~"
strip_components: 2
- name: Run JMH
uses: appleboy/ssh-action@master
with:
host: ${{ steps.cdk_deploy.outputs.host_ip }}
username: ec2-user
key: ${{ secrets.EC2_USER_KEY }}
port: 22
command_timeout: 240m
script: |
pwd
ls -l
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
curl -s "https://get.sdkman.io" | bash
source "/home/ec2-user/.sdkman/bin/sdkman-init.sh"
sdk install java 11.0.11.hs-adpt
java -version
java -jar graphql-java-jmh.jar -rf json
ls -l
cat jmh-result.json
aws s3 cp jmh-result.json s3://graphql-java-perf-tests-dev/jmh-results/jmh-${{ github.sha }}-jdk11-$(date --iso-8601=seconds).json
- name: Check results
run: npm run check-perf-results
env:
CURRENT_SHA: ${{ github.sha}}
- run: cdk destroy -f
if: always()


3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ docs/_build/
\.settings/
/.nb-gradle/
gen
.DS_Store
.DS_Store
/jmh-result.json
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
id "com.github.johnrengelman.shadow" version "6.1.0"
id "biz.aQute.bnd.builder" version "5.1.2"
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
id "me.champeau.jmh" version "0.6.5"
}


Expand Down Expand Up @@ -82,6 +83,8 @@ dependencies {
api 'org.reactivestreams:reactive-streams:' + reactiveStreamsVersion
antlr "org.antlr:antlr4:4.8"
implementation 'com.google.guava:guava:30.0-jre'
jmh 'org.antlr:antlr4-runtime:4.8'
jmh 'org.slf4j:slf4j-api:' + slf4jVersion
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5'
testImplementation('org.codehaus.groovy:groovy:2.5.13')
Expand All @@ -99,8 +102,11 @@ dependencies {

testImplementation 'org.testng:testng:6.1.1' // use for reactive streams test inheritance

testImplementation 'org.openjdk.jmh:jmh-core:1.25'
testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.25'
testImplementation 'org.openjdk.jmh:jmh-core:1.28'
testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.28'
}

jmhJar {
}

shadowJar {
Expand Down Expand Up @@ -290,7 +296,7 @@ tasks.withType(PublishToMavenRepository) {


task myWrapper(type: Wrapper) {
gradleVersion = '6.6.1'
gradleVersion = '6.8.3'
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 11 additions & 0 deletions perf-cdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.js
!jest.config.js
*.d.ts
node_modules

# CDK asset staging directory
.cdk.staging
cdk.out
cdk.context.json
deploy-output.json
output.json
6 changes: 6 additions & 0 deletions perf-cdk/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.ts
!*.d.ts

# CDK asset staging directory
.cdk.staging
cdk.out
14 changes: 14 additions & 0 deletions perf-cdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Welcome to your CDK TypeScript project!

This is a blank project for TypeScript development with CDK.

The `cdk.json` file tells the CDK Toolkit how to execute your app.

## Useful commands

* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests
* `cdk deploy` deploy this stack to your default AWS account/region
* `cdk diff` compare deployed stack with current state
* `cdk synth` emits the synthesized CloudFormation template
21 changes: 21 additions & 0 deletions perf-cdk/bin/perf-cdk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from '@aws-cdk/core';
import {PerfCdkStack} from '../lib/perf-cdk-stack';

const app = new cdk.App();
new PerfCdkStack(app, 'PerfCdkStack', {
/* If you don't specify 'env', this stack will be environment-agnostic.
* Account/Region-dependent features and context lookups will not work,
* but a single synthesized template can be deployed anywhere. */

/* Uncomment the next line to specialize this stack for the AWS Account
* and Region that are implied by the current CLI configuration. */
env: {account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION},

/* Uncomment the next line if you know exactly what Account and Region you
* want to deploy the stack to. */
// env: { account: '123456789012', region: 'us-east-1' },

/* For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html */
});
17 changes: 17 additions & 0 deletions perf-cdk/cdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"app": "npx ts-node --prefer-ts-exts bin/perf-cdk.ts",
"context": {
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
"@aws-cdk/core:enableStackNameDuplicates": "true",
"aws-cdk:enableDiffNoFail": "true",
"@aws-cdk/core:stackRelativeExports": "true",
"@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true,
"@aws-cdk/aws-secretsmanager:parseOwnedSecretName": true,
"@aws-cdk/aws-kms:defaultKeyPolicies": true,
"@aws-cdk/aws-s3:grantWriteWithoutAcl": true,
"@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount": true,
"@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
"@aws-cdk/aws-efs:defaultEncryptionAtRest": true,
"@aws-cdk/aws-lambda:recognizeVersionProps": true
}
}
8 changes: 8 additions & 0 deletions perf-cdk/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest'
}
};
Loading