Skip to content

Commit

Permalink
Add CI for profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
dhschall authored Feb 24, 2024
1 parent 8dd3764 commit cbe1c68
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/loadgen-profiler-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Profiler test of the cluster load generator

on:
workflow_dispatch:
schedule:
- cron: "0 9 * * 1"
push:
branches: [main]
paths:
- "utils/**"
- "tools/**"

pull_request:
branches: [main]
paths:
- "utils/**"
- "tools/**"

env:
GOOS: linux
GO111MODULE: on
PORT: 50051
PLATFORMS: linux/amd64,linux/arm64

jobs:
test-knative:
name: Test Knative Deployment
needs: build-and-push
env:
KIND_VERSION: v0.14.0
K8S_VERSION: v1.23

runs-on: ubuntu-20.04
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4
with:
lfs: "true"
- name: Checkout LFS objects
run: git lfs checkout

- uses: actions/setup-go@v5
with:
go-version: '1.21'

- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
# - run: pip install -r ./tools/profiler/requirements.txt

# Install kn
- uses: supplypike/setup-bin@v3
with:
uri: 'https://github.com/knative/client/releases/download/knative-v1.13.0/kn-linux-amd64'
name: 'kn'
version: '1.13.0'

## Setup a Knative cluster to test the service
- name: Create k8s Kind Cluster
run: bash ./runner/scripts/01-kind.sh

- name: Install Serving
run: bash ./runner/scripts/02-serving.sh

- name: Install Kourier
run: bash ./runner/scripts/02-kourier.sh

- name: Test profiler on one function
working-directory: ./tools/profiler
run: python main.py profile --config test-config.json -dbg True

- name: Show results
working-directory: ./tools/profiler
run: |
cat profile.json
cat build/kn-aes-go/cpu.txt
cat build/kn-aes-go/memory.txt
cat build/kn-aes-go/duration.txt
7 changes: 7 additions & 0 deletions tools/profiler/test-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"yaml-location": "./yamls/kn-aes-go.yaml",
"predeployment-commands": [],
"postdeployment-commands": []
}
]

0 comments on commit cbe1c68

Please sign in to comment.