Skip to content

Commit

Permalink
Add nri-memtierd plugin
Browse files Browse the repository at this point in the history
The nri-memtierd plugin toggles swapping, starts/stops memtierd
processes that track and manage memory of containers.

Signed-off-by: Antti Kervinen <[email protected]>
Signed-off-by: Luukas Makila <[email protected]>
  • Loading branch information
askervin committed Sep 27, 2023
1 parent 90dc2e5 commit a82ab0c
Show file tree
Hide file tree
Showing 9 changed files with 1,081 additions and 0 deletions.
32 changes: 32 additions & 0 deletions cmd/plugins/memtierd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ARG GO_VERSION=1.21

FROM golang:${GO_VERSION}-bullseye as builder

WORKDIR /go/builder

RUN GOBIN=/bin go install github.com/intel/memtierd/cmd/memtierd@latest

# Fetch go dependencies in a separate layer for caching
COPY go.mod go.sum ./
COPY pkg/topology/ pkg/topology/
RUN go mod download

# Build nri-memtierd
COPY . .

RUN make clean
RUN make PLUGINS=nri-memtierd build-plugins-static

# FROM gcr.io/distroless/static
# ENV PATH=/bin
# TODO: DEBUG why exec.Command("memtierd", "-c", ...).Start() fails on distroless:
# execve("/bin/memtierd", ["/bin/memtierd", "-c", "", "-config", "/host/tmp/memtierd/default/test-"...], 0xc000146000 /* 38 vars */) = -1 ENOENT (No such file or directory)
# However, execve works on busybox base image, so let's use it until
# the real problem is solved.

FROM busybox

COPY --from=builder /go/builder/build/bin/nri-memtierd /bin/nri-memtierd
COPY --from=builder /bin/memtierd /bin/memtierd

ENTRYPOINT ["/bin/nri-memtierd", "--idx", "45"]
Loading

0 comments on commit a82ab0c

Please sign in to comment.