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 client and server APIs #62

Merged
merged 44 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
aa75f85
add a benchmark sketch
piotr-roslaniec Jan 24, 2023
6c28d48
benchmark size of pvss transcripts
piotr-roslaniec Jan 27, 2023
feb8d80
benchmark per ratio with no duplicates
piotr-roslaniec Jan 27, 2023
076f261
fix switched columns
piotr-roslaniec Jan 27, 2023
6966b28
set polynomial degree to t-1 in pvss
piotr-roslaniec Jan 27, 2023
6f1b7d4
size is expressed in bytes
piotr-roslaniec Jan 30, 2023
33b2b09
update tpke client api
piotr-roslaniec Jan 30, 2023
9b0a4c6
setup ferveo-python for server api
piotr-roslaniec Jan 31, 2023
c85ea43
remove dependency on block time
piotr-roslaniec Feb 1, 2023
5ba7451
sketch the server api
piotr-roslaniec Feb 2, 2023
39f7f39
simple tdec on server side
piotr-roslaniec Feb 6, 2023
fd47f97
add ferveo-python example
piotr-roslaniec Feb 6, 2023
58515cf
Merge pull request #48 from nucypher/benchmark-primitives-size
piotr-roslaniec Feb 6, 2023
81ea692
support server-side persistance
piotr-roslaniec Feb 7, 2023
7257843
simple tdec on client side fails
piotr-roslaniec Feb 9, 2023
d287129
refactor module visibility
piotr-roslaniec Feb 9, 2023
2e6b231
update client api tests
piotr-roslaniec Feb 9, 2023
6d92b01
fix import style
piotr-roslaniec Feb 10, 2023
1cc35b4
add simple tdec to wasm bindings
piotr-roslaniec Feb 10, 2023
aa39d7a
update after rebase
piotr-roslaniec Feb 13, 2023
d588cc8
update dev deps settings
piotr-roslaniec Feb 10, 2023
b1999b8
update arkworks to 0.4.0 - first pass
piotr-roslaniec Feb 14, 2023
8d5bef8
Merge branch 'ferveo-light-tdec' into client-server-api
piotr-roslaniec Feb 15, 2023
faae420
fix cargo-udeps-action not working on stable
piotr-roslaniec Feb 15, 2023
eb9322b
remove unused crate
piotr-roslaniec Feb 15, 2023
3040970
replace unmaintained rust-crypto crate with sha2
piotr-roslaniec Feb 15, 2023
ed88c8b
Merge branch 'client-server-api' into arkworks-0.4
piotr-roslaniec Feb 15, 2023
f876b85
remove unused crates
piotr-roslaniec Feb 15, 2023
2d926de
self review
piotr-roslaniec Feb 15, 2023
a9b4331
replace unwrap calls with result type
piotr-roslaniec Feb 15, 2023
0b95048
trim external apis
piotr-roslaniec Feb 16, 2023
b9535fe
refactor serialization
piotr-roslaniec Feb 17, 2023
c8f9f57
add tpke-wasm api example
piotr-roslaniec Feb 20, 2023
1317593
add yarn test to ci
piotr-roslaniec Feb 20, 2023
af9505d
fix benchmarks not running on ci
piotr-roslaniec Feb 21, 2023
a68d2d9
sketch error handling in ferveo
piotr-roslaniec Feb 21, 2023
b38b336
add browser example for tpke-wasm
piotr-roslaniec Feb 21, 2023
0c45434
seup wheels ci job for ferveo-python
piotr-roslaniec Feb 21, 2023
8e6f391
fix cargo-udeps error
piotr-roslaniec Feb 23, 2023
707f460
Merge branch 'error-handling' into tpke-wasm-api-example
piotr-roslaniec Feb 23, 2023
59ba443
remove cargo-udeps from ci
piotr-roslaniec Feb 23, 2023
093f17e
Merge pull request #68 from nucypher/error-handling
piotr-roslaniec Feb 27, 2023
a6caaad
Merge pull request #72 from piotr-roslaniec/tpke-wasm-api-example
piotr-roslaniec Feb 27, 2023
bd78f97
Merge pull request #67 from nucypher/arkworks-0.4
piotr-roslaniec Feb 27, 2023
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
139 changes: 139 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Adopted from: https://github.com/nucypher/rust-umbral/blob/master/.github/workflows/wheels.yml

name: Wheels

