From a77321e2bf65f5b77fd81635575321fb6fc7c907 Mon Sep 17 00:00:00 2001 From: osipovartem Date: Wed, 12 Feb 2025 15:46:08 +0300 Subject: [PATCH 1/4] Combined docker image (init) --- DockerfileCombined | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 DockerfileCombined diff --git a/DockerfileCombined b/DockerfileCombined new file mode 100644 index 00000000..51f99c45 --- /dev/null +++ b/DockerfileCombined @@ -0,0 +1,39 @@ +# Use a multi-stage build to build both frontend and backend + +# Stage 1: Build frontend +FROM node:lts AS frontend-builder +RUN apt-get update && apt-get install -y openssh-client +RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts +WORKDIR /app +RUN --mount=type=ssh git clone git@github.com:Embucket/embucket.git . +RUN npm install -g pnpm +RUN pnpm install + +## Stage 2: Build backend +FROM rust:latest AS builder +RUN update-ca-certificates +WORKDIR /app +COPY ./ . +COPY rest-catalog-open-api.yaml rest-catalog-open-api.yaml +RUN cargo build --release + +# +##################################################################################################### +### Final image +##################################################################################################### +# +FROM debian:bookworm-slim + +# Copy the binary from the builder stage +WORKDIR /app + +RUN apt-get update && apt-get install -y openssl nodejs npm && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /app/target/release/icehutd ./ +COPY --from=builder /app/rest-catalog-open-api.yaml rest-catalog-open-api.yaml +COPY --from=frontend-builder /app ./frontend + +RUN npm install -g serve + +# Command to start both frontend and backend +CMD ["sh", "-c", "./icehutd & serve -s ./frontend"] From d9f2307dfcfac38e6904839f99e503af437916fa Mon Sep 17 00:00:00 2001 From: osipovartem Date: Wed, 12 Feb 2025 15:46:45 +0300 Subject: [PATCH 2/4] Combined docker image (init) --- DockerfileCombined | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DockerfileCombined b/DockerfileCombined index 51f99c45..39efa6ee 100644 --- a/DockerfileCombined +++ b/DockerfileCombined @@ -9,7 +9,7 @@ RUN --mount=type=ssh git clone git@github.com:Embucket/embucket.git . RUN npm install -g pnpm RUN pnpm install -## Stage 2: Build backend +# Stage 2: Build backend FROM rust:latest AS builder RUN update-ca-certificates WORKDIR /app @@ -17,11 +17,9 @@ COPY ./ . COPY rest-catalog-open-api.yaml rest-catalog-open-api.yaml RUN cargo build --release -# ##################################################################################################### ### Final image ##################################################################################################### -# FROM debian:bookworm-slim # Copy the binary from the builder stage From 15058777c090268a32b857819bc49c9b48b408c8 Mon Sep 17 00:00:00 2001 From: osipovartem Date: Fri, 14 Feb 2025 15:07:55 +0300 Subject: [PATCH 3/4] Tmp tyr to build --- DockerfileCombined | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/DockerfileCombined b/DockerfileCombined index 39efa6ee..0a458095 100644 --- a/DockerfileCombined +++ b/DockerfileCombined @@ -5,7 +5,8 @@ FROM node:lts AS frontend-builder RUN apt-get update && apt-get install -y openssh-client RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts WORKDIR /app -RUN --mount=type=ssh git clone git@github.com:Embucket/embucket.git . +ARG GITHUB_TOKEN +RUN git clone https://${GITHUB_TOKEN}@github.com/Embucket/embucket.git . RUN npm install -g pnpm RUN pnpm install @@ -17,21 +18,15 @@ COPY ./ . COPY rest-catalog-open-api.yaml rest-catalog-open-api.yaml RUN cargo build --release -##################################################################################################### -### Final image -##################################################################################################### +# Stage 3: Final image FROM debian:bookworm-slim - -# Copy the binary from the builder stage WORKDIR /app - RUN apt-get update && apt-get install -y openssl nodejs npm && rm -rf /var/lib/apt/lists/* +RUN npm install -g pnpm serve -COPY --from=builder /app/target/release/icehutd ./ +COPY --from=builder /app/target/release/bucketd ./ COPY --from=builder /app/rest-catalog-open-api.yaml rest-catalog-open-api.yaml COPY --from=frontend-builder /app ./frontend -RUN npm install -g serve - # Command to start both frontend and backend -CMD ["sh", "-c", "./icehutd & serve -s ./frontend"] +CMD ["sh", "-c", "./bucketd & cd ./frontend && pnpm codegen && pnpm dev"] \ No newline at end of file From f25295721be49dfae7bb2b6b7496d77f5d82c066 Mon Sep 17 00:00:00 2001 From: osipovartem Date: Mon, 17 Feb 2025 10:51:05 +0300 Subject: [PATCH 4/4] Dockerfile update --- DockerfileCombined | 7 ++++--- crates/nexus/src/http/ui/handlers/query.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DockerfileCombined b/DockerfileCombined index 0a458095..3759e283 100644 --- a/DockerfileCombined +++ b/DockerfileCombined @@ -5,8 +5,9 @@ FROM node:lts AS frontend-builder RUN apt-get update && apt-get install -y openssh-client RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts WORKDIR /app -ARG GITHUB_TOKEN -RUN git clone https://${GITHUB_TOKEN}@github.com/Embucket/embucket.git . +#ARG GITHUB_TOKEN +RUN #git clone https://${GITHUB_TOKEN}@github.com/Embucket/embucket.git . +RUN --mount=type=ssh git clone git@github.com:Embucket/embucket.git . RUN npm install -g pnpm RUN pnpm install @@ -29,4 +30,4 @@ COPY --from=builder /app/rest-catalog-open-api.yaml rest-catalog-open-api.yaml COPY --from=frontend-builder /app ./frontend # Command to start both frontend and backend -CMD ["sh", "-c", "./bucketd & cd ./frontend && pnpm codegen && pnpm dev"] \ No newline at end of file +CMD ["sh", "-c", "./bucketd & cd ./frontend && pnpm i && pnpm codegen && pnpm dev"] \ No newline at end of file diff --git a/crates/nexus/src/http/ui/handlers/query.rs b/crates/nexus/src/http/ui/handlers/query.rs index daa0f981..d147fae7 100644 --- a/crates/nexus/src/http/ui/handlers/query.rs +++ b/crates/nexus/src/http/ui/handlers/query.rs @@ -28,7 +28,7 @@ pub struct ApiDoc; post, path = "/ui/query", request_body = QueryPayload, - operation_id = "query", + operation_id = "runQuery", tags = ["query"], responses( (status = 200, description = "Returns result of the query", body = QueryResponse),