|
41 | 41 | - name: Setup Rust |
42 | 42 | uses: actions-rust-lang/setup-rust-toolchain@v1 |
43 | 43 | with: |
| 44 | + toolchain: nightly-2025-08-18 # keep it same with ceno repo |
| 45 | + components: rust-src |
44 | 46 | cache: false |
45 | 47 |
|
46 | 48 | - name: Give Github Action access to ceno-gpu |
|
54 | 56 | block_number="${{ inputs.block_number }}" |
55 | 57 | # Install Ceno CLI |
56 | 58 | echo "Installing Ceno CLI..." |
57 | | - cargo install --git https://github.com/scroll-tech/ceno.git --locked --force cargo-ceno |
| 59 | + cargo install --git https://github.com/scroll-tech/ceno.git \ |
| 60 | + --rev ${{ inputs.ceno_version }} \ |
| 61 | + --features jemalloc \ |
| 62 | + --features nightly-features \ |
| 63 | + --locked \ |
| 64 | + --force \ |
| 65 | + cargo-ceno |
58 | 66 |
|
59 | 67 | RPC_1=${{ secrets.RPC_URL_1 }} |
60 | 68 |
|
|
68 | 76 | mkdir -p output |
69 | 77 | mkdir -p rpc-cache |
70 | 78 |
|
| 79 | + # LOG_NAME with Block number and Timestamp(UTC+8) |
| 80 | + TIMESTAMP=$(date -u -d '+8 hours' +'%Y%m%d-%H%M%S') |
| 81 | + LOG_NAME="mainnet${block_number}-${TIMESTAMP}" |
| 82 | + LOG_FILE="${LOG_NAME}.log" |
| 83 | + echo "LOG_NAME=${LOG_NAME}" >> $GITHUB_ENV |
| 84 | + echo "LOG_FILE=${LOG_FILE}" >> $GITHUB_ENV |
| 85 | +
|
71 | 86 | echo "Generating e2e proof for block $block_number..." |
72 | 87 | export JEMALLOC_SYS_WITH_MALLOC_CONF="retain:true,background_thread:true,metadata_thp:always,thp:always,dirty_decay_ms:10000,muzzy_decay_ms:10000,abort_conf:true" |
73 | 88 | CENO_GPU_CACHE_LEVEL=0 RUSTFLAGS="-C target-feature=+avx2" \ |
|
78 | 93 | --block-number $block_number \ |
79 | 94 | --rpc-url ${{ secrets.RPC_URL_1 }} \ |
80 | 95 | --output-dir output \ |
81 | | - --cache-dir rpc-cache |
| 96 | + --cache-dir rpc-cache > "$LOG_FILE" 2>&1 |
| 97 | + grep -v '\[ceno-gpu\]' "$LOG_FILE" # filter out ceno-gpu logs |
82 | 98 |
|
83 | 99 | echo "e2e proof generated successfully" |
| 100 | +
|
| 101 | + - name: Profile trace from log file |
| 102 | + run: | |
| 103 | + echo "Profiling log file: ${{ env.LOG_FILE }}" |
| 104 | + python3 ci/trace_profiler.py "${{ env.LOG_FILE }}" |
| 105 | +
|
| 106 | + - name: Prepare Result Directory |
| 107 | + run: | |
| 108 | + # Create a temp directory outside the workspace to survive checkout |
| 109 | + TEMP_DIR="/tmp/benchmark_results" |
| 110 | + rm -rf "$TEMP_DIR" |
| 111 | + mkdir -p "$TEMP_DIR" |
| 112 | + |
| 113 | + # Copy files to temp directory |
| 114 | + cp "${{ env.LOG_NAME }}_breakdown_chip.md" "$TEMP_DIR/" |
| 115 | + cp "${{ env.LOG_NAME }}_breakdown_module.md" "$TEMP_DIR/" |
| 116 | + cp "${{ env.LOG_NAME }}_summary.md" "$TEMP_DIR/" |
| 117 | + |
| 118 | + echo "TEMP_DIR=$TEMP_DIR" >> $GITHUB_ENV |
| 119 | +
|
| 120 | + ### Update gh-pages |
| 121 | + - uses: actions/checkout@v4 |
| 122 | + with: |
| 123 | + ref: gh-pages |
| 124 | + |
| 125 | + - name: Set up git |
| 126 | + run: | |
| 127 | + git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 128 | + git config --global user.name "github-actions[bot]" |
| 129 | +
|
| 130 | + - name: Commit to gh-pages branch |
| 131 | + run: | |
| 132 | + GH_PAGES_PATH="benchmarks-dispatch/${{ github.head_ref || github.ref }}" |
| 133 | + echo "GH_PAGES_PATH=${GH_PAGES_PATH}" >> $GITHUB_ENV |
| 134 | + mkdir -p "${GH_PAGES_PATH}" |
| 135 | + |
| 136 | + # Copy files from temp directory back to workspace |
| 137 | + cp -r ${{ env.TEMP_DIR }}/* "${GH_PAGES_PATH}/" |
| 138 | + |
| 139 | + git add "${GH_PAGES_PATH}/" |
| 140 | + git commit --allow-empty -m "Add benchmark results for ${{ env.LOG_NAME }} at ${GH_PAGES_PATH}" |
| 141 | + |
| 142 | + # Push with retry logic |
| 143 | + MAX_RETRIES=10 |
| 144 | + RETRY_DELAY=5 |
| 145 | + ATTEMPT=0 |
| 146 | + SUCCESS=false |
| 147 | + while [ $ATTEMPT -lt $MAX_RETRIES ]; do |
| 148 | + echo "Attempt $((ATTEMPT + 1)) to push of $MAX_RETRIES..." |
| 149 | + git fetch origin gh-pages |
| 150 | + git merge origin/gh-pages --no-edit |
| 151 | + if git push origin gh-pages; then |
| 152 | + SUCCESS=true |
| 153 | + break |
| 154 | + else |
| 155 | + echo "Push failed. Retrying in $RETRY_DELAY seconds..." |
| 156 | + sleep $RETRY_DELAY |
| 157 | + ATTEMPT=$((ATTEMPT + 1)) |
| 158 | + fi |
| 159 | + done |
| 160 | + |
| 161 | + if [ "$SUCCESS" = false ]; then |
| 162 | + echo "Push failed after $MAX_RETRIES attempts" |
| 163 | + exit 1 |
| 164 | + fi |
| 165 | +
|
| 166 | + - name: Update summary with results |
| 167 | + run: | |
| 168 | + RESULT_URL="https://github.com/${{ github.repository }}/blob/gh-pages/${{ env.GH_PAGES_PATH }}/${{ env.LOG_NAME }}_summary.md" |
| 169 | + echo "### Results" >> $GITHUB_STEP_SUMMARY |
| 170 | + echo "[${{ env.LOG_NAME }}](${RESULT_URL})" >> $GITHUB_STEP_SUMMARY |
| 171 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 172 | + cat "${{ env.GH_PAGES_PATH }}/${{ env.LOG_NAME }}_summary.md" >> $GITHUB_STEP_SUMMARY |
| 173 | +
|
| 174 | + - name: Cleanup Temp Directory |
| 175 | + if: always() |
| 176 | + run: | |
| 177 | + if [ -d "/tmp/benchmark_results" ]; then |
| 178 | + echo "Cleaning up /tmp/benchmark_results..." |
| 179 | + rm -rf "/tmp/benchmark_results" |
| 180 | + fi |
| 181 | +
|
| 182 | + - name: Path to result |
| 183 | + run: | |
| 184 | + echo "https://github.com/${{ github.repository }}/blob/gh-pages/${{ env.GH_PAGES_PATH }}/${{ env.LOG_NAME }}_summary.md" |
84 | 185 | # fi |
85 | 186 | # |
86 | 187 | # # Verify input file exists |
|
0 commit comments