on: workflow_dispatch

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest, macos-11 ]

env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel"
CIBW_BEFORE_BUILD_LINUX: "pip3 install --upgrade keyrings.alt"
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"'
CIBW_SKIP: "cp36-* pp* *-win32 *musllinux*" # only using manylinux to build

steps:
- uses: actions/checkout@v2

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

- if: runner.os == 'Windows'
run: |
echo 'PATH=/c/Python38:/c/Python38/Scripts:/c/Strawberry/perl/site/bin:/c/Strawberry/perl/bin:/c/Strawberry/c/bin:$PATH' >> $GITHUB_ENV
echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >> $GITHUB_ENV
echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >> $GITHUB_ENV
echo 'CIBW_BEFORE_BUILD=python -m pip install --upgrade pip' >> $GITHUB_ENV
- if: runner.os != 'Linux'
name: Setup env when not using docker
run: |
python -m pip install --upgrade wheel setuptools setuptools-rust
- if: runner.os == 'Linux'
name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: arm64

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'

- name: Install cibuildwheel
run: |
# Install cibuildwheel from git for CIBW_ARCHS_LINUX support
python -m pip install cibuildwheel==2.9.0

- if: runner.os == 'Linux'
run: |
cp -r ./ferveo ./ferveo-python/ferveo
cp -r ./ferveo-common ./ferveo-python/ferveo-common
cp -r ./tpke ./ferveo-python/tpke

- if: runner.os == 'Linux'
working-directory: ./ferveo-python
name: Relocate dependencies in cargo.toml
run: |
sed -i 's/..\/ferveo/.\/ferveo/g' Cargo.toml
sed -i 's/..\/tpke/.\/tpke/g' Cargo.toml

- name: Build wheels
working-directory: ./ferveo-python
run: |
pwd
ls -la
cd ferveo-python && python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v2
with:
path: ./ferveo-python/wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'

- name: Install setuptools and setuptools-rust
working-directory: ./ferveo-python
run: |
python -m pip install --upgrade wheel setuptools setuptools-rust

# Assuming here that the version of the Python bindings
# is matched to the version of the main Rust crate (as it should be at all times),
# and we are running this at a release commit.
- name: Replace the relative path to `ferveo` in Cargo.toml with the specific version
working-directory: ./ferveo-python
run: python replace_version.py relative-to-published

- name: Build sdist
working-directory: ./ferveo-python
run: python setup.py sdist

# Roll back the changes
- name: Replace the specific version of `ferveo` in Cargo.toml with the relative path
if: always()
working-directory: ./ferveo-python
run: python replace_version.py published-to-relative

- uses: actions/upload-artifact@v2
with:
path: ./ferveo-python/dist/*.tar.gz

upload_pypi:
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: actions/download-artifact@v2
with:
name: artifact
path: wheelhouse

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
54 changes: 53 additions & 1 deletion .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,56 @@ jobs:
- run: cargo check --all-features
- run: cargo test --release --all-features

wasm-test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.63 # MSRV
- stable
target:
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- run: cargo install wasm-pack
- run: wasm-pack test --node
working-directory: tpke-wasm

yarn-test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
target:
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- run: cargo install wasm-pack
- run: wasm-pack build --target nodejs
working-directory: tpke-wasm
- uses: borales/actions-yarn@v3.0.0
with:
cmd: --cwd tpke-wasm/examples/node install
- uses: borales/actions-yarn@v3.0.0
with:
cmd: --cwd tpke-wasm/examples/node build
- uses: borales/actions-yarn@v3.0.0
with:
cmd: --cwd tpke-wasm/examples/node test

codecov:
runs-on: ubuntu-latest
needs: [ test ]
Expand Down Expand Up @@ -128,10 +178,12 @@ jobs:
restore-keys: ${{ runner.os }}-cargo-
- name: Run benchmark for base branch comparison
uses: boa-dev/criterion-compare-action@v3
if: github.event_name == 'pull_request'
# Only PRs to main
if: github.event_name == 'pull_request' && github.ref == 'refs/heads/main' && github.repository == 'nucypher/ferveo'
with:
cwd: ${{ matrix.component }}
branchName: ${{ github.base_ref }}
features: "test-common"

# The next steps have been adapted from https://raw.githubusercontent.com/unicode-org/icu4x/main/.github/workflows/build-test.yml

Expand Down
Loading