Skip to content

Commit

Permalink
fix: container permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
leon0399 committed Feb 16, 2024
1 parent 1b4e10f commit 841d017
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_on_change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
- name: Run benchmarks for changed files
if: steps.files.outputs.changed != ''
run: |
docker-compose run benchmark python3 ./run_benchmarks.py ${{ steps.files.outputs.changed }}
docker-compose run benchmark python3 ./run_on_changes.py ${{ steps.files.outputs.changed }}
12 changes: 9 additions & 3 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,21 @@ def loadConfiguration(filename):
if timeResults and memoryResults:
timeResults.sort()
timeMedian = statistics.median(timeResults)
timeStdev = statistics.stdev(timeResults)
timeStdev = 0
if len(timeResults) > 1:
timeStdev = statistics.stdev(timeResults)

reportedResults.sort()
reportedMedian = statistics.median(reportedResults)
reportedStdev = statistics.stdev(reportedResults)
reportedStdev = 0
if len(reportedResults) > 1:
reportedStdev = statistics.stdev(reportedResults)

memoryResults.sort()
memoryMedian = statistics.median(memoryResults)
memoryStdev = statistics.stdev(memoryResults)
memoryStdev = 0
if len(memoryResults) > 1:
memoryStdev = statistics.stdev(memoryResults)

result = {
'tags': run['tags'],
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ services:
command: ./docker-entrypoint.sh
tty: true
stdin_open: true
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfermed
# cap_add:
# - SYS_ADMIN
# security_opt:
# - apparmor:unconfermed
working_dir: /app
volumes:
- ./:/app
Expand Down
2 changes: 1 addition & 1 deletion run_on_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
language, category, script = parts[0], parts[1], parts[2]
script_name = script.split('.')[0] # Extract script name without extension
# Assuming the benchmark script supports language and script parameters
command = f"./benchmark.py --languages {language} --scripts {category}/{script_name}"
command = f"python3 ./benchmark.py --languages {language} --scripts {category}/{script_name} --times 1"
benchmark_commands.add(command)

# Executing benchmark commands
Expand Down

0 comments on commit 841d017

Please sign in to comment.