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

feat: Forward ports to testnest v1.0.7 #99

Merged
merged 10 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/target
Dockerfile*
.dockerignore
.git
.gitignore
examples
tests
sp1up
book
102 changes: 102 additions & 0 deletions .github/workflows/docker-publish-gnark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Source: https://raw.githubusercontent.com/foundry-rs/foundry/master/.github/workflows/docker-publish.yml
name: docker-gnark

on:
push:
tags:
- "v*.*.*"
schedule:
- cron: "0 0 * * *"
# Trigger without any parameters a proactive rebuild
workflow_dispatch:
inputs:
tags:
description: "Docker tag to push"
required: true
workflow_call:

env:
REGISTRY: ghcr.io
IMAGE_NAME: succinctlabs/sp1-gnark

jobs:
container:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow
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
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# Ensure this doesn't trigger on PR's
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
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@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# 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
run: |
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
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
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
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@v3
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'] }}
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- name: Run cargo test with no default features
run: |
cargo nextest run -p sphinx-core --cargo-profile dev-ci --profile ci --no-default-features --features "debug" -E 'test(cpu::trace::tests)'
working-directory: ${{ github.workspace }}/examples

test-recursion-circuit:
name: Test recursion circuit
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pgo-data.profdata
.DS_Store

# Proofs
**/proof-with-pis.json
**/proof-with-io.json
**/proof-with-pis.bin
**/proof-with-io.bin

# Benchmark
benchmark.csv
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
// "examples/tendermint/script/Cargo.toml",
// // Tests.
// "examples/ed25519/Cargo.toml",
// "tests/blake3-compress/Cargo.toml",
// "tests/cycle-tracker/Cargo.toml",
// "tests/ecrecover/Cargo.toml",
// "tests/ed-add/Cargo.toml",
Expand Down
Loading