Skip to content

self-hosted

self-hosted #18

Workflow file for this run

---
name: self-hosted
permissions: read-all
on: [ workflow_dispatch ]
env:
CSV_FILE_PREFIX: https://pub-95669c22c66d453c92c62f20aa0c5b57.r2.dev
BUCKET: github-action
BASE: main
STEPS: "step_1 step_10 step_100 step_1000 main_2"
jobs:
base:
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: self-hosted
branch: main
script: benchmark-big.sh
sleep_1:
needs: [ base ]
uses: ./.github/workflows/sleep.yaml
step_1:
needs: [ sleep_1 ]
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: self-hosted
branch: step_1
script: benchmark-big.sh
sleep_10:
needs: [ step_1 ]
uses: ./.github/workflows/sleep.yaml
step_10:
needs: [ sleep_10 ]
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: self-hosted
branch: step_10
script: benchmark-big.sh
sleep_100:
needs: [ step_10 ]
uses: ./.github/workflows/sleep.yaml
step_100:
needs: [ sleep_100 ]
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: self-hosted
branch: step_100
script: benchmark-big.sh
sleep_1000:
needs: [ step_100 ]
uses: ./.github/workflows/sleep.yaml
step_1000:
needs: [ sleep_1000 ]
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: self-hosted
branch: step_1000
script: benchmark-big.sh
sleep_main_2:
needs: [ step_1000 ]
uses: ./.github/workflows/sleep.yaml
main_2:
needs: [ sleep_main_2 ]
uses: ./.github/workflows/benchmark-template.yaml
with:
runs-on: self-hosted
branch: main
script: benchmark-big.sh
sleep_compare:
needs: [ main_2 ]
uses: ./.github/workflows/sleep.yaml
compare:
needs: [ base, step_1, step_10, step_100, step_1000, main_2, sleep_compare ]
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: 'clement2026/etcd'
path: etcd
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: etcd/go.sum
- name: Load Results
run: |
echo "${{ needs.base.outputs.results }}" | base64 -d > $BASE.csv
echo "${{ needs.main_2.outputs.results }}" | base64 -d > main_2.csv
echo "${{ needs.step_1.outputs.results }}" | base64 -d > step_1.csv
echo "${{ needs.step_10.outputs.results }}" | base64 -d > step_10.csv
echo "${{ needs.step_100.outputs.results }}" | base64 -d > step_100.csv
echo "${{ needs.step_1000.outputs.results }}" | base64 -d > step_1000.csv
- name: ls *.csv && cat *.csv
run: ls *.csv && cat *.csv
- name: build rw-heatmaps
run: go build -C etcd/tools/rw-heatmaps
- name: compare
run: |
for step in $STEPS; do
./etcd/tools/rw-heatmaps/rw-heatmaps $BASE.csv $step.csv -t "$BASE vs $step" -o $step
done
- name: ls
run: ls -lh
- name: zip
run: zip -r archive.zip *.csv *.jpg ./scripts/*.sh
- name: write names to env
run: |
DATE=$(date '+%Y%m%d-%H-%M-%S')
echo "ZIP_OBJECT_NAME=etcd-benchmark-$DATE.zip" >> $GITHUB_ENV
for step in $STEPS; do
echo "COMPARE_READ_OBJECT_NAME_$step=etcd-benchmark-$DATE-$step-read.jpg" >> $GITHUB_ENV
echo "COMPARE_WRITE_OBJECT_NAM_$step=etcd-benchmark-$DATE-$step-write.jpg" >> $GITHUB_ENV
done
- name: print md
run: |
echo "[archive.zip]($CSV_FILE_PREFIX/$ZIP_OBJECT_NAME)" >> "$GITHUB_STEP_SUMMARY"
for step in $STEPS; do
echo "### $step" >> "$GITHUB_STEP_SUMMARY"
varname=COMPARE_READ_OBJECT_NAME_$step
echo "![]($CSV_FILE_PREFIX/${!varname})" >> "$GITHUB_STEP_SUMMARY"
varname=COMPARE_WRITE_OBJECT_NAM_$step
echo "![]($CSV_FILE_PREFIX/${!varname})" >> "$GITHUB_STEP_SUMMARY"
done
cat <<EOL >> "$GITHUB_STEP_SUMMARY"
EOL
- name: install wrangler
run: npm install wrangler
- name: upload to r2
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
npx wrangler r2 object put $BUCKET/$ZIP_OBJECT_NAME --file=archive.zip
for step in $STEPS; do
varname=COMPARE_READ_OBJECT_NAME_$step
npx wrangler r2 object put $BUCKET/${!varname} --file=$step'_read.jpg'
varname=COMPARE_WRITE_OBJECT_NAM_$step
npx wrangler r2 object put $BUCKET/${!varname} --file=$step'_write.jpg'
done