diff --git a/.github/workflows/loadgen-profiler-test.yml b/.github/workflows/loadgen-profiler-test.yml new file mode 100644 index 000000000..bef598560 --- /dev/null +++ b/.github/workflows/loadgen-profiler-test.yml @@ -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 + + diff --git a/tools/profiler/test-config.json b/tools/profiler/test-config.json new file mode 100644 index 000000000..3330d92c4 --- /dev/null +++ b/tools/profiler/test-config.json @@ -0,0 +1,7 @@ +[ + { + "yaml-location": "./yamls/kn-aes-go.yaml", + "predeployment-commands": [], + "postdeployment-commands": [] + } +] \ No newline at end of file