Update build

This commit is contained in:
William Brown 2021-02-17 18:36:28 +10:00
parent f710e66f64
commit 483aa6f23d
7 changed files with 279 additions and 208 deletions

433
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -12,14 +12,14 @@ help:
buildx/kanidmd: ## build multiarch server images
buildx/kanidmd:
echo @docker buildx build --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(ARGS) .
@docker buildx build --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(ARGS) .
@docker buildx imagetools inspect $(IMAGE_BASE)/server:$(IMAGE_VERSION)
echo @docker buildx build $(EXT_OPTS) --pull --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(ARGS) .
@docker buildx build $(EXT_OPTS) --pull --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(ARGS) .
@docker buildx imagetools $(EXT_OPTS) inspect $(IMAGE_BASE)/server:$(IMAGE_VERSION)
buildx/radiusd: ## build multiarch radius images
buildx/radiusd:
@docker buildx build --push --platform $(IMAGE_ARCH) -f kanidm_rlm_python/Dockerfile -t $(IMAGE_BASE)/radius:$(IMAGE_VERSION) kanidm_rlm_python
@docker buildx imagetools inspect $(IMAGE_BASE)/radius:$(IMAGE_VERSION)
@docker buildx build $(EXT_OPTS) --pull --push --platform $(IMAGE_ARCH) -f kanidm_rlm_python/Dockerfile -t $(IMAGE_BASE)/radius:$(IMAGE_VERSION) kanidm_rlm_python
@docker buildx imagetools $(EXT_OPTS) inspect $(IMAGE_BASE)/radius:$(IMAGE_VERSION)
buildx: buildx/kanidmd buildx/radiusd

View file

@ -24,11 +24,10 @@ path = "src/server/main.rs"
# name = "kanidm_benchmark"
# harness = false
[dependencies]
kanidm_proto = { path = "../kanidm_proto", version = "1.1.0-alpha" }
jemallocator = "0.3.0"
jemallocator = { version = "0.3.0", optional = true }
url = "2.1"
tide = "0.15"
@ -72,9 +71,6 @@ time = { version = "0.2", features = ["serde", "std"] }
hashbrown = "0.9"
concread = "^0.2.5"
# concread = { version = "^0.2.5", features = ["simd_support"] }
# concread = { path = "../../concread" }
# concread = { path = "../../concread", features = ["asynch"] }
# crossbeam = "0.7"
sshkeys = "0.3"
@ -99,6 +95,7 @@ users = "0.11"
smartstring = { version = "0.2", features = ["serde"] }
[features]
simd_support = [ "concread/simd_support" ]
# default = [ "libsqlite3-sys/bundled", "openssl/vendored" ]
[dev-dependencies]

View file

@ -3,6 +3,7 @@ FROM ${BASE_IMAGE} AS builder
LABEL mantainer william@blackhats.net.au
RUN zypper -vv ref && \
zypper dup -y && \
zypper install -y \
cargo \
rust \
@ -41,7 +42,7 @@ RUN if [ "$(uname -m)" == "x86_64" ]; \
echo $RUSTFLAGS && \
echo $CC && \
cargo build \
--features=concread/simd_support,libsqlite3-sys/bundled \
--features=simd_support,libsqlite3-sys/bundled \
--release; \
if [ "${SCCACHE_REDIS}" != "" ]; \
then sccache -s; \
@ -53,6 +54,7 @@ FROM ${BASE_IMAGE}
LABEL mantainer william@blackhats.net.au
RUN zypper ref && \
zypper dup -y && \
zypper install -y \
timezone \
sqlite3 \

29
kanidmd/builder.sh Normal file
View file

@ -0,0 +1,29 @@
#!/bin/bash
if [ "$(uname -m)" == "x86_64" ]; \
then export RUSTFLAGS='-Ctarget-cpu=haswell'; \
fi; \
if [ "$(uname -m)" == "aarch64" ]; \
then export RUSTFLAGS=''; \
fi; \
if [ "${SCCACHE_REDIS}" != "" ]; \
then \
export CC="/usr/bin/sccache /usr/bin/clang" && \
export RUSTC_WRAPPER=sccache && \
sccache --start-server; \
else \
export CC="/usr/bin/clang"; \
fi; \
export RUSTC_BOOTSTRAP=1 && \
echo $RUSTC_BOOTSTRAP && \
echo $RUSTC_WRAPPER && \
echo $RUSTFLAGS && \
echo $CC && \
cargo build \
--offline \
--features=concread/simd_support,libsqlite3-sys/bundled \
--release; \
if [ "${SCCACHE_REDIS}" != "" ]; \
then sccache -s; \
fi; \

View file

@ -8,7 +8,7 @@
#![deny(clippy::needless_pass_by_value)]
#![deny(clippy::trivially_copy_pass_by_ref)]
#[cfg(test)]
#[cfg(all(jemallocator, test))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

View file

@ -8,7 +8,7 @@
#![deny(clippy::needless_pass_by_value)]
#![deny(clippy::trivially_copy_pass_by_ref)]
#[cfg(not(test))]
#[cfg(all(jemallocator, not(test)))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;