Skip to content

Commit

Permalink
Dev (#23)
Browse files Browse the repository at this point in the history
Based on rhel ubi8-minimal image
  • Loading branch information
pberdyuhin authored May 21, 2021
1 parent 13198d4 commit 65115ce
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
21 changes: 17 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
FROM alpine:3.7
FROM registry.access.redhat.com/ubi8/ubi-minimal

ENV ANODOT_TAGS="source=prometheus-remote-write"
ADD anodot-prometheus-remote-write /go/bin/anodot-prometheus-remote-write
ARG VERSION=latest

### Required OpenShift Labels
LABEL name="Anodot Prometheus Remote Write" \
maintainer="support@anodot.com" \
vendor="Anodot" \
version=${VERSION} \
release="1" \
summary="https://github.com/anodot/anodot-remote-write" \
description="Service which receives Prometheus metrics through remote_write, converts metrics and sends them into Anodot"
# Always include a software license in the default location
COPY LICENSE.md /licenses/

COPY anodot-prometheus-remote-write /go/bin/anodot-prometheus-remote-write
# ln -s required for backward compatibility with older docker images.
RUN apk add --no-cache ca-certificates && ln -s /go/bin/anodot-prometheus-remote-write /go/bin/server
RUN ln -s /go/bin/anodot-prometheus-remote-write /go/bin/server
EXPOSE 1234
ENTRYPOINT ["/go/bin/anodot-prometheus-remote-write"]
ENTRYPOINT ["/go/bin/anodot-prometheus-remote-write"]
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BUILD_FLAGS = GO111MODULE=on CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) GOFLAGS
APPLICATION_NAME := anodot-prometheus-remote-write
DOCKER_IMAGE_NAME := anodot/prometheus-remote-write

VERSION := $(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4 }' | tr -d '"')
VERSION := $(shell git describe --tags --abbrev=0 | cut -c2-)
PREVIOUS_VERSION := $(shell git show HEAD:pkg/version/version.go | grep 'VERSION' | awk '{ print $$4 }' | tr -d '"' )
GIT_COMMIT := $(shell git describe --dirty --always)

Expand Down Expand Up @@ -44,7 +44,7 @@ build:
$(BUILD_FLAGS) $(GO) build -ldflags "-s -w -X github.com/anodot/anodot-remote-write/pkg/version.REVISION=$(GIT_COMMIT)" -o $(APPLICATION_NAME)

build-container: build
docker build -t $(DOCKER_IMAGE_NAME):$(VERSION) .
docker build -t $(DOCKER_IMAGE_NAME):$(VERSION) --build-arg VERSION=$(VERSION) .
@echo ">> created docker image $(DOCKER_IMAGE_NAME):$(VERSION)"

test:
Expand All @@ -65,12 +65,17 @@ e2e: build-container
push-container: test-container
docker push $(DOCKER_IMAGE_NAME):$(VERSION)

ifeq ($(shell git branch --show-current), master)
docker tag $(DOCKER_IMAGE_NAME):$(VERSION) $(DOCKER_IMAGE_NAME):latest
docker push $(DOCKER_IMAGE_NAME):latest
endif

dockerhub-login:
docker login -u $(DOCKER_USERNAME) -p $(DOCKER_PASSWORD)

version-set:
@sed -i '' 's#$(DOCKER_IMAGE_NAME):$(PREVIOUS_VERSION)#$(DOCKER_IMAGE_NAME):$(VERSION)#g' deployment/docker-compose/docker-compose.yaml && \
sed -i '' 's#$(DOCKER_IMAGE_NAME):$(PREVIOUS_VERSION)#$(DOCKER_IMAGE_NAME):$(VERSION)#g' e2e/docker-compose.yaml && \
@sed -i 's#$(DOCKER_IMAGE_NAME):.*#$(DOCKER_IMAGE_NAME):$(VERSION)#g' deployment/docker-compose/docker-compose.yaml && \
sed -i 's#$(DOCKER_IMAGE_NAME):.*#$(DOCKER_IMAGE_NAME):$(VERSION)#g' e2e/docker-compose.yaml && \
echo "Version $(VERSION) set in code, deployment, chart"

vendor-update:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
[![Docker pulls](https://img.shields.io/docker/pulls/anodot/prometheus-remote-write.svg)](https://hub.docker.com/r/anodot/prometheus-remote-write)
[![codecov](https://codecov.io/gh/anodot/anodot-remote-write/branch/master/graph/badge.svg)](https://codecov.io/gh/anodot/anodot-remote-write)

[<img src="https://www.pngkit.com/png/detail/139-1394615_why-red-hat-certified-courses-red-hat-linux.png" width="150" alt="Red Hat certified"/>](https://catalog.redhat.com/software/containers/r/anodot/prometheus-remote-write/609e5564ac3db91643d96d76)


# Anodot Prometheus Remote Write

`anodot-prometheus-remote-write` is a service which receives [Prometheus](https://github.com/prometheus) metrics through [`remote_write`](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write), converts metrics and sends them into [Anodot](https://www.anodot.com).
Expand Down
2 changes: 1 addition & 1 deletion deployment/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2'

services:
remote-write:
image: anodot/prometheus-remote-write:2.2.0
image: anodot/prometheus-remote-write:2.4.7-beta
container_name: anodot-prometheus-remote-write
restart: unless-stopped
environment:
Expand Down

0 comments on commit 65115ce

Please sign in to comment.