-
Notifications
You must be signed in to change notification settings - Fork 119
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
golang v3 wrappers #564
golang v3 wrappers #564
Changes from all commits
f08b5bb
9e057c8
17732ea
81644fc
279cdc6
6336e74
fb707d5
e4eda89
46e6c20
91ac666
877018c
53f34aa
8411ed1
3ac9811
1eb6a7e
d2f8c30
0d22e9b
a7ca5dd
c7863d4
01b1dde
fb971bb
7476f6f
572aa23
43dc99d
0cb0b49
65d6671
8852c9b
88cfe1b
10f472c
8d17a9b
957c79d
ce7ca31
7da5d76
3c9a0ea
454dbd0
b9f3e12
a73c150
3a5c2d9
9854bb2
96898de
47bf7c6
2f59425
674c37f
9b00697
9f08507
e5dc550
a044618
a61df72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
name: GoLang | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- V3 | ||
- yshekel/V3 # TODO remove when merged to V3 | ||
push: | ||
branches: | ||
- V3 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-changed-files: | ||
uses: ./.github/workflows/check-changed-files.yml | ||
|
||
check-format: | ||
name: Check Code Format | ||
runs-on: ubuntu-22.04 | ||
needs: check-changed-files | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.20.0' | ||
- name: Check gofmt | ||
if: needs.check-changed-files.outputs.golang == 'true' | ||
run: if [[ $(go list ./... | xargs go fmt) ]]; then echo "Please run go fmt"; exit 1; fi | ||
|
||
extract-cuda-backend-branch: | ||
name: Extract cuda branch name | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
cuda-backend-branch: ${{ steps.extract.outputs.cuda-backend-branch }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Extract Private Branch from PR Description | ||
id: extract | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
DESCRIPTION=$(gh pr view ${{ github.event.pull_request.number }} --json body -q '.body') | ||
echo "PR Description: $DESCRIPTION" | ||
CUDA_BE_BRANCH=$(echo "$DESCRIPTION" | grep -oP 'cuda-backend-branch:\s*\K[^\s]+') || true | ||
if [ -z "$CUDA_BE_BRANCH" ]; then | ||
CUDA_BE_BRANCH="main" # Default branch if not specified | ||
fi | ||
echo "Extracted CUDA Backend Branch: $CUDA_BE_BRANCH" | ||
echo "::set-output name=cuda-backend-branch::$CUDA_BE_BRANCH" | ||
|
||
build-curves-linux: | ||
name: Build and test curves on Linux | ||
runs-on: [self-hosted, Linux, X64, icicle] | ||
needs: [check-changed-files, check-format, extract-cuda-backend-branch] | ||
strategy: | ||
matrix: | ||
curve: | ||
- name: bn254 | ||
build_args: -g2 -ecntt | ||
- name: bls12_381 | ||
build_args: -g2 -ecntt | ||
- name: bls12_377 | ||
build_args: -g2 -ecntt | ||
- name: bw6_761 | ||
build_args: -g2 -ecntt | ||
- name: grumpkin | ||
build_args: | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
- name: Checkout CUDA Backend | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ingonyama-zk/icicle-cuda-backend | ||
path: ./icicle_v3/backend/cuda | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
ssh-key: ${{ secrets.CUDA_PULL_KEY }} | ||
ref: ${{ needs.extract-branch.outputs.cuda-backend-branch }} | ||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.20.0' | ||
- name: Build | ||
working-directory: ./wrappers/golang_v3 | ||
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
# builds a single curve with the curve's specified build args | ||
run: | | ||
export DEFAULT_BACKEND_INSTALL_DIR=$PWD/../../build/ | ||
./build.sh -curve=${{ matrix.curve.name }} ${{ matrix.curve.build_args }} -cuda_backend=local | ||
- name: Test | ||
working-directory: ./wrappers/golang_v3/curves | ||
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
run: | | ||
CURVE=$(echo ${{ matrix.curve.name }} | sed -e 's/_//g') | ||
export CPATH=$CPATH:/usr/local/cuda/include | ||
export DEFAULT_BACKEND_INSTALL_DIR=$PWD/../../../build/ | ||
go test ./$CURVE/tests -count=1 -failfast -p 2 -timeout 60m -v | ||
|
||
build-fields-linux: | ||
name: Build and test fields on Linux | ||
runs-on: [self-hosted, Linux, X64, icicle] | ||
needs: [check-changed-files, check-format, extract-cuda-backend-branch] | ||
strategy: | ||
matrix: | ||
field: | ||
- name: babybear | ||
build_args: -field-ext | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
- name: Checkout CUDA Backend | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ingonyama-zk/icicle-cuda-backend | ||
path: ./icicle_v3/backend/cuda | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
ssh-key: ${{ secrets.CUDA_PULL_KEY }} | ||
ref: ${{ needs.extract-branch.outputs.cuda-backend-branch }} | ||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.20.0' | ||
- name: Build | ||
working-directory: ./wrappers/golang_v3 | ||
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
# builds a single field with the fields specified build args | ||
run: | | ||
export DEFAULT_BACKEND_INSTALL_DIR=$PWD/../../build/ | ||
./build.sh -field=${{ matrix.field.name }} ${{ matrix.field.build_args }} -cuda_backend=local | ||
- name: Test | ||
working-directory: ./wrappers/golang_v3/fields | ||
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
run: | | ||
FIELD=$(echo ${{ matrix.field.name }} | sed -e 's/_//g') | ||
export CPATH=$CPATH:/usr/local/cuda/include | ||
export DEFAULT_BACKEND_INSTALL_DIR=$PWD/../../../build/ | ||
go test ./$FIELD/tests -count=1 -failfast -p 2 -timeout 60m -v | ||
|
||
# build-hashes-linux: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are hashes not supported in v3 rn? This specific check only runs keccak There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't have hashes in v3 for now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets remove this for now then |
||
# name: Build and test hashes on Linux | ||
# runs-on: [self-hosted, Linux, X64, icicle] | ||
# needs: [check-changed-files, check-format] | ||
# strategy: | ||
# matrix: | ||
# hash: | ||
# - name: keccak | ||
# build_args: | ||
# steps: | ||
# - name: Checkout Repo | ||
# uses: actions/checkout@v4 | ||
# - name: Setup go | ||
# uses: actions/setup-go@v5 | ||
# with: | ||
# go-version: '1.20.0' | ||
# - name: Build | ||
# working-directory: ./wrappers/golang_v3 | ||
# if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
# # builds a single hash algorithm with the hash's specified build args | ||
# run: ./build.sh -hash=${{ matrix.hash.name }} ${{ matrix.hash.build_args }} | ||
# - name: Test | ||
# working-directory: ./wrappers/golang_v3/hash | ||
# if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
# run: | | ||
# HASH=$(echo ${{ matrix.hash.name }} | sed -e 's/_//g') | ||
# export CPATH=$CPATH:/usr/local/cuda/include | ||
# go test ./$HASH/tests -count=1 -failfast -p 2 -timeout 60m -v | ||
|
||
# TODO: bw6 on windows requires more memory than the standard runner has | ||
# Add a large runner and then enable this job | ||
# build-windows: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about the Windows build? Should'nt we just remove this at this point? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ➕ for removing |
||
# name: Build on Windows | ||
# runs-on: windows-2022 | ||
# needs: [check-changed-files, check-format] | ||
# strategy: | ||
# matrix: | ||
# curve: [bn254, bls12_381, bls12_377, bw6_761] | ||
# steps: | ||
# - name: Checkout Repo | ||
# uses: actions/checkout@v4 | ||
# - name: Setup go | ||
# uses: actions/setup-go@v5 | ||
# with: | ||
# go-version: '1.20.0' | ||
# - name: Download and Install Cuda | ||
# if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
# id: cuda-toolkit | ||
# uses: Jimver/[email protected] | ||
# with: | ||
# cuda: '12.0.0' | ||
# method: 'network' | ||
# # https://docs.nvidia.com/cuda/archive/12.0.0/cuda-installation-guide-microsoft-windows/index.html | ||
# sub-packages: '["cudart", "nvcc", "thrust", "visual_studio_integration"]' | ||
# - name: Build libs | ||
# if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
# working-directory: ./wrappers/golang | ||
# env: | ||
# CUDA_PATH: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }} | ||
# shell: pwsh | ||
# run: ./build.ps1 ${{ matrix.curve }} ON # builds a single curve with G2 enabled |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
uses: actions/checkout@v4 | ||
- name: Check rustfmt | ||
if: needs.check-changed-files.outputs.rust == 'true' || needs.check-changed-files.outputs.cpp_cuda == 'true' | ||
working-directory: ./wrappers/rust | ||
working-directory: ./wrappers/rust_v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
# "-name target -prune" removes searching in any directory named "target" | ||
# Formatting by single file is necessary due to generated files not being present | ||
# before building the project. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to golang without v3_golang