Skip to content

Commit

Permalink
Move profiling into separate workflow and run it on linux as pyroscop…
Browse files Browse the repository at this point in the history
…e agent does not work on windows
  • Loading branch information
chippmann committed May 18, 2024
1 parent ed717bf commit fda9bca
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 33 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/benchmark_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@ on:
env:
SCONS_CACHE_MSVC_CONFIG: true
BENCHMARK_DATA_URL: ${{ secrets.BENCHMARK_DATA_URL }}
PYROSCOPE_APPLICATION_NAME: 'godot.benchmarks'
PYROSCOPE_PROFILER_ALLOC: 512k
PYROSCOPE_PROFILER_LOCK: 10ms
PYROSCOPE_SERVER_ADDRESS: ${{ secrets.PYROSCOPE_SERVER_ADDRESS }}
PYROSCOPE_BASIC_AUTH_USER: ${{ secrets.PYROSCOPE_BASIC_AUTH_USER }}
PYROSCOPE_BASIC_AUTH_PASSWORD: ${{ secrets.PYROSCOPE_BASIC_AUTH_PASSWORD }}

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows_benchmark
cancel-in-progress: true

jobs:
build-windows:
benchmark-windows:
# Windows 10 with latest image
runs-on:
- self-hosted
Expand Down Expand Up @@ -68,13 +62,6 @@ jobs:
run: |
modules/kotlin_jvm/harness/benchmarks/gradlew -p modules/kotlin_jvm/harness/benchmarks/ build -Prelease=true
- name: Profile benchmarks
run: |
cd modules/kotlin_jvm/harness/benchmarks/
# no embedded jre
./gradlew profileAndUpload
timeout-minutes: 30

- name: Run benchmarks
run: |
cd modules/kotlin_jvm/harness/benchmarks/
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/profile_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: 📊 Profile linux
on:
workflow_call:
inputs:
godot-version:
type: string
jvm-version:
type: string

env:
PYROSCOPE_APPLICATION_NAME: 'godot.benchmarks'
PYROSCOPE_PROFILER_ALLOC: 512k
PYROSCOPE_PROFILER_LOCK: 10ms
PYROSCOPE_SERVER_ADDRESS: ${{ secrets.PYROSCOPE_SERVER_ADDRESS }}
PYROSCOPE_BASIC_AUTH_USER: ${{ secrets.PYROSCOPE_BASIC_AUTH_USER }}
PYROSCOPE_BASIC_AUTH_PASSWORD: ${{ secrets.PYROSCOPE_BASIC_AUTH_PASSWORD }}

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows_benchmark
cancel-in-progress: true

jobs:
profile-linux:
runs-on: ubuntu-latest
name: Profile linux

steps:
- name: Clone Godot Engine
uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ inputs.godot-version }}

- name: Clone Godot JVM module.
uses: actions/checkout@v4
with:
path: modules/kotlin_jvm

- uses: actions/setup-java@v4
with:
distribution: adopt-hotspot
java-version: ${{ inputs.jvm-version }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false

- name: Download linux editor release
uses: ./.github/actions/download-artifact
with:
name: editor_release_linux_x86_64
path: './bin'

- name: Download godot-bootstrap release
uses: ./.github/actions/download-artifact
with:
name: jvm_godot-bootstrap_release
path: './bin'

- name: Build benchmarks project
run: |
modules/kotlin_jvm/harness/benchmarks/gradlew -p modules/kotlin_jvm/harness/benchmarks/ build -Prelease=true
- name: Profile benchmarks
run: |
cd modules/kotlin_jvm/harness/benchmarks/
# no embedded jre
./gradlew profileAndUpload
timeout-minutes: 30
37 changes: 18 additions & 19 deletions .github/workflows/trigger_on_push_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
# - setup-build-variables
# with:
# godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
#
# build-linux:
# name: 🐧 Build Linux
# uses: ./.github/workflows/build_linux.yml
# needs:
# - setup-build-variables
# with:
# godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
#

build-linux:
name: 🐧 Build Linux
uses: ./.github/workflows/build_linux.yml
needs:
- setup-build-variables
with:
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}

# build-macos:
# name: 🍎 Build macOS
# uses: ./.github/workflows/build_macos.yml
Expand All @@ -74,25 +74,24 @@ jobs:
with:
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}

# needed for benchmarks
assemble-windows:
name: 🪟 Assemble windows
uses: ./.github/workflows/assemble_windows.yml
benchmark-windows:
name: 📊 Benchmark windows
secrets: inherit # needed so that this sub workflow can also access github secrets for this workflow
uses: ./.github/workflows/benchmark_windows.yml
needs:
- setup-build-variables
- build-jvm
- build-windows
with:
godot-kotlin-jvm-version: ${{ needs.setup-build-variables.outputs['godot-kotlin-jvm-version'] }}
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}

benchmark-windows:
name: 📊 Benchmark windows
profile-linux:
name: 📊 Profile linux
secrets: inherit # needed so that this sub workflow can also access github secrets for this workflow
uses: ./.github/workflows/benchmark_windows.yml
uses: ./.github/workflows/profile_linux.yml
needs:
- setup-build-variables
- assemble-windows
- build-linux
with:
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}

0 comments on commit fda9bca

Please sign in to comment.