Merge pull request #62 from amazon-contributing/git-actions-oicd #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DSQL BenchBase Integ Test | |
on: | |
push: | |
branches: [ dsql ] | |
# Generate new docker images on release tags. | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ dsql ] | |
# Give us a button to allow running the workflow on demand for testing. | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Manual Workflow Run' | |
required: false | |
type: string | |
env: | |
POM_VERSION: 2023-SNAPSHOT | |
JAVA_VERSION: 21 | |
ERRORS_THRESHOLD: 0.01 | |
jobs: | |
compile: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{env.JAVA_VERSION}} | |
cache: 'maven' | |
distribution: 'temurin' | |
- name: Check formatting | |
run: mvn -B fmt:check --file pom.xml | |
- name: Compile with Maven | |
run: mvn -B compile test-compile --file pom.xml | |
# Don't need testing, its done in maven.yml | |
# - name: Test exec plugin | |
# run: | | |
# mvn exec:java -P sqlite -Dexec.args="-b noop -c config/sqlite/sample_noop_config.xml --create=true --load=true --execute=true" | |
# - name: Test with Maven | |
# run: mvn -B test --file pom.xml | |
package-and-upload: | |
needs: compile | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
profile: [ 'auroradsql' ] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{env.JAVA_VERSION}} | |
cache: 'maven' | |
distribution: 'temurin' | |
- name: Package and verify with Maven | |
run: | | |
mvn -B package verify -P ${{matrix.profile}} --file pom.xml -DskipTests -D descriptors=src/main/assembly/tgz.xml | |
- name: Upload TGZ artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: benchbase-${{matrix.profile}} | |
path: target/benchbase-${{matrix.profile}}.tgz | |
## ---------------------------------------------------------------------------------- | |
## AURORA DSQL | |
## ---------------------------------------------------------------------------------- | |
auroradsql: | |
needs: package-and-upload | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
benchmark: [ 'tpcc' ] | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: benchbase-auroradsql | |
- name: Extract artifact | |
run: | | |
tar xvzf benchbase-auroradsql.tgz --strip-components=1 | |
- name: Delete artifact | |
run: | | |
rm -rf benchbase-auroradsql.tgz | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{env.JAVA_VERSION}} | |
distribution: 'temurin' | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.IAM_ROLE }} | |
aws-region: us-east-1 | |
- name: Configure Benchmark | |
uses: Mudlet/xmlstarlet-action@master | |
with: | |
args: ed --inplace -u "//parameters/scalefactor" -v "1" -u "//parameters/terminals" -v "1" -u "//parameters/works/work/time" -v "60" -u "//parameters/works/work/warmup" -v "0" config/auroradsql/sample_${{matrix.benchmark}}_config.xml | |
- name: Run benchmark | |
run: | | |
sed -i 's/localhost:5432/${{ secrets.CLUSTER_ENDPOINT }}:5432/g' config/auroradsql/sample_${{matrix.benchmark}}_config.xml | |
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/auroradsql/sample_${{matrix.benchmark}}_config.xml -im 1000 -mt advanced --create=true --load=true --execute=true --json-histograms results/histograms.json | |
# FIXME: Reduce the error rate so we don't need these overrides. | |
results_benchmark=${{matrix.benchmark}} | |
./scripts/check_latest_benchmark_results.sh $results_benchmark | |
./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD | |
# Running the monitor should create at least three files in the 'monitor' directory. | |
if ![ $(find "./results/monitor" -maxdepth 1 -mindepth 1 | wc -l) -gt 2]; then | |
echo "ERROR: Advanced monitoring unsuccessful, file directory and/or appropriate files not created." >&2 | |
exit 1 | |
fi |