target/
-docs/
\ No newline at end of file
+docs/
+bin/
\ No newline at end of file
config/*\r
build/\r
*.yml\r
+bin/
\ No newline at end of file
"percent-encoding",
]
-[[package]]
-name = "fs_extra"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
-
[[package]]
name = "futures"
version = "0.3.25"
"serde",
"serde_json",
"shared",
- "tikv-jemallocator",
"tokio",
"tokio-stream",
"tracing",
"serde_json",
"shared",
"test-log",
- "tikv-jemallocator",
"tokio",
"tokio-stream",
"tokio-test",
"serde",
"serde_json",
"shared",
- "tikv-jemallocator",
"tokio",
"tokio-stream",
"tonic",
"once_cell",
]
-[[package]]
-name = "tikv-jemalloc-sys"
-version = "0.5.2+5.3.0-patched"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3"
-dependencies = [
- "cc",
- "fs_extra",
- "libc",
-]
-
-[[package]]
-name = "tikv-jemallocator"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979"
-dependencies = [
- "libc",
- "tikv-jemalloc-sys",
-]
-
[[package]]
name = "time"
version = "0.3.17"
"serde",
"serde_json",
"shared",
- "tikv-jemallocator",
"tokio",
"tracing",
"twilight-model",
tracing-opentelemetry = "0.18"\r
opentelemetry = { version = "0.18", features = ["rt-tokio"] }\r
opentelemetry-http = "0.7"\r
-tikv-jemallocator = "0.5"\r
\r
criterion = { version = "0.4", features = ["async_tokio"] }\r
tokio-test = "0.4.2"\r
-FROM rust AS chef
-USER root
-COPY .cargo .cargo
-RUN cargo install cargo-chef
-RUN apt-get update && apt-get install -y protobuf-compiler
-WORKDIR /app
-
-# Planning install
-FROM chef AS planner
+# syntax=docker/dockerfile:1
+FROM --platform=$BUILDPLATFORM tonistiigi/xx:master AS xx
+FROM --platform=$BUILDPLATFORM rust:alpine as alpine_rbuild
+RUN apk add clang lld protobuf-dev build-base git
+# Copy the xx scripts
+COPY --from=xx / /
+# Copy source code
COPY . .
-RUN cargo chef prepare --recipe-path recipe.json
-
-# Building all targets
-FROM chef AS builder
-COPY --from=planner /app/recipe.json recipe.json
-# Notice that we are specifying the --target flag!
-RUN cargo chef cook --release --recipe-path recipe.json
-COPY . .
-RUN cargo build --release
+RUN --mount=type=cache,target=/root/.cargo/git/db \
+ --mount=type=cache,target=/root/.cargo/registry/cache \
+ --mount=type=cache,target=/root/.cargo/registry/index \
+ cargo fetch
+ARG TARGETPLATFORM
+RUN --mount=type=cache,target=/root/.cargo/git/db \
+ --mount=type=cache,target=/root/.cargo/registry/cache \
+ --mount=type=cache,target=/root/.cargo/registry/index \
+ xx-cargo build --release --target-dir ./build
-# Base os
-FROM debian:latest AS runtime-base
-# RUN addgroup -S nova && adduser -S nova -G nova
-RUN apt-get update && apt-get install ca-certificates -y
+#Copy from the build/<target triple>/release folder to the out folder
+RUN mkdir ./out && cp ./build/*/release/* ./out || true
-# Final os
-FROM runtime-base AS runtime
+FROM alpine AS runtime
ARG COMPONENT
ENV COMPONENT=${COMPONENT}
-COPY --from=builder /app/target/release/${COMPONENT} /usr/local/bin/
-# USER nova
+COPY --from=alpine_rbuild /out/${COMPONENT} /usr/local/bin/
ENTRYPOINT /usr/local/bin/${COMPONENT}
x-bake:
platforms:
- linux/amd64
- - linux/arm64
+ - linux/arm64/v8
+ - linux/arm/v7
+ - linux/arm/v6
args:
- COMPONENT=cache
volumes:
x-bake:
platforms:
- linux/amd64
- - linux/arm64
+ - linux/arm64/v8
+ - linux/arm/v7
+ - linux/arm/v6
volumes:
- ./config/default.yml:/config/default.yml
environment:
x-bake:
platforms:
- linux/amd64
- - linux/arm64
+ - linux/arm64/v8
+ - linux/arm/v7
+ - linux/arm/v6
volumes:
- ./config/default.yml:/config/default.yml
environment:
x-bake:
platforms:
- linux/amd64
- - linux/arm64
+ - linux/arm64/v8
+ - linux/arm/v7
+ - linux/arm/v6
volumes:
- ./config/default.yml:/config/default.yml
environment:
x-bake:
platforms:
- linux/amd64
- - linux/arm64
+ - linux/arm64/v8
+ - linux/arm/v7
+ - linux/arm/v6
volumes:
- ./config/default.yml:/config/default.yml
environment:
twilight-model = "0.14"
bytes = "1.3.0"
async-nats = "0.26.0"
-
-[target.'cfg(not(target_os = "windows"))'.dependencies]
-tikv-jemallocator = { workspace = true }
\ No newline at end of file
use gateway::GatewayServer;
use leash::ignite;
-#[cfg(not(target_os = "windows"))]
-use tikv_jemallocator::Jemalloc;
-
-#[cfg(not(target_os = "windows"))]
-#[global_allocator]
-static GLOBAL: Jemalloc = Jemalloc;
-
ignite!(GatewayServer);
test-log = { workspace = true }
env_logger = { workspace = true }
-[target.'cfg(not(target_os = "windows"))'.dependencies]
-tikv-jemallocator = { workspace = true }
-
[[bench]]
name = "bucket"
harness = false
use leash::ignite;
use ratelimit::RatelimiterServerComponent;
-#[cfg(not(target_os = "windows"))]
-use tikv_jemallocator::Jemalloc;
-
-#[cfg(not(target_os = "windows"))]
-#[global_allocator]
-static GLOBAL: Jemalloc = Jemalloc;
-
ignite!(RatelimiterServerComponent);
tonic = "0.8.3"
tokio-stream = "0.1.11"
dns-lookup = "1.0.8"
-
-[target.'cfg(not(target_os = "windows"))'.dependencies]
-tikv-jemallocator = { workspace = true }
\ No newline at end of file
use leash::ignite;
use rest::ReverseProxyServer;
-#[cfg(not(target_os = "windows"))]
-use tikv_jemallocator::Jemalloc;
-
-#[cfg(not(target_os = "windows"))]
-#[global_allocator]
-static GLOBAL: Jemalloc = Jemalloc;
-
ignite!(ReverseProxyServer);
twilight-model = { version = "0.14" }
async-nats = "0.26.0"
-
-[target.'cfg(not(target_os = "windows"))'.dependencies]
-tikv-jemallocator = "0.5"
\ No newline at end of file
use leash::ignite;
use webhook::WebhookServer;
-#[cfg(not(target_os = "windows"))]
-use tikv_jemallocator::Jemalloc;
-
-#[cfg(not(target_os = "windows"))]
-#[global_allocator]
-static GLOBAL: Jemalloc = Jemalloc;
-
ignite!(WebhookServer);