Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from upstream #4

Draft
wants to merge 1 commit into
base: sierra_emu
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/install_rust/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Installs rust toolchain with the version defined in .github/actions/install_rust/rust_version.txt.
inputs:
components:
description: "An optional parameter that will be sent to dtolnay/rust-toolchain."
description: "Optional: which additional components to install."
required: false
type: string
default: ''

runs:
using: "composite"
steps:
- name: Define toolchain
run: echo "DEFAULT_TOOLCHAIN=$(cat .github/actions/install_rust/rust_version.txt)" >> $GITHUB_ENV
shell: bash

- name: install rust toolchain with given components
if: "${{ inputs.components != '' }}"
uses: dtolnay/rust-toolchain@master
Expand Down
33 changes: 10 additions & 23 deletions .github/actions/setup-native-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,24 @@ outputs:
cairo-native-runtime-library:
description: "The path to the cairo native runtime library"
value: ${{ steps.set-env-vars.outputs.cairo-native-runtime-library }}

runs:
using: "composite"
steps:
- name: Add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM and gmplib
- name: Make script executable
shell: bash
run: |
sudo apt-get update
sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
sudo apt-get install -y libgmp3-dev
run: chmod +x ./scripts/setup_native_deps.sh

- name: Fetch Cairo Native Repository
uses: actions/checkout@v3
with:
repository: "lambdaclass/cairo_native"
ref: "cairo-lang2.7.0-rc.3"
path: "cairo_native"
- name: Install Cairo Native Runtime Dependencies
id: set-runtime-deps
shell: bash
run: |
sudo ./scripts/setup_native_deps.sh

- name: Set Environment Variables
id: set-env-vars
shell: bash
run: |
cd ./cairo_native &&
echo "cairo-native-runtime-library=$(pwd)/target/release/libcairo_native_runtime.a" >> $GITHUB_OUTPUT &&
echo "CAIRO_NATIVE_RUNTIME_LIBRARY=$(pwd)/target/release/libcairo_native_runtime.a" >> $GITHUB_ENV &&
echo "MLIR_SYS_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
echo "LLVM_SYS_181_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
echo "TABLEGEN_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
cd ./runtime &&
cargo build --release
echo "TABLEGEN_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV
70 changes: 4 additions & 66 deletions .github/workflows/blockifier_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,77 +39,15 @@ concurrency:

jobs:
featureless-build:
runs-on: starkware-ubuntu-20-04-medium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-latest"
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
- run: cargo build -p blockifier
- run: cargo test -p blockifier

native-blockifier-artifacts-push:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust

- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v1-rust-ubuntu-20.04"

- name: Build native blockifier
run: ./build_native_in_docker.sh scripts/build_native_blockifier.sh

# Commit hash on pull request event would be the head commit of the branch.
- name: Get commit hash prefix for PR update
if: ${{ github.event_name == 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV

# On push event (to main, for example) we should take the commit post-push.
- name: Get commit hash prefix for merge
if: ${{ github.event_name != 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.after }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV

# Rename is required; see https://pyo3.rs/v0.19.2/building_and_distribution#manual-builds.
- name: Rename shared object
run: |
mv \
target/release/libnative_blockifier.so \
target/release/native_blockifier.pypy39-pp73-x86_64-linux-gnu.so

# Check if the user has the required permission to upload the artifact.
- name: Get User Permission
id: checkAccess
uses: actions-cool/check-user-permission@v2
with:
require: write
username: ${{ github.triggering_actor }}

- name: Check User Permission
if: steps.checkAccess.outputs.require-result == 'false'
run: |
echo "${{ github.triggering_actor }} does not have permissions on this repo."
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
echo "Job originally triggered by ${{ github.actor }}"
exit 1

- name: Authenticate with GCS
uses: "google-github-actions/auth@v2"
with:
credentials_json: ${{ secrets.SA_NATIVE_BLOCKIFIER_ARTIFACTS_BUCKET_WRITER_ACCESS_KEY }}

- name: Upload binary to GCP
id: upload_file
uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: "target/release/native_blockifier.pypy39-pp73-x86_64-linux-gnu.so"
destination: "native_blockifier_artifacts/${{ env.SHORT_HASH }}/release/"
12 changes: 6 additions & 6 deletions .github/workflows/blockifier_compiled_cairo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ concurrency:

jobs:
verify_cairo_file_dependencies:
runs-on: starkware-ubuntu-20-04-medium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
prefix-key: "v0-rust-ubuntu-latest"

- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps

# Setup pypy and link to the location expected by .cargo/config.toml.
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -70,10 +74,6 @@ jobs:
with:
toolchain: nightly-2023-07-05

- name: set up native dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps

- name: Verify cairo contract recompilation (both cairo versions).
run:
cd sequencer &&
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/blockifier_post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ on:
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: starkware-ubuntu-20-04-medium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- uses: Noelware/[email protected]
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
prefix-key: "v0-rust-ubuntu-latest"

- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/clean_stale_prs.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/committer_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer_cli/**'
- 'crates/starknet_api/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'

Expand All @@ -27,6 +28,7 @@ on:
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer_cli/**'
- 'crates/starknet_api/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'

Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/lock_closed_prs.yml

This file was deleted.

Loading
Loading