Skip to content

Commit 7ceabc1

Browse files
authored
Remove the need for root access (#51)
* Remove the need for root access #43 * Remove the need for root access #43
1 parent 94dfd90 commit 7ceabc1

File tree

2 files changed

+58
-69
lines changed

2 files changed

+58
-69
lines changed

scripts/perf-lab/helpers/cgroups.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ scripts:
2222
- script: sudo
2323
with:
2424
command: sh -c 'mkdir -p /sys/fs/cgroup/${{CGROUP_NAME:perf-cgroup}}/tasks'
25-
# - script: sudo
26-
# with:
27-
# command: chown -R ${{env.USER}} /sys/fs/cgroup/${{CGROUP_NAME:perf-cgroup}}/
2825
- script: sudo
2926
with:
3027
command: sh -c 'echo "+cpu" >> /sys/fs/cgroup/${{CGROUP_NAME:perf-cgroup}}/cgroup.subtree_control'

scripts/perf-lab/main.yml

Lines changed: 58 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -38,69 +38,59 @@ states:
3838
BASE_JAVA_CMD: ${{config.CMD_PREFIX}} java ${{config.jvm.memory}} ${{config.jvm.args}} ${{PROFILER_JVM_ARGS}}
3939
TESTS : [test-build, measure-build-times, measure-time-to-first-request, measure-rss, run-load-test]
4040
RUNTIMES: [quarkus3-jvm, quarkus3-native, spring3-jvm, spring3-jvm-aot, spring3-native]
41-
42-
RUNTIMECMDS: {
43-
"quarkus3-jvm": {
44-
"name": "quarkus3-jvm"
45-
, type: "jvm"
46-
, updateScript: "update-quarkus-version"
47-
, updateVersion: "${{config.quarkus.version}}"
48-
, dir: "${{QUARKUS3_DIR}}"
49-
, buildCmd: "./mvnw ${{QUARKUS_MAVEN_OPTIONS}} clean package -DskipTests"
50-
, "runCmd" : "${{BASE_JAVA_CMD}} -jar $(realpath ${{QUARKUS3_DIR}}/target/quarkus-app/quarkus-run.jar)"
51-
},
52-
"quarkus3-native": {
53-
"name": "quarkus3-native"
54-
, type: "native"
55-
, updateScript: "update-quarkus-version"
56-
, updateVersion: "${{config.quarkus.version}}"
57-
, dir: "${{QUARKUS3_DIR}}"
58-
, buildCmd: "./mvnw ${{QUARKUS_MAVEN_OPTIONS}} clean package -DskipTests -Pnative ${{config.quarkus.native_build_options}}"
59-
, "runCmd" : "${{config.CMD_PREFIX}} $(realpath ${{QUARKUS3_DIR}}/target/quarkus3-runner) ${{config.jvm.memory}}"
60-
},
61-
"spring3-jvm" : {
62-
"name": "spring3-jvm"
63-
, type: "jvm"
64-
, updateScript: "update-spring-boot-version"
65-
, updateVersion: "${{config.springboot.version}}"
66-
, dir: "${{SPRING3_BOOT_DIR}}"
67-
, buildCmd: "./mvnw clean package -DskipTests"
68-
, "runCmd" : "${{BASE_JAVA_CMD}} -jar $(realpath ${{SPRING3_BOOT_DIR}}/target/springboot3.jar)"
69-
},
70-
"spring3-jvm-aot" : {
71-
"name": "spring3-jvm-aot"
72-
, type: "jvm"
73-
, updateScript: "update-spring-boot-version"
74-
, updateVersion: "${{config.springboot.version}}"
75-
, dir: "${{SPRING3_BOOT_DIR}}"
76-
, buildCmd: "./mvnw clean compile spring-boot:process-aot package -DskipTests"
77-
, "runCmd" : "${{BASE_JAVA_CMD}} -Dspring.aot.enabled=true -jar $(realpath ${{SPRING3_BOOT_DIR}}/target/springboot3.jar)"
78-
},
79-
"spring3-native" : {
80-
"name": "spring3-native"
81-
, type: "native"
82-
, updateScript: "update-spring-boot-version"
83-
, updateVersion: "${{config.springboot.version}}"
84-
, dir: "${{SPRING3_BOOT_DIR}}"
85-
, buildCmd: "./mvnw clean -Pnative -DskipTests native:compile package ${{config.springboot.native_build_options}}"
86-
, "runCmd" : "${{config.CMD_PREFIX}} $(realpath ${{SPRING3_BOOT_DIR}}/target/springboot3) ${{config.jvm.memory}}"
87-
}
88-
}
89-
90-
REPO_DIR: ${{BASE_DIR}}/spring-quarkus-perf-comparison
91-
SCRIPTS_DIR: ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/scripts/perf-lab
92-
JS_SCRIPTS_DIR: ${{SCRIPTS_DIR}}/scripts
93-
SPRING3_BOOT_DIR: ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/springboot3
94-
QUARKUS3_DIR : ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/quarkus3
9541
TARGET_URL: http://localhost:8080/fruits
9642
QUARKUS-PLATFORM-ARTIFACT-ID: quarkus-bom
9743
PROJ_REPO_NAME: spring-quarkus-perf-comparison
98-
BASE_DIR: "~"
9944
METRICS_DIR: /tmp
10045
ASYNC_PROFILER: async-profiler
101-
ASYNC_PROFILER_DIR: ${{BASE_DIR}}/${{ASYNC_PROFILER}}
46+
RUNTIMECMDS:
47+
- name: quarkus3-jvm
48+
type: jvm
49+
dir: ${{QUARKUS3_DIR}}
50+
updateScript: update-quarkus-version
51+
updateVersion: ${{config.quarkus.version}}
52+
buildCmd: "./mvnw ${{QUARKUS_MAVEN_OPTIONS}} clean package -DskipTests"
53+
runCmd: "${{BASE_JAVA_CMD}} -jar ${{QUARKUS3_DIR}}/target/quarkus-app/quarkus-run.jar"
54+
- name: quarkus3-native
55+
type: native
56+
dir: ${{QUARKUS3_DIR}}
57+
updateScript: update-quarkus-version
58+
updateVersion: ${{config.quarkus.version}}
59+
buildCmd: "./mvnw ${{QUARKUS_MAVEN_OPTIONS}} clean package -DskipTests -Pnative ${{config.quarkus.native_build_options}}"
60+
runCmd: "${{config.CMD_PREFIX}} ${{QUARKUS3_DIR}}/target/quarkus3-runner ${{config.jvm.memory}}"
61+
- name: spring3-jvm
62+
type: jvm
63+
dir: ${{SPRING3_BOOT_DIR}}
64+
updateScript: update-spring-boot-version
65+
updateVersion: ${{config.springboot.version}}
66+
buildCmd: "./mvnw clean package -DskipTests"
67+
runCmd: "${{BASE_JAVA_CMD}} -jar ${{SPRING3_BOOT_DIR}}/target/springboot3.jar"
68+
- name: spring3-jvm-aot
69+
type: jvm
70+
dir: ${{SPRING3_BOOT_DIR}}
71+
updateScript: update-spring-boot-version
72+
updateVersion: ${{config.springboot.version}}
73+
buildCmd: "./mvnw clean compile spring-boot:process-aot package -DskipTests"
74+
runCmd: "${{BASE_JAVA_CMD}} -Dspring.aot.enabled=true -jar ${{SPRING3_BOOT_DIR}}/target/springboot3.jar"
75+
- name: spring3-native
76+
type: native
77+
dir: ${{SPRING3_BOOT_DIR}}
78+
updateScript: update-spring-boot-version
79+
updateVersion: ${{config.springboot.version}}
80+
buildCmd: "./mvnw clean -Pnative -DskipTests native:compile package ${{config.springboot.native_build_options}}"
81+
runCmd: "${{config.CMD_PREFIX}} ${{SPRING3_BOOT_DIR}}/target/springboot3 ${{config.jvm.memory}}"
10282

10383
scripts:
84+
update-state:
85+
- sh: echo $(realpath ~)
86+
- set-state: RUN.BASE_DIR
87+
- set-state: RUN.REPO_DIR ${{BASE_DIR}}/spring-quarkus-perf-comparison
88+
- set-state: RUN.SCRIPTS_DIR ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/scripts/perf-lab
89+
- set-state: RUN.JS_SCRIPTS_DIR ${{SCRIPTS_DIR}}/scripts
90+
- set-state: RUN.SPRING3_BOOT_DIR ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/springboot3
91+
- set-state: RUN.QUARKUS3_DIR ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/quarkus3
92+
- set-state: RUN.ASYNC_PROFILER_DIR ${{BASE_DIR}}/${{ASYNC_PROFILER}}
93+
10494
output-vars:
10595
- log: |
10696
"Config: ${{config}}"
@@ -109,7 +99,8 @@ scripts:
10999
"REPO_DIR: ${{REPO_DIR}}"
110100
"SCRIPTS_DIR: ${{SCRIPTS_DIR}}"
111101
"SPRING3_BOOT_DIR: ${{SPRING3_BOOT_DIR}}"
112-
"QUARKUS3_DIR : ${{QUARKUS3_DIR }}"
102+
"QUARKUS3_DIR : ${{QUARKUS3_DIR}}"
103+
"RUNTIMECMDS: ${{RUNTIMECMDS}}"
113104
114105
cleanup-env:
115106
- script: sudo
@@ -154,10 +145,10 @@ scripts:
154145
- sh: ./mvnw versions:set-property -Dproperty=quarkus.platform.version -DnewVersion=${{VERSION}}
155146

156147
start-test-services:
157-
- sh: $(realpath ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/scripts/infra.sh) -s
148+
- sh: ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/scripts/infra.sh -s
158149

159150
stop-test-services:
160-
- sh: $(realpath ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/scripts/infra.sh) -d
151+
- sh: ${{REPO_DIR}}/${{PROJ_REPO_NAME}}/scripts/infra.sh -d
161152

162153
run-tests:
163154
- sh: java -version
@@ -169,17 +160,18 @@ scripts:
169160
- log: cgroups configured - continuing
170161
- for-each: RUNTIME ${{RUNTIMES}}
171162
then:
172-
- log: "Updating version: ${{${{RUNTIMECMDS.${{RUNTIME}}}}.updateVersion:}}"
173-
- script: ${{${{RUNTIMECMDS.${{RUNTIME}}}}.updateScript:abort-script-not-found}}
163+
- set-state: RUNTIMECMD ${{RUNTIMECMDS[?(@.name == '${{RUNTIME}}')]}}
164+
- log: "Updating version: ${{RUNTIMECMD.updateVersion:}}"
165+
- script: ${{RUNTIMECMD.updateScript:abort-script-not-found}}
174166
with:
175-
DIR: ${{${{RUNTIMECMDS.${{RUNTIME}}}}.dir}}
176-
VERSION: ${{${{RUNTIMECMDS.${{RUNTIME}}}}.updateVersion:}}
167+
DIR: ${{RUNTIMECMD.dir}}
168+
VERSION: ${{RUNTIMECMD.updateVersion:}}
177169
- log: "Testing: ${{RUNTIME}}"
178170
- for-each: TEST ${{TESTS}}
179171
then:
180172
- script: ${{TEST}}
181173
with:
182-
RUNTIME: ${{RUNTIMECMDS.${{RUNTIME}}}}
174+
RUNTIME: ${{RUNTIMECMD}}
183175
- script: download-metrics
184176

185177
abort-script-not-found:
@@ -477,6 +469,7 @@ roles:
477469
hosts:
478470
- target-host
479471
setup-scripts:
472+
- update-state
480473
# - output-vars
481474
- detect-os
482475
- capture-os-info
@@ -492,5 +485,4 @@ roles:
492485
- stop-timestamp
493486
- download-metrics
494487
- stop-test-services
495-
# - cleanup-env
496-
# - remove-installed-packages
488+
# - cleanup-env

0 commit comments

Comments
 (0)