Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hoenn/agentctl register integrations #342

Merged
merged 5 commits into from
Jan 20, 2021
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ can be found at [#317](https://github.com/grafana/agent/issues/317).

# Master (unreleased)

- [BUGFIX] `agentctl config-check` will now work correctly when the supplied config file contains integrations. (@hoenn)

# v0.11.0 (2021-01-20)

- [FEATURE] ARMv6 builds of `agent` and `agentctl` will now be included in
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ endif

cmd/agentctl/agentctl: cmd/agentctl/main.go
ifeq ($(CROSS_BUILD),false)
CGO_ENABLED=0 go build $(GO_FLAGS) -o $@ ./$(@D)
CGO_ENABLED=1 go build $(CGO_FLAGS) -o $@ ./$(@D)
else
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build $(GO_FLAGS) -o $@ ./$(@D)
@CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM); $(seego) build $(CGO_FLAGS) -o $@ ./$(@D)
endif
$(NETGO_CHECK)

Expand Down
16 changes: 12 additions & 4 deletions cmd/agentctl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
FROM golang:1.15 as build
FROM golang:1.15.3-buster as build
COPY . /src/agent
WORKDIR /src/agent
ARG RELEASE_BUILD=false
ARG IMAGE_TAG

# Backports repo required to get a libsystemd version 246 or newer which is required to handle journal +ZSTD compression
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -t buster-backports -qy libsystemd-dev

RUN make clean && make IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false agentctl

FROM debian:buster-slim
RUN apt-get update && \
apt-get install -qy \
tzdata ca-certificates && \

# Backports repo required to get a libsystemd version 246 or newer which is required to handle journal +ZSTD compression
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -t buster-backports -qy libsystemd-dev && \
apt-get install -qy tzdata ca-certificates && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=build /src/agent/cmd/agentctl/agentctl /bin/agentctl

ENTRYPOINT ["/bin/agentctl"]
9 changes: 6 additions & 3 deletions cmd/agentctl/Dockerfile.buildx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ RUN cp /go_wrapper.sh /seego.sh
RUN make clean && IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false bash ./tools/cross_build.bash agentctl

FROM debian:buster-slim
RUN apt-get update && \
apt-get install -qy \
tzdata ca-certificates && \

# Backports repo required to get a libsystemd version 246 or newer which is required to handle journal +ZSTD compression
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -t buster-backports -qy libsystemd-dev && \
apt-get install -qy tzdata ca-certificates libsystemd-dev && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=build /src/agent/cmd/agentctl/agentctl /bin/agentctl

ENTRYPOINT ["/bin/agentctl"]
3 changes: 3 additions & 0 deletions cmd/agentctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import (

// Register Prometheus SD components
_ "github.com/prometheus/prometheus/discovery/install"

// Register integrations
_ "github.com/grafana/agent/pkg/integrations/install"
)

func main() {
Expand Down