Skip to content

Commit

Permalink
test: run load test nightly (#1434)
Browse files Browse the repository at this point in the history
## Description

Workflow config to run the Pepr Load Tests nightly.

## Related Issue

Relates to #1431

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging
- [x] Unit,
[Journey](https://github.com/defenseunicorns/pepr/tree/main/journey),
[E2E Tests](https://github.com/defenseunicorns/pepr-excellent-examples),
[docs](https://github.com/defenseunicorns/pepr/tree/main/docs),
[adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or
updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed
  • Loading branch information
btlghrants authored Nov 18, 2024
1 parent 18854ca commit f4aa736
Showing 1 changed file with 145 additions and 0 deletions.
145 changes: 145 additions & 0 deletions .github/workflows/load.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Pepr Load Test

permissions: read-all
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *' # 1AM EST/10PM PST

jobs:
load:
name: load test
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: "install k3d"
run: "curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash"
shell: bash

- name: clone pepr
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: defenseunicorns/pepr
path: pepr

- name: "set env: PEPR"
run: echo "PEPR=${GITHUB_WORKSPACE}/pepr" >> "$GITHUB_ENV"

- name: clone pepr-excellent-examples
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: defenseunicorns/pepr-excellent-examples
path: pepr-excellent-examples

- name: "set env: PEXEX"
run: echo "PEXEX=${GITHUB_WORKSPACE}/pepr-excellent-examples" >> "$GITHUB_ENV"

- name: setup node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20
cache: "npm"
cache-dependency-path: pepr

- name: "load.cli.ts prep"
run: |
cd "$PEPR"
npx ts-node hack/load.cli.ts prep ./
- name: upload pepr package artifact (.tgz)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: tgz
path: pepr-0.0.0-development.tgz
if-no-files-found: error
retention-days: 1

- name: upload pepr controller image artifact (.tar)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: tar
path: pepr-dev.tar
if-no-files-found: error
retention-days: 1

- name: "load.cli.ts cluster up"
run: |
cd "$PEPR"
npx ts-node hack/load.cli.ts cluster up
- name: "load.cli.ts deploy"
run: |
cd "$PEPR"
npx ts-node hack/load.cli.ts deploy \
./pepr-0.0.0-development.tgz \
./pepr-dev.tar \
${PEXEX}/hello-pepr-load
- name: "load.cli.ts run"
run: |
cd "$PEPR"
npx ts-node hack/load.cli.ts run \
${PEXEX}/hello-pepr-load \
capabilities/configmap.yaml
- name: upload raw test inject log (actress)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: actress.log
path: load/*-actress.log
if-no-files-found: error
retention-days: 1

- name: upload raw test sample log (audience)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: audience.log
path: load/*-audience.log
if-no-files-found: error
retention-days: 1

- name: "load.cli.ts post"
run: |
cd "$PEPR"
npx ts-node hack/load.cli.ts post
- name: upload parsed inject log (actress)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: actress.json
path: load/*-actress.json
if-no-files-found: error
retention-days: 1

- name: upload parsed sample log (audience)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: audience.json
path: load/*-audience.json
if-no-files-found: error
retention-days: 1

- name: upload load test summary
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: summary.json
path: load/*-summary.json
if-no-files-found: error
retention-days: 1

- name: "load.cli.ts graph"
run: |
cd "$PEPR"
npx ts-node hack/load.cli.ts graph
- name: upload load test result graph (watcher)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: watcher.png
path: load/*.png
if-no-files-found: error
retention-days: 1

0 comments on commit f4aa736

Please sign in to comment.