Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
12 changes: 12 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ jobs:
- 'mpcs/**'
- 'docker/deep-prove-worker.dockerfile'
- '.github/workflows/docker.yml'
deep-prove-aws-client:
- 'zkml/**'
- 'deep-prove/**'
- 'mpcs/**'
- 'docker/deep-prove-aws-client.dockerfile'
- '.github/workflows/docker.yml'
deep-prove-aws-worker:
- 'zkml/**'
- 'deep-prove/**'
- 'mpcs/**'
- 'docker/deep-prove-aws-worker.dockerfile'
- '.github/workflows/docker.yml'
build:
name: Build Docker Image
needs: changes
Expand Down
2 changes: 1 addition & 1 deletion deep-prove/src/bin/cli/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub async fn connect(executor: Executor) -> anyhow::Result<()> {
let body = resp
.body_mut()
.with_config()
.limit(1000 * 1024 * 1024)
.limit(200 * 1024 * 1024)
.read_to_vec()?;
file.write_all(&body)?;
info!("proof received, saved to {}", file.path().display());
Expand Down
4 changes: 2 additions & 2 deletions deep-prove/src/bin/worker/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub async fn serve(args: RunMode) -> anyhow::Result<()> {
#[derive(Default)]
struct AppState {
work_queue: Vec<DeepProveRequestV1>,
proofs_queue: Vec<Vec<ProofV1>>,
proofs_queue: Vec<ProofV1>,
}

let RunMode::LocalApi {
Expand Down Expand Up @@ -87,7 +87,7 @@ pub async fn serve(args: RunMode) -> anyhow::Result<()> {
match result {
Ok(proofs) => {
info!("proof generated in {}s", now.elapsed().as_secs());
app_state.lock().await.proofs_queue.push(proofs);
app_state.lock().await.proofs_queue.extend(proofs);
}
Err(err) => error!("failed to generate proof: {err:?}"),
}
Expand Down
2 changes: 1 addition & 1 deletion deep-prove/src/bin/worker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ enum RunMode {
json: bool,

/// The maximal proof request size to accept (in MB)
#[arg(long, env, default_value_t = 100)]
#[arg(long, env, default_value_t = 200)]
max_body_size: usize,
},
}
Expand Down
28 changes: 28 additions & 0 deletions docker/deep-prove-aws-client.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM rustlang/rust:nightly-slim AS builder
RUN apt-get update && apt-get install -y git protobuf-compiler libssl-dev pkg-config

WORKDIR /deep-prove-client
COPY . .

RUN cargo install --locked --path deep-prove --bin deep-prove-client
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can either change this to deep-prove-cli, or change https://github.com/Lagrange-Labs/deep-prove/blob/master/deep-prove/Cargo.toml#L26 to deep-prove-client

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

19.31 Caused by:
19.31 no bin target named deep-prove-client in path+file:///deep-prove-client/deep-prove#0.1.0 package
19.31
19.31 help: a target with a similar name exists: deep-prove-cli

deep-prove-aws-client.dockerfile:7

5 | COPY . .
6 |
7 | >>> RUN cargo install --locked --path deep-prove --bin deep-prove-client
8 |
9 |

ERROR: failed to build: failed to solve: process "/bin/sh -c cargo install --locked --path deep-prove --bin deep-prove-client" did not complete successfully: exit code: 101



# Create the actual final image
FROM docker.io/library/ubuntu:22.04

ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g ${GROUP_ID} lagrange && \
useradd -m -u ${USER_ID} -g lagrange lagrange

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y libssl3 ca-certificates && \
update-ca-certificates && \
rm -rf /var/lib/apt/lists/*

COPY --from=builder /usr/local/cargo/bin/deep-prove-client /usr/local/bin
ENV RUST_BACKTRACE=full
USER lagrange
ENTRYPOINT ["/usr/local/bin/deep-prove-client", "local-api"]
CMD ["fetch"]
28 changes: 28 additions & 0 deletions docker/deep-prove-aws-worker.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM rustlang/rust:nightly-slim AS builder
RUN apt-get update && apt-get install -y git protobuf-compiler libssl-dev pkg-config

WORKDIR /deep-prove-worker
COPY . .

RUN cargo install --locked --path deep-prove --bin deep-prove-worker


# Create the actual final image
FROM docker.io/library/ubuntu:22.04

ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g ${GROUP_ID} lagrange && \
useradd -m -u ${USER_ID} -g lagrange lagrange

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y libssl3 ca-certificates && \
update-ca-certificates && \
rm -rf /var/lib/apt/lists/*

COPY --from=builder /usr/local/cargo/bin/deep-prove-worker /usr/local/bin
EXPOSE 8080
ENV RUST_BACKTRACE=full
USER lagrange
CMD ["/usr/local/bin/deep-prove-worker", "local-api"]
Loading