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@13ae5bb136fac2878aff31522b9efb785519f984 # tag=v4.3.0 with: python-version: "3.10" - name: Install evaluation dependencies shell: bash run: pip install -r .github/actions/k-bench/evaluate/requirements.txt - name: Checkout patched K-Bench uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.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: Install Constellation CSI drivers and create storage class uses: ./.github/actions/install_csi_drivers with: kubeconfig: ${{ inputs.kubeconfig }} cloudProvider: ${{ inputs.cloudProvider }} - 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/k-bench/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/k-bench/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/k-bench/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/k-bench/encrypted_storage.yml ./run.sh -r "kbench-constellation-${{ inputs.cloudProvider }}" -t "dp_network_intranode" -o "./out/" env: KUBECONFIG: ${{ inputs.kubeconfig }} - name: Delete namespace and PVCs shell: bash run: | ELAPSED=0 kubectl delete namespace kbench-pod-namespace --wait=true || true echo "::group::Wait for PV deletion" until [ "$(kubectl get pv -o json | jq '.items | length')" == "0" ] || [ $ELAPSED -gt $PV_DELETION_TIMEOUT ]; do echo $(kubectl get pv -o json | jq '.items | length') PV remaining.. sleep 1 ELAPSED=$((ELAPSED+1)) done if [ $ELAPSED -gt $PV_DELETION_TIMEOUT ]; then echo "Timed out waiting for PV deletion.." exit 1 fi echo "::endgroup::" env: KUBECONFIG: ${{ inputs.kubeconfig }} PV_DELETION_TIMEOUT: "120" # 2 minutes timeout for pv deletion - 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@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3.1.1 if: ${{ !env.ACT }} with: path: "k-bench/out/kbench-constellation-${{ inputs.cloudProvider }}" name: "k-bench-constellation-${{ inputs.cloudProvider }}" - name: Parse test results and create diagrams shell: bash run: python .github/actions/k-bench/evaluate/main.py env: KBENCH_RESULTS: ${{ github.workspace }}/k-bench/out/ CSP: ${{ inputs.cloudProvider }} - name: Upload benchmark results uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # tag=v3.1.1 if: ${{ !env.ACT }} with: path: | *_perf.png kbench_results.json name: "benchmark_results"