File tree Expand file tree Collapse file tree 3 files changed +40
-11
lines changed Expand file tree Collapse file tree 3 files changed +40
-11
lines changed Original file line number Diff line number Diff line change 11name : Build and run performance tests for PR
22on :
3- pull_request :
3+ # We want to run on forks as we protect with a label.
4+ # Without this we have no secrets to pass.
5+ pull_request_target :
46 branches :
57 - master
68 types :
@@ -21,22 +23,47 @@ jobs:
2123 secrets :
2224 service-account : ${{ secrets.GCP_SA_KEY }}
2325
24- pr-perf-test-complete :
25- name : PR - performance test complete
26+ pr-perf-test-upload :
27+ name : PR - performance test upload
28+ if : always()
2629 runs-on : ubuntu-latest
2730 needs :
2831 - pr-perf-test-run
32+ permissions :
33+ pull-requests : write
2934 steps :
3035 - uses : actions/download-artifact@v3
3136
32- - name : Upload plots
37+ - name : Upload plots to CML
3338 continue-on-error : true
34- 35- with :
36- path : ' ./**/*.png'
37- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38-
39+ run : |
40+ for FILE in *.png; do
41+ echo "Handling $FILE"
42+ docker run --rm -t \
43+ -v $PWD:/output:rw \
44+ dvcorg/cml-py3:latest \
45+ /bin/sh -c "cml-publish /output/$FILE $DEFAULT_SETTINGS --md --title=$FILE >> /output/report.md"
46+ done
47+ cat report.md
48+ docker run --rm -t \
49+ -v $PWD/report.md:/report.md:ro \
50+ -e GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" \
51+ dvcorg/cml-py3:latest \
52+ /bin/sh -c "cml-send-comment /report.md $DEFAULT_SETTINGS --commit-sha=${{ github.sha }}"
53+ shell : bash
54+ working-directory : output
55+ env :
56+ DEFAULT_SETTINGS : " --driver=github --repo=${{ github.repository }}"
3957
58+ pr-perf-test-complete :
59+ # Only runs on success
60+ name : PR - performance test complete
61+ runs-on : ubuntu-latest
62+ needs :
63+ - pr-perf-test-run
64+ permissions :
65+ pull-requests : write
66+ steps :
4067 - uses : actions-ecosystem/action-add-labels@v1
4168 name : Label the PR
4269 with :
Original file line number Diff line number Diff line change 1- version : " 3"
1+ version : " 3.4 "
22
33services :
44
@@ -12,6 +12,7 @@ services:
1212 build :
1313 context : ../..
1414 dockerfile : dockerfiles/Dockerfile
15+ target : production
1516 volumes :
1617 - log-volume:/logs:ro
1718 - ./fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf:ro
Original file line number Diff line number Diff line change 1717 /scripts/multi-line-log-generator.sh &
1818 else
1919 echo " Creating $OUTPUT_LOGFILE "
20- /run_log_generator.py --log-size-in-bytes " $LOG_SIZE " --log-rate " $LOG_RATE " --log-agent-input-type tail --tail-file-path " $OUTPUT_LOGFILE " &
20+ # Far too much debug
21+ /run_log_generator.py --log-size-in-bytes " $LOG_SIZE " --log-rate " $LOG_RATE " --log-agent-input-type tail --tail-file-path " $OUTPUT_LOGFILE " & > /dev/null &
2122 fi
2223done
2324
You can’t perform that action at this time.
0 commit comments