Skip to content

Commit

Permalink
Error refactor (#168)
Browse files Browse the repository at this point in the history
* feat: Add new error variants

* refactor: Use top level error and tracing instead of stdio

* refactor: Use error propagation instead of panicking

* refactor: Use top level errors and propagate

* fix: Remove the Err wrap around HostError

* refactor: Use top level errors and simplify preflight function

* refactor: Adapt to error changes

* chore: Remove patch for new nightly toolchain

* chore: Add generated openapi spec file

* misc: Fix comment typo

* chore: Use tracing macros instead of println

* fix: Add prover specific args struct to open api definitions

* chore: Run clippy fix

* chore: Fix useless conversions

* feat: Add docs genereation workflow on github pages

* refactor: Make doc creation a oneliner

* feat: Add initial output documentation

* feat: Add documentation comments

* feat: Improve request documentation and add scalar to raiko instance paths

* chore: Add OpenAPI section

* misc: Fix typos in readme text

* fix: Upload artifact during build steps in order not to lose it

* fix: Expect error for creating RBDP

* chore: Use warn instead of debug scope

* chore: Remove unused dependency

* chore: Move index.html to openapi to reduce artifact for GitHub pages

* fix: Make openapi directory before docs generation

* refactor: Use matrix for equivalent jobs

* fix: Add actual matrix definition

* refactor: Improve metrics accuracy for time observations

* chore: Run clippy pedantic

* misc: Use single line command macro attribute

* fix: Fix doc test

* fix: Remove doc example

* feat: Update response doc

* feat: Change ouput struct

* fix: Fix rebase diff

* fix: Add tracer build step for native target

* fix: Rename to main

* fix: Fix typo in CI

* fix: Fix GuestOutput structure in all provers

* fixed some typos and tiny changes to log output

---------

Co-authored-by: Brechtpd <[email protected]>
  • Loading branch information
petarvujovic98 and Brechtpd authored May 13, 2024
1 parent 6a8421d commit 5ede08c
Show file tree
Hide file tree
Showing 26 changed files with 1,001 additions and 811 deletions.
151 changes: 56 additions & 95 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,107 +15,51 @@ concurrency:

jobs:
build-test:
name: Build and test native
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
matrix:
VERSIONS: [
{name: native, toolchain: nightly-2024-04-17},
{name: sp1, toolchain: nightly-2024-04-17},
{name: risc0, toolchain: stable},
{name: sgx, toolchain: stable},
]
env:
TARGET: native
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-04-17
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install native
run: make install
- name: Build native prover
run: make build
- name: Test native prover
run: make test
- name: Build with tracer
run: cargo build --features tracer

build-test-risc0:
name: Build and test risc0
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: risc0
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- uses: risc0/risc0/.github/actions/[email protected]
- name: Install risc0
run: make install
- name: Build risc0 prover
run: make build
- name: Test risc0 prover
run: make test

build-test-sp1:
name: Build and test sp1
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: sp1
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-04-17
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install sp1
run: make install
- name: Build sp1 prover
run: make build
- name: Test sp1 prover
run: make test

build-test-sgx:
name: Build and test sgx
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: sgx
TARGET: ${{ matrix.VERSIONS.name }}
CI: 1
MOCK: 1

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ matrix.VERSIONS.toolchain }}
profile: minimal

- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install sgx

- name: Setup sccache
if: ${{ matrix.VERSIONS.name }} == risc0
uses: risc0/risc0/.github/actions/[email protected]

- name: Install ${{ matrix.VERSIONS.name }}
run: make install
- name: Build sgx prover

- name: Build ${{ matrix.VERSIONS.name }} prover
run: make build
- name: Test sgx prover

- name: Test ${{ matrix.VERSIONS.name }} prover
run: make test

- name: Build with tracer
if: ${{ matrix.VERSIONS.name }} == native
run: cargo build -F tracer

build-test-sgx-hardware:
name: Build and test sgx in hardware
Expand All @@ -125,27 +69,34 @@ jobs:
TARGET: sgx
CI: 1
EDMM: 0

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Install cargo-binstall
uses: cargo-bins/[email protected]

- name: Install sgx
run: make install

- name: Build sgx prover
run: make build

- name: Test sgx prover
run: make test

build-test-sgx-with-docker:
name: Build and test sgx with Docker
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v4
- name: Setup and build
Expand All @@ -158,32 +109,42 @@ jobs:
name: Test raiko-lib
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
profile: minimal

- run: cargo test -p raiko-lib --features=std

clippy:
name: clippy
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- uses: risc0/risc0/.github/actions/[email protected]
- uses: risc0/risc0/.github/actions/[email protected]
- uses: risc0/clippy-action@main
with:
reporter: 'github-pr-check'
fail_on_error: true
clippy_flags: --workspace --all-targets --all-features -- -Dwarnings
- uses: actions/checkout@v4

- uses: risc0/risc0/.github/actions/[email protected]

- uses: risc0/risc0/.github/actions/[email protected]

- uses: risc0/clippy-action@main
with:
reporter: 'github-pr-check'
fail_on_error: true
clippy_flags: --workspace --all-targets --all-features -- -Dwarnings

fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: risc0/risc0/.github/actions/[email protected]
- run: make fmt
- uses: actions/checkout@v4

- uses: risc0/risc0/.github/actions/[email protected]

- run: make fmt
48 changes: 48 additions & 0 deletions .github/workflows/openapi-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: OpenAPI

on:
push:
branches: ["main"]
pull_request:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy-docs:
name: Generate OpenAPI docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-04-17
profile: minimal

- name: Run docs generation binary
run: ./script/generate-docs.sh

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './openapi'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
Loading

0 comments on commit 5ede08c

Please sign in to comment.