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

continuous-test docker binary swap #7753

Merged
merged 6 commits into from
Apr 4, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

### Mimir Continuous Test

+* [CHANGE] `mimir-continuous-test` has been deprecated and replaced by a Mimir module that can be run as a target from the `mimir` binary using `mimir -target=continuous-test`. #7753
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog seems to have grown an errant +

Suggested change
+* [CHANGE] `mimir-continuous-test` has been deprecated and replaced by a Mimir module that can be run as a target from the `mimir` binary using `mimir -target=continuous-test`. #7753
* [CHANGE] `mimir-continuous-test` has been deprecated and replaced by a Mimir module that can be run as a target from the `mimir` binary using `mimir -target=continuous-test`. #7753

* [BUGFIX] Set `User-Agent` header for all requests sent from the testing client. #7607

### Query-tee
Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ SED ?= $(shell which gsed 2>/dev/null || which sed)
# in that case.
%/$(UPTODATE): GOOS=linux
%/$(UPTODATE): %/Dockerfile
if [ -f $(@D)/Dockerfile.continuous-test ]; then \
$(SUDO) docker build -f $(@D)/Dockerfile.continuous-test \
--build-arg=revision=$(GIT_REVISION) \
--build-arg=goproxyValue=$(GOPROXY_VALUE) \
-t $(IMAGE_PREFIX)$(shell basename $(@D))-continuous-test:$(IMAGE_TAG) $(@D)/; \
fi;
if [ -f $(@D)/Dockerfile.distroless ]; then \
$(SUDO) docker build -f $(@D)/Dockerfile.distroless \
--build-arg=revision=$(GIT_REVISION) \
Expand All @@ -110,6 +116,7 @@ SED ?= $(shell which gsed 2>/dev/null || which sed)
@echo
@echo Image name: $(IMAGE_PREFIX)$(shell basename $(@D))
@echo Image name: $(IMAGE_PREFIX)$(shell basename $(@D)):$(IMAGE_TAG)
@echo Image name: $(IMAGE_PREFIX)$(shell basename $(@D))-continuous-test:$(IMAGE_TAG)
@echo Image name: $(IMAGE_PREFIX)$(shell basename $(@D))-distroless:$(IMAGE_TAG)
@echo
@echo Please use '"make push-multiarch-build-image"' to build and push build image.
Expand Down Expand Up @@ -158,6 +165,16 @@ push-multiarch-%/$(UPTODATE):
fi
$(SUDO) docker buildx build -o $(PUSH_MULTIARCH_TARGET) --platform linux/amd64,linux/arm64 --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) --build-arg=USE_BINARY_SUFFIX=true -t $(IMAGE_PREFIX)$(shell basename $(DIR)):$(IMAGE_TAG) $(DIR)/

# Build Dockerfile.continuous-test
if [ -f $(DIR)/Dockerfile.continuous-test ]; then \
$(SUDO) docker buildx build -f $(DIR)/Dockerfile.continuous-test \
-o $(PUSH_MULTIARCH_TARGET) \
--platform linux/amd64,linux/arm64 \
--build-arg=revision=$(GIT_REVISION) \
--build-arg=goproxyValue=$(GOPROXY_VALUE) \
--build-arg=USE_BINARY_SUFFIX=true \
-t $(IMAGE_PREFIX)$(shell basename $(DIR))-continuous-test:$(IMAGE_TAG) $(DIR)/; \
fi;
# Build Dockerfile.distroless if it exists
if [ -f $(DIR)/Dockerfile.distroless ]; then \
$(SUDO) docker buildx build -f $(DIR)/Dockerfile.distroless \
Expand Down
1 change: 1 addition & 0 deletions cmd/mimir-continuous-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func main() {
}

util_log.InitLogger(log.LogfmtFormat, logLevel, false, util_log.RateLimitedLoggerCfg{})
level.Warn(util_log.Logger).Log("msg", "The mimir-continuous-test binary you are using is deprecated. Please use the Mimir binary module `mimir -target=continuous-test`.")

// Setting the environment variable JAEGER_AGENT_HOST enables tracing.
if trace, err := tracing.NewFromEnv("mimir-continuous-test", jaegercfg.MaxTagValueLength(16e3)); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ ARG TARGETARCH
ARG BINARY_SUFFIX="_${TARGETOS}_${TARGETARCH}"
# Set to non-empty value to use ${BINARY_SUFFIX} when copying binary, leave unset to use no suffix.
ARG USE_BINARY_SUFFIX
COPY mimir-continuous-test${USE_BINARY_SUFFIX:+${BINARY_SUFFIX}} /mimir-continuous-test
ENTRYPOINT ["/mimir-continuous-test"]
COPY mimir${USE_BINARY_SUFFIX:+${BINARY_SUFFIX}} /bin/mimir
EXPOSE 8080
ENTRYPOINT ["/bin/mimir", "-target=continuous-test"]

ARG revision
LABEL org.opencontainers.image.title="mimir-continuous-test" \
org.opencontainers.image.source="https://github.com/grafana/mimir/tree/main/cmd/mimir-continuous-test" \
org.opencontainers.image.revision="${revision}"
org.opencontainers.image.source="https://github.com/grafana/mimir/tree/main/cmd/mimir" \
org.opencontainers.image.revision="${revision}"
Loading