Skip to content

Commit

Permalink
Merge pull request #241 from starkware-libs/dori/merge-main-v0.13.2-i…
Browse files Browse the repository at this point in the history
…nto-main-1722440900

Merge main-v0.13.2 into main
  • Loading branch information
dorimedini-starkware authored Jul 31, 2024
2 parents 6870856 + 15a644b commit 8629f35
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/blockifier_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
- v[0-9].**
paths:
- 'crates/blockifier/**'
- 'crates/native_blockifier/.cargo/config.toml'
- 'crates/native_blockifier/**'
- 'build_native_blockifier_in_docker.sh'
- 'scripts/build_native_blockifier.sh'

pull_request:
types:
Expand All @@ -20,7 +22,9 @@ on:
- edited
paths:
- 'crates/blockifier/**'
- 'crates/native_blockifier/.cargo/config.toml'
- 'crates/native_blockifier/**'
- 'build_native_blockifier_in_docker.sh'
- 'scripts/build_native_blockifier.sh'

jobs:
featureless-build:
Expand All @@ -45,7 +49,7 @@ jobs:
prefix-key: "v1-rust-ubuntu-20.04"

- name: Build native blockifier
run: ./build_native_blockifier.sh
run: ./build_native_blockifier_in_docker.sh

# Commit hash on pull request event would be the head commit of the branch.
- name: Get commit hash prefix for PR update
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/papyrus_docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: true

# Extract metadata (tags, labels) for Docker
Expand All @@ -47,7 +47,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4.1.1
with:
images: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}
images: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}/papyrus
tags: |
type=semver,pattern={{raw}}
type=semver,pattern={{version}}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ tmp_venv/*
/.vscode
# Git hooks
/.husky

# Python artifacts.
scripts/__pycache__
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ docker run \
-v "${HOME}:${HOME}" \
--workdir ${PWD} \
${docker_image_name} \
cargo build --release -p native_blockifier --features "testing"
scripts/build_native_blockifier.sh
21 changes: 21 additions & 0 deletions scripts/build_native_blockifier.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/env bash
set -e

function clean() {
echo "Cleaning up..."
deactivate || true
rm -rf venv || true
}


function build() {
echo "Building..."
pushd crates/native_blockifier
pypy3.9 -m venv venv
source venv/bin/activate
cargo build --release -p native_blockifier --features "testing" || clean
clean
popd
}

build
27 changes: 27 additions & 0 deletions scripts/committer/generate_committer_flamegraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
set -e

if [ "$GITHUB_ACTIONS" = true ]; then
echo "This script is not meant to be run in GitHub Actions."
exit 1
fi

# Restore security level in perf_event_paranoid at the end.
ORIGINAL_PARANOID=$(echo $(sysctl kernel.perf_event_paranoid) | grep -o '[0-9]$')
trap 'sudo sysctl kernel.perf_event_paranoid=$ORIGINAL_PARANOID' EXIT SIGINT SIGTERM

if ! command -v jq; then
cargo install jq
fi
if ! command -v flamegraph; then
cargo install flamegraph
fi
if ! command -v perf; then
sudo apt-get install linux-tools-common linux-tools-generic linux-tools-`uname -r`
fi

ROOT_DIR=$(git rev-parse --show-toplevel)
BENCH_INPUT_FILES_PREFIX=$(cat ${ROOT_DIR}/crates/committer_cli/src/tests/flow_test_files_prefix)
# Lower security level in perf_event_paranoid to 2 to allow cargo to use perf without running on root.
sudo sysctl kernel.perf_event_paranoid=2

gcloud storage cat gs://committer-testing-artifacts/${BENCH_INPUT_FILES_PREFIX}/committer_flow_inputs.json | jq -r .committer_input | CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -p committer_cli -- commit

0 comments on commit 8629f35

Please sign in to comment.