Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
--secret id=DEPOT_TOKEN,env=DEPOT_TOKEN \
--build-arg BUILD_TARGET=${{ matrix.build_target }} \
--build-arg BUILD_MODE=${{ steps.mode.outputs.build_mode }} \
--build-arg BUILD_FRONTEND=false \
--build-arg BUILD_FRONTEND=${{ matrix.build_target == 'engine' && 'true' || 'false' }} \
-f ${{ matrix.docker }} \
-t builder-${{ matrix.build_target }}-${{ matrix.platform }} \
--load \
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
echo "build_frontend=true" >> $GITHUB_OUTPUT
else
echo "cargo_build_mode=debug" >> $GITHUB_OUTPUT
echo "build_frontend=false" >> $GITHUB_OUTPUT
echo "build_frontend=true" >> $GITHUB_OUTPUT
fi
- uses: ./.github/actions/docker-setup
with:
Expand Down
7 changes: 2 additions & 5 deletions docker/build/darwin-arm64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG BUILD_TARGET=engine
ARG BUILD_MODE=release
ARG BUILD_FRONTEND=false
ARG VITE_APP_API_URL=__SAME__
ARG VITE_FEATURE_FLAGS=

ENV BINDGEN_EXTRA_CLANG_ARGS_aarch64_apple_darwin="--sysroot=/root/osxcross/target/SDK/MacOSX11.3.sdk -isystem /root/osxcross/target/SDK/MacOSX11.3.sdk/usr/include" \
CFLAGS_aarch64_apple_darwin="-B/root/osxcross/target/bin" \
Expand All @@ -35,11 +36,7 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
export NODE_OPTIONS="--max-old-space-size=8192" && \
export SKIP_NAPI_BUILD=1 && \
pnpm install --ignore-scripts && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
else \
npx turbo build:engine -F @rivetkit/engine-frontend; \
fi; \
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" npx turbo build -F @rivetkit/engine-frontend; \
fi

RUN --mount=type=cache,id=cargo-registry-darwin-arm64,target=/usr/local/cargo/registry,sharing=locked \
Expand Down
7 changes: 2 additions & 5 deletions docker/build/darwin-x64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG BUILD_TARGET=engine
ARG BUILD_MODE=release
ARG BUILD_FRONTEND=false
ARG VITE_APP_API_URL=__SAME__
ARG VITE_FEATURE_FLAGS=

ENV BINDGEN_EXTRA_CLANG_ARGS_x86_64_apple_darwin="--sysroot=/root/osxcross/target/SDK/MacOSX11.3.sdk -isystem /root/osxcross/target/SDK/MacOSX11.3.sdk/usr/include" \
CFLAGS_x86_64_apple_darwin="-B/root/osxcross/target/bin" \
Expand All @@ -35,11 +36,7 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
export NODE_OPTIONS="--max-old-space-size=8192" && \
export SKIP_NAPI_BUILD=1 && \
pnpm install --ignore-scripts && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
else \
npx turbo build:engine -F @rivetkit/engine-frontend; \
fi; \
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" npx turbo build -F @rivetkit/engine-frontend; \
fi

RUN --mount=type=cache,id=cargo-registry-darwin-x64,target=/usr/local/cargo/registry,sharing=locked \
Expand Down
7 changes: 2 additions & 5 deletions docker/build/linux-arm64-gnu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG BUILD_TARGET=engine
ARG BUILD_MODE=release
ARG BUILD_FRONTEND=false
ARG VITE_APP_API_URL=__SAME__
ARG VITE_FEATURE_FLAGS=

ENV RUSTFLAGS="--cfg tokio_unstable"
ENV RUSTC_WRAPPER=sccache \
Expand All @@ -22,11 +23,7 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
export NODE_OPTIONS="--max-old-space-size=8192" && \
export SKIP_NAPI_BUILD=1 && \
pnpm install --ignore-scripts && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
else \
npx turbo build:engine -F @rivetkit/engine-frontend; \
fi; \
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" npx turbo build -F @rivetkit/engine-frontend; \
fi

RUN --mount=type=cache,id=cargo-registry-linux-arm64-gnu,target=/usr/local/cargo/registry,sharing=locked \
Expand Down
7 changes: 2 additions & 5 deletions docker/build/linux-arm64-musl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG BUILD_TARGET=engine
ARG BUILD_MODE=release
ARG BUILD_FRONTEND=false
ARG VITE_APP_API_URL=__SAME__
ARG VITE_FEATURE_FLAGS=

ENV OPENSSL_DIR=/musl-aarch64 \
OPENSSL_INCLUDE_DIR=/musl-aarch64/include \
Expand All @@ -28,11 +29,7 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
export NODE_OPTIONS="--max-old-space-size=8192" && \
export SKIP_NAPI_BUILD=1 && \
pnpm install --ignore-scripts && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
else \
npx turbo build:engine -F @rivetkit/engine-frontend; \
fi; \
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" npx turbo build -F @rivetkit/engine-frontend; \
fi

RUN --mount=type=cache,id=cargo-registry-linux-arm64-musl,target=/usr/local/cargo/registry,sharing=locked \
Expand Down
8 changes: 3 additions & 5 deletions docker/build/linux-x64-gnu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# BUILD_TARGET - "engine" or "rivetkit-napi"
# BUILD_MODE - "debug" (fast) or "release" (optimized)
# BUILD_FRONTEND - "true" or "false" (engine only)
# VITE_FEATURE_FLAGS - comma-separated frontend features. Empty means engine UI.
#
# Base image: docker/builder-base/linux-gnu.Dockerfile
# Rebuild base: scripts/docker-builder-base/build-push.sh linux-gnu --push
Expand All @@ -15,6 +16,7 @@ ARG BUILD_TARGET=engine
ARG BUILD_MODE=release
ARG BUILD_FRONTEND=false
ARG VITE_APP_API_URL=__SAME__
ARG VITE_FEATURE_FLAGS=

ENV RUSTFLAGS="--cfg tokio_unstable"

Expand All @@ -30,11 +32,7 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
export NODE_OPTIONS="--max-old-space-size=8192" && \
export SKIP_NAPI_BUILD=1 && \
pnpm install --ignore-scripts && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
else \
npx turbo build:engine -F @rivetkit/engine-frontend; \
fi; \
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" npx turbo build -F @rivetkit/engine-frontend; \
fi

# Build binary.
Expand Down
7 changes: 2 additions & 5 deletions docker/build/linux-x64-musl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG BUILD_TARGET=engine
ARG BUILD_MODE=release
ARG BUILD_FRONTEND=false
ARG VITE_APP_API_URL=__SAME__
ARG VITE_FEATURE_FLAGS=

ENV OPENSSL_DIR=/musl-x86_64 \
OPENSSL_INCLUDE_DIR=/musl-x86_64/include \
Expand All @@ -27,11 +28,7 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
export NODE_OPTIONS="--max-old-space-size=8192" && \
export SKIP_NAPI_BUILD=1 && \
pnpm install --ignore-scripts && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
else \
npx turbo build:engine -F @rivetkit/engine-frontend; \
fi; \
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" npx turbo build -F @rivetkit/engine-frontend; \
fi

RUN --mount=type=cache,id=cargo-registry-linux-x64-musl,target=/usr/local/cargo/registry,sharing=locked \
Expand Down
7 changes: 2 additions & 5 deletions docker/build/windows-x64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ARG BUILD_TARGET=engine
ARG BUILD_MODE=release
ARG BUILD_FRONTEND=false
ARG VITE_APP_API_URL=__SAME__
ARG VITE_FEATURE_FLAGS=

# Windows-specific build flags:
# - lld linker is ~5x faster than MinGW's default ld for big Rust binaries.
Expand All @@ -35,11 +36,7 @@ RUN if [ "$BUILD_TARGET" = "engine" ] && [ "$BUILD_FRONTEND" = "true" ]; then \
export NODE_OPTIONS="--max-old-space-size=8192" && \
export SKIP_NAPI_BUILD=1 && \
pnpm install --ignore-scripts && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" npx turbo build:engine -F @rivetkit/engine-frontend; \
else \
npx turbo build:engine -F @rivetkit/engine-frontend; \
fi; \
VITE_APP_API_URL="${VITE_APP_API_URL}" VITE_FEATURE_FLAGS="${VITE_FEATURE_FLAGS}" npx turbo build -F @rivetkit/engine-frontend; \
fi

RUN --mount=type=cache,id=cargo-registry-windows-x64,target=/usr/local/cargo/registry,sharing=locked \
Expand Down
5 changes: 3 additions & 2 deletions docker/engine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FROM ghcr.io/rivet-dev/rivet/engine-base-builder:a36b881 AS builder
# Docker automatically provides TARGETARCH
ARG TARGETARCH

ARG BUILD_FRONTEND=false
ARG VITE_FEATURE_FLAGS=
ARG CARGO_BUILD_MODE=debug
ARG VITE_APP_API_URL=__SAME__
Expand All @@ -21,9 +22,9 @@ COPY . .
# `lefthook install`, which needs a .git directory (excluded by
# .dockerignore). lefthook is a dev-only git hook manager and has no
# place inside the Docker build. SKIP_NAPI_BUILD=1 tells
# @rivetkit/rivetkit-napi to skip its napi build — the frontend only
# @rivetkit/rivetkit-napi to skip its napi build. The frontend only
# consumes the TypeScript surface, not the runtime .node binary.
RUN if [ -n "$VITE_FEATURE_FLAGS" ]; then \
RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
export NODE_OPTIONS="--max-old-space-size=8192" && \
export SKIP_NAPI_BUILD=1 && \
pnpm install --ignore-scripts && \
Expand Down
Loading