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@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 # v4.4.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: "feat/constellation" path: k-bench - name: Install patched K-Bench working-directory: "k-bench" run: ./install.sh shell: bash - name: Run K-Bench shell: bash working-directory: k-bench 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/" env: KUBECONFIG: ${{ inputs.kubeconfig }} - name: Merge K-Bench results working-directory: k-bench shell: bash 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 uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 if: ${{ !env.ACT }} 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 run: echo S3_PATH=s3://${ARTIFACT_BUCKET_CONSTELLATION}/benchmarks >> $GITHUB_ENV env: ARTIFACT_BUCKET_CONSTELLATION: "edgeless-artifact-store/constellation" - name: Get previous benchmark records from S3 shell: bash run: | mkdir -p benchmarks aws s3 cp --recursive ${S3_PATH} benchmarks --no-progress mv benchmarks/constellation-${CSP}.json benchmarks/constellation-${CSP}-previous.json env: KBENCH_RESULTS: ${{ github.workspace }}/k-bench/out/ CSP: ${{ inputs.cloudProvider }} - name: Parse K-Bench results, create diagrams and post the progression summary shell: bash 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 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 }} - name: Upload benchmark results and graphs to action run uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 if: ${{ !env.ACT }} with: path: | benchmarks/*_perf.png benchmarks/constellation-${{ inputs.cloudProvider }}.json name: "benchmarks" - name: Update benchmark records in S3 shell: bash run: | aws s3 cp benchmarks/constellation-${CSP}.json ${S3_PATH}/constellation-${CSP}.json env: CSP: ${{ inputs.cloudProvider }} if: github.ref == 'refs/heads/main'