Skip to content

Commit

Permalink
feat: v3.0.0-rc4 (#1645)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtguibas authored Oct 16, 2024
2 parents 459fac7 + 8f1749e commit 169a13a
Show file tree
Hide file tree
Showing 740 changed files with 26,283 additions and 151,582 deletions.
61 changes: 58 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ inputs:
pull_token:
description: "Token to use for private repo access"
required: true
setup_gcc:
description: "Whether to setup GCC or not"
required: false
default: 'true'
setup_aws_cli:
description: "Whether to install AWS CLI or not"
required: false
default: 'true'
runs:
using: "composite"
steps:
Expand All @@ -22,11 +30,41 @@ runs:
shell: bash
run: go version

- name: Check GCC version
id: check-gcc
shell: bash
run: |
if command -v gcc &> /dev/null; then
echo "gcc_exists=true" >> $GITHUB_OUTPUT
echo "gcc_version=$(gcc --version | head -n1 | awk '{print $NF}')" >> $GITHUB_OUTPUT
else
echo "gcc_exists=false" >> $GITHUB_OUTPUT
fi
- name: Setup GCC
uses: Dup4/actions-setup-gcc@v1
if: inputs.setup_gcc == 'true' && steps.check-gcc.outputs.gcc_exists != 'true'
with:
version: latest

- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install AWS CLI v2
if: inputs.setup_aws_cli == 'true'
shell: bash
run: |
if ! command -v aws &> /dev/null; then
echo "AWS CLI not found. Installing..."
python3 -m pip install --user awscli
echo "$HOME/.local/bin" >> $GITHUB_PATH
else
echo "AWS CLI is already installed."
fi
export PATH="$HOME/.local/bin:$PATH"
aws --version
- name: rust-cache
uses: actions/cache@v3
with:
Expand All @@ -37,11 +75,28 @@ runs:
~/.cargo/git/db/
target/
~/.rustup/
key: rust-1.79.0-${{ hashFiles('**/Cargo.toml') }}
restore-keys: rust-1.79.0-
key: rust-1.81.0-${{ hashFiles('**/Cargo.toml') }}
restore-keys: rust-1.81.0-

- name: Setup toolchain
id: rustc-toolchain
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.79.0 -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.81.0 -y
. "$HOME/.cargo/env"
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
# install pkg-config and openssl
- name: Install pkg-config and openssl
shell: bash
run: |
if ! dpkg -s pkg-config libssl-dev &> /dev/null; then
echo "pkg-config and/or libssl-dev not found. Installing..."
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev
else
echo "pkg-config and libssl-dev are already installed."
fi
- name: Set up Docker
uses: docker/setup-buildx-action@v3
8 changes: 0 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
target-branch: "dev"
ignore:
- dependency-name: "axum"
versions: ["> 0.7.4"]
- package-ecosystem: "docker"
directory: "/crates/cli/docker"
schedule:
Expand Down
17 changes: 17 additions & 0 deletions .github/runs-on.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
images:
nvidia-linux:
platform: "linux"
arch: "x64"
ami: "ami-0a63dc9cb9e934ba3"
owner: "421253708207"

dlami-x64:
platform: "linux"
arch: "x64"
owner: "898082745236" # AWS
name: "Deep Learning Base OSS Nvidia Driver GPU AMI (Ubuntu 22.04)*"

runners:
gpu-nvidia:
family: ["g6.4xlarge"]
image: dlami-x64
2 changes: 1 addition & 1 deletion .github/workflows/docker-gnark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ jobs:
SP1_GNARK_IMAGE: sp1-gnark
with:
command: test
toolchain: 1.79.0
toolchain: 1.81.0
args: --release -p sp1-prover -- --exact tests::test_e2e
120 changes: 61 additions & 59 deletions .github/workflows/docker-publish-gnark.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Source: https://raw.githubusercontent.com/foundry-rs/foundry/master/.github/workflows/docker-publish.yml
name: docker-gnark

on:
push:
branches:
- "main"
tags:
- "v*.*.*"
schedule:
- cron: "0 0 * * *"
# Trigger without any parameters a proactive rebuild
workflow_dispatch:
inputs:
tags:
Expand All @@ -20,83 +20,85 @@ env:
IMAGE_NAME: succinctlabs/sp1-gnark

jobs:
container:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow
build-amd64:
runs-on: [runs-on, runner=64cpu-linux-x64, spot=false, "run-id=${{ github.run_id }}"]
permissions:
id-token: write
packages: write
contents: read
timeout-minutes: 120
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4

- name: Install Docker BuildX
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
id: buildx
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
install: true
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push AMD64 image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.gnark-ffi
platforms: linux/amd64
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64
cache-from: type=gha
cache-to: type=gha,mode=max

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
build-arm64:
runs-on: [runs-on, runner=64cpu-linux-arm64, spot=false, "run-id=${{ github.run_id }}"]
permissions:
id-token: write
packages: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
# Ensure this doesn't trigger on PR's
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
- name: Build and push ARM64 image
uses: docker/build-push-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
context: .
file: ./Dockerfile.gnark-ffi
platforms: linux/arm64
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64
cache-from: type=gha
cache-to: type=gha,mode=max

# Creates an additional 'latest' or 'nightly' tag
# If the job is triggered via cron schedule, tag nightly and nightly-{SHA}
# If the job is triggered via workflow dispatch and on a master branch, tag branch and latest
# Otherwise, just tag as the branch name
- name: Finalize Docker Metadata
id: docker_tagging
create-manifest:
needs: [build-amd64, build-arm64]
runs-on: ubuntu-latest
steps:
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push manifest
run: |
TAGS=""
if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then
echo "manual trigger from workflow_dispatch, assigning tag ${{ github.event.inputs.tags }}"
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tags }}" >> $GITHUB_OUTPUT
TAGS="${{ github.event.inputs.tags }}"
elif [[ "${{ github.event_name }}" == 'schedule' ]]; then
echo "cron trigger, assigning nightly tag"
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
TAGS="nightly nightly-${{ github.sha }}"
else
echo "Neither scheduled nor manual release from main branch. Just tagging as branch name"
echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
TAGS="${GITHUB_REF##*/}"
fi
# Log docker metadata to explicitly know what is being pushed
- name: Inspect Docker Metadata
run: |
echo "TAGS -> ${{ steps.docker_tagging.outputs.docker_tags }}"
echo "LABELS -> ${{ steps.meta.outputs.labels }}"
# Build and push Docker image
# https://github.com/docker/build-push-action
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.gnark-ffi
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_tagging.outputs.docker_tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
for TAG in $TAGS; do
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$TAG \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64
done
2 changes: 2 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: docker

