-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port k8s tests to run real pods (#140)
* port k8s tests to run real pods * check dups in events log (ensure there are none) * fixup tests for newer kube-rs and add pod log printer * propagate error rather than unwrapping
- Loading branch information
Showing
19 changed files
with
1,324 additions
and
235 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# syntax = docker/dockerfile:1.0-experimental | ||
ARG BUILD_IMAGE | ||
|
||
FROM ${BUILD_IMAGE} as build | ||
|
||
ENV _RJEM_MALLOC_CONF="narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0" | ||
ENV JEMALLOC_SYS_WITH_MALLOC_CONF="narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0" | ||
|
||
ARG FEATURES | ||
|
||
ARG SCCACHE_BUCKET | ||
ENV SCCACHE_BUCKET=${SCCACHE_BUCKET} | ||
|
||
ARG SCCACHE_REGION | ||
ENV SCCACHE_REGION=${SCCACHE_REGION} | ||
|
||
# Create the directory for agent repo | ||
WORKDIR /opt/logdna-agent-v2 | ||
|
||
# Add the actual agent source files | ||
COPY . . | ||
|
||
# Rebuild the agent | ||
RUN --mount=type=cache,target=/opt/rust/cargo/registry \ | ||
--mount=type=cache,target=/opt/logdna-agent-v2/target \ | ||
if [ -z "$SCCACHE_BUCKET" ]; then unset RUSTC_WRAPPER; fi; \ | ||
cargo build --manifest-path bin/Cargo.toml ${FEATURES} --release && \ | ||
strip ./target/release/logdna-agent && \ | ||
cp ./target/release/logdna-agent logdna-agent && \ | ||
sccache --show-stats | ||
|
||
# Use Debian as agent base image | ||
FROM debian:buster | ||
|
||
ARG REPO | ||
ARG BUILD_TIMESTAMP | ||
ARG VCS_REF | ||
ARG VCS_URL | ||
ARG BUILD_VERSION | ||
|
||
LABEL org.opencontainers.image.created="${BUILD_TIMESTAMP}" | ||
LABEL org.opencontainers.image.authors="LogDNA <support@logdna.com>" | ||
LABEL org.opencontainers.image.url="https://logdna.com" | ||
LABEL org.opencontainers.image.documentation="" | ||
LABEL org.opencontainers.image.source="${VCS_URL}" | ||
LABEL org.opencontainers.image.version="${BUILD_VERSION}" | ||
LABEL org.opencontainers.image.revision="${VCS_REF}" | ||
LABEL org.opencontainers.image.vendor="LogDNA Inc." | ||
LABEL org.opencontainers.image.licenses="MIT" | ||
LABEL org.opencontainers.image.ref.name="" | ||
LABEL org.opencontainers.image.title="LogDNA Agent" | ||
LABEL org.opencontainers.image.description="The blazingly fast, resource efficient log collection client" | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV _RJEM_MALLOC_CONF="narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0" | ||
ENV JEMALLOC_SYS_WITH_MALLOC_CONF="narenas:1,tcache:false,dirty_decay_ms:0,muzzy_decay_ms:0" | ||
|
||
# Copy the agent binary from the build stage | ||
COPY --from=build /opt/logdna-agent-v2/logdna-agent /work/ | ||
WORKDIR /work/ | ||
|
||
RUN apt update -y \ | ||
&& apt upgrade -y \ | ||
&& apt auto-remove -y \ | ||
&& apt install ca-certificates libcap2 netcat-openbsd nmap \ | ||
dnsutils vim curl -y \ | ||
&& rm -rf /var/cache/apt \ | ||
&& chmod -R 777 . \ | ||
&& setcap "cap_dac_read_search+eip" /work/logdna-agent \ | ||
&& groupadd -g 5000 logdna \ | ||
&& useradd -u 5000 -g logdna logdna | ||
|
||
CMD ["./logdna-agent"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.