mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-18 12:24:32 -05:00
4f1a4ecb9e
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
133 lines
5.6 KiB
YAML
133 lines
5.6 KiB
YAML
name: k-bench
|
|
description: "Run K-Bench"
|
|
|
|
inputs:
|
|
cloudProvider:
|
|
description: "Which cloud provider to use."
|
|
required: true
|
|
kubeconfig:
|
|
description: "The kubeconfig of the cluster to test."
|
|
required: true
|
|
|
|
runs:
|
|
using: "composite"
|
|
|
|
steps:
|
|
- name: Setup python
|
|
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install evaluation dependencies
|
|
shell: bash
|
|
run: pip install --require-hashes -r .github/actions/e2e_kbench/evaluate/requirements.txt
|
|
|
|
- name: Checkout patched K-Bench
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
|
with:
|
|
fetch-depth: 0
|
|
repository: "edgelesssys/k-bench"
|
|
ref: 836693d3136e5531b07f4ffd21cd6f4b47f7f2f1
|
|
path: k-bench
|
|
|
|
- name: Install patched K-Bench
|
|
working-directory: k-bench
|
|
shell: bash
|
|
run: |
|
|
go install github.com/kubernetes/kompose@c4137012e3d00051de45afacccf288e12b21d8e7
|
|
go install github.com/edgelesssys/k-bench/cmd/kbench@836693d3136e5531b07f4ffd21cd6f4b47f7f2f1
|
|
|
|
- name: Run K-Bench
|
|
shell: bash
|
|
working-directory: k-bench
|
|
env:
|
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
run: |
|
|
mkdir -p ./out
|
|
kubectl create namespace kbench-pod-namespace --dry-run=client -o yaml | kubectl apply -f -
|
|
kubectl apply -f ../.github/actions/e2e_kbench/encrypted_storage.yml
|
|
./run.sh -r "kbench-constellation-${{ inputs.cloudProvider }}" -t "default" -o "./out/"
|
|
kubectl delete namespace kbench-pod-namespace --wait=true || true
|
|
kubectl create namespace kbench-pod-namespace --dry-run=client -o yaml | kubectl apply -f -
|
|
kubectl apply -f ../.github/actions/e2e_kbench/encrypted_storage.yml
|
|
./run.sh -r "kbench-constellation-${{ inputs.cloudProvider }}" -t "dp_fio" -o "./out/"
|
|
kubectl delete namespace kbench-pod-namespace --wait=true || true
|
|
kubectl create namespace kbench-pod-namespace --dry-run=client -o yaml | kubectl apply -f -
|
|
kubectl apply -f ../.github/actions/e2e_kbench/encrypted_storage.yml
|
|
./run.sh -r "kbench-constellation-${{ inputs.cloudProvider }}" -t "dp_network_internode" -o "./out/"
|
|
kubectl delete namespace kbench-pod-namespace --wait=true || true
|
|
kubectl create namespace kbench-pod-namespace --dry-run=client -o yaml | kubectl apply -f -
|
|
kubectl apply -f ../.github/actions/e2e_kbench/encrypted_storage.yml
|
|
./run.sh -r "kbench-constellation-${{ inputs.cloudProvider }}" -t "dp_network_intranode" -o "./out/"
|
|
|
|
- name: Merge K-Bench results
|
|
shell: bash
|
|
working-directory: k-bench
|
|
run: |
|
|
mkdir -p "./out/kbench-constellation-${{ inputs.cloudProvider }}"
|
|
mv ./out/results_kbench-constellation-${{ inputs.cloudProvider }}_*m/* "./out/kbench-constellation-${{ inputs.cloudProvider }}/"
|
|
ls -l "./out/kbench-constellation-${{ inputs.cloudProvider }}"
|
|
cat ./out/kbench-constellation-${{ inputs.cloudProvider }}/*/kbench.log
|
|
|
|
- name: Upload original benchmark results
|
|
if: (!env.ACT)
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
|
with:
|
|
path: "k-bench/out/kbench-constellation-${{ inputs.cloudProvider }}"
|
|
name: "k-bench-constellation-${{ inputs.cloudProvider }}"
|
|
|
|
- name: Assume AWS role to retrieve and update benchmarks in S3
|
|
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # tag=v1.7.0
|
|
with:
|
|
role-to-assume: arn:aws:iam::795746500882:role/GithubActionUpdateBenchmarks
|
|
aws-region: us-east-2
|
|
|
|
- name: Set S3 artifact store
|
|
shell: bash
|
|
env:
|
|
ARTIFACT_BUCKET_CONSTELLATION: "edgeless-artifact-store/constellation"
|
|
run: echo S3_PATH=s3://${ARTIFACT_BUCKET_CONSTELLATION}/benchmarks >> $GITHUB_ENV
|
|
|
|
- name: Get previous benchmark records from S3
|
|
shell: bash
|
|
env:
|
|
KBENCH_RESULTS: ${{ github.workspace }}/k-bench/out/
|
|
CSP: ${{ inputs.cloudProvider }}
|
|
run: |
|
|
mkdir -p benchmarks
|
|
aws s3 cp --recursive ${S3_PATH} benchmarks --no-progress
|
|
mv benchmarks/constellation-${CSP}.json benchmarks/constellation-${CSP}-previous.json
|
|
|
|
- name: Parse K-Bench results, create diagrams and post the progression summary
|
|
shell: bash
|
|
env:
|
|
# Original K-Bench result directory
|
|
KBENCH_RESULTS: k-bench/out/
|
|
# Working directory containing the previous results as JSON and to contain the graphs
|
|
BDIR: benchmarks
|
|
# Paths to benchmark results as JSON of the previous run and the current run
|
|
PREV_BENCH: benchmarks/constellation-${{ inputs.cloudProvider }}-previous.json
|
|
CURR_BENCH: benchmarks/constellation-${{ inputs.cloudProvider }}.json
|
|
CSP: ${{ inputs.cloudProvider }}
|
|
run: |
|
|
python .github/actions/e2e_kbench/evaluate/parse.py
|
|
python .github/actions/e2e_kbench/evaluate/graph.py
|
|
python .github/actions/e2e_kbench/evaluate/compare.py >> $GITHUB_STEP_SUMMARY
|
|
|
|
- name: Upload benchmark results and graphs to action run
|
|
if: (!env.ACT)
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
|
with:
|
|
path: |
|
|
benchmarks/*_perf.png
|
|
benchmarks/constellation-${{ inputs.cloudProvider }}.json
|
|
name: "benchmarks"
|
|
|
|
- name: Update benchmark records in S3
|
|
if: github.ref == 'refs/heads/main'
|
|
shell: bash
|
|
env:
|
|
CSP: ${{ inputs.cloudProvider }}
|
|
run: |
|
|
aws s3 cp benchmarks/constellation-${CSP}.json ${S3_PATH}/constellation-${CSP}.json
|