on:
push:
branches:
- "main"
tags:
- "v*.*.*"
schedule:
Expand Down
74 changes: 72 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
toolchain: 1.79.0
toolchain: 1.81.0
args: --release -p sp1-sdk --features native-gnark -- test_e2e_prove_plonk --nocapture
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
toolchain: 1.79.0
toolchain: 1.81.0
args: --release -p sp1-sdk -- test_e2e_prove_plonk --nocapture
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
Expand Down Expand Up @@ -128,6 +128,42 @@ jobs:
cargo add sp1-sdk --path $GITHUB_WORKSPACE/crates/sdk
SP1_DEV=1 RUST_LOG=info cargo run --release
cycle-tracking:
name: Example (Cycle Tracking)
runs-on:
[
runs-on,
runner=64cpu-linux-arm64,
spot=false,
"run-id=${{ github.run_id }}",
]
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup CI
uses: ./.github/actions/setup

- name: Install SP1 toolchain
run: |
curl -L https://sp1.succinct.xyz | bash
~/.sp1/bin/sp1up
~/.sp1/bin/cargo-prove prove --version
- name: Install SP1 CLI
run: |
cd crates/cli
cargo install --force --locked --path .
cd ~
- name: Run script
run: |
cd examples/cycle-tracking/script
cargo add sp1-sdk --path $GITHUB_WORKSPACE/crates/sdk
SP1_DEV=1 RUST_LOG=info cargo run --release
tendermint:
name: Example (Tendermint)
runs-on:
Expand Down Expand Up @@ -167,3 +203,37 @@ jobs:
cargo remove sp1-sdk
cargo add sp1-sdk --path $GITHUB_WORKSPACE/crates/sdk
SP1_DEV=1 RUST_LOG=info cargo run --release
test-cuda:
name: Test CUDA
runs-on: nvidia-gpu-linux-x64
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: rust-cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
~/.rustup/
key: rust-1.81.0-${{ hashFiles('**/Cargo.toml') }}
restore-keys: rust-1.81.0-

- name: Setup toolchain
id: rustc-toolchain
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.81.0 -y
- name: Run script
run: |
. "$HOME/.cargo/env"
curl -L https://sp1.succinct.xyz | bash
/home/runner/.sp1/bin/sp1up
sudo apt install libssl-dev pkg-config
cd examples/fibonacci
RUST_LOG=info cargo run --release --features cuda
Loading

0 comments on commit 169a13a

Please sign in to comment.