Skip to content

Commit 0164651

Browse files
authored
Migrate to github.com/observatorium/api (#134)
1 parent d40a037 commit 0164651

File tree

19 files changed

+56
-52
lines changed

19 files changed

+56
-52
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
*.out
1313

1414
observatorium
15+
observatorium-api
1516
tmp/
1617
examples/vendor
1718
vendor
1819
.envrc
1920
.bin
20-
.idea
21+
.idea

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ RUN apk add --update --no-cache ca-certificates tzdata git make bash && update-c
55
ADD . /opt
66
WORKDIR /opt
77

8-
RUN git update-index --refresh; make observatorium
8+
RUN git update-index --refresh; make build
99

1010
FROM alpine:3.12 as runner
1111

1212
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
13-
COPY --from=builder /opt/observatorium /bin/observatorium
13+
COPY --from=builder /opt/observatorium-api /bin/observatorium-api
1414

1515
ARG BUILD_DATE
1616
ARG VERSION
1717
ARG VCS_REF
1818
ARG DOCKERFILE_PATH
1919

2020
LABEL vendor="Observatorium" \
21-
name="observatorium/observatorium" \
21+
name="observatorium/api" \
2222
description="Observatorium API" \
23-
io.k8s.display-name="observatorium/observatorium" \
23+
io.k8s.display-name="observatorium/api" \
2424
io.k8s.description="Observatorium API" \
2525
maintainer="Observatorium <team-monitoring@redhat.com>" \
2626
version="$VERSION" \
2727
org.label-schema.build-date=$BUILD_DATE \
2828
org.label-schema.description="Observatorium API" \
29-
org.label-schema.docker.cmd="docker run --rm observatorium/observatorium" \
29+
org.label-schema.docker.cmd="docker run --rm observatorium/api" \
3030
org.label-schema.docker.dockerfile=$DOCKERFILE_PATH \
31-
org.label-schema.name="observatorium/observatorium" \
31+
org.label-schema.name="observatorium/api" \
3232
org.label-schema.schema-version="1.0" \
3333
org.label-schema.vcs-branch=$VCS_BRANCH \
3434
org.label-schema.vcs-ref=$VCS_REF \
35-
org.label-schema.vcs-url="https://github.com/observatorium/observatorium" \
36-
org.label-schema.vendor="observatorium/observatorium" \
35+
org.label-schema.vcs-url="https://github.com/observatorium/api" \
36+
org.label-schema.vendor="observatorium/api" \
3737
org.label-schema.version=$VERSION
3838

39-
ENTRYPOINT ["/bin/observatorium"]
39+
ENTRYPOINT ["/bin/observatorium-api"]

Makefile

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ FIRST_GOPATH := $(firstword $(subst :, ,$(shell go env GOPATH)))
88
OS ?= $(shell uname -s | tr '[A-Z]' '[a-z]')
99
ARCH ?= $(shell uname -m)
1010
GOARCH ?= $(shell go env GOARCH)
11+
BIN_NAME ?= observatorium-api
1112

1213
VERSION := $(strip $(shell [ -d .git ] && git describe --always --tags --dirty))
1314
BUILD_DATE := $(shell date -u +"%Y-%m-%d")
1415
BUILD_TIMESTAMP := $(shell date -u +"%Y-%m-%dT%H:%M:%S%Z")
1516
VCS_BRANCH := $(strip $(shell git rev-parse --abbrev-ref HEAD))
1617
VCS_REF := $(strip $(shell [ -d .git ] && git rev-parse --short HEAD))
17-
DOCKER_REPO ?= quay.io/observatorium/observatorium
18+
DOCKER_REPO ?= quay.io/observatorium/api
1819

1920
CONTAINER_CMD := docker run --rm \
2021
-u="$(shell id -u):$(shell id -g)" \
2122
-v "$(shell go env GOCACHE):/.cache/go-build" \
22-
-v "$(PWD):/go/src/github.com/observatorium/observatorium:Z" \
23-
-w "/go/src/github.com/observatorium/observatorium" \
23+
-v "$(PWD):/go/src/github.com/observatorium/api:Z" \
24+
-w "/go/src/github.com/observatorium/api" \
2425
-e USER=deadbeef \
2526
-e GO111MODULE=on \
2627
quay.io/coreos/jsonnet-ci
@@ -50,11 +51,11 @@ PROTOC_VERSION ?= 3.13.0
5051

5152
SERVER_CERT ?= $(CERT_DIR)/server.pem
5253

53-
default: observatorium
54-
all: clean lint test observatorium generate validate
54+
default: $(BIN_NAME)
55+
all: clean lint test $(BIN_NAME) generate validate
5556

56-
tmp/help.txt: observatorium $(TMP_DIR)
57-
./observatorium --help &> $(TMP_DIR)/help.txt || true
57+
tmp/help.txt: $(BIN_NAME) $(TMP_DIR)
58+
./$(BIN_NAME) --help &> $(TMP_DIR)/help.txt || true
5859

5960
tmp/load_help.txt: $(TMP_DIR)
6061
-./test/load.sh -h > $(TMP_DIR)/load_help.txt 2&>1
@@ -67,11 +68,11 @@ benchmark.md: $(EMBEDMD) tmp/load_help.txt
6768
PATH=$$PATH:$(BIN_DIR):$(FIRST_GOPATH)/bin ./test/load.sh -r 300 -c 1000 -m 3 -q 10 -o gnuplot
6869
$(EMBEDMD) -w docs/benchmark.md
6970

70-
observatorium: deps main.go $(wildcard *.go) $(wildcard */*.go)
71-
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(GOARCH) GO111MODULE=on GOPROXY=https://proxy.golang.org go build -a -ldflags '-s -w' -o $@ .
71+
$(BIN_NAME): deps main.go $(wildcard *.go) $(wildcard */*.go)
72+
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(GOARCH) GO111MODULE=on GOPROXY=https://proxy.golang.org go build -a -ldflags '-s -w' -o $(BIN_NAME) .
7273

7374
.PHONY: build
74-
build: observatorium
75+
build: $(BIN_NAME)
7576

7677
.PHONY: run
7778
run: build $(THANOS) $(DEX) $(LOKI) generate-cert
@@ -115,7 +116,7 @@ clean:
115116
-rm tmp/help.txt
116117
-rm -rf tmp/bin
117118
-rm -rf tmp/src
118-
-rm observatorium
119+
-rm $(BIN_NAME)
119120

120121
ratelimit/gubernator/proto/google:
121122
mkdir -p $(TMP_DIR)/src/grpc-gateway
@@ -211,11 +212,11 @@ $(SHELLCHECK): $(BIN_DIR)
211212
curl -sNL "https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.$(OS).$(ARCH).tar.xz" | tar --strip-components=1 -xJf - -C $(BIN_DIR)
212213

213214
$(MOCKPROVIDER): | deps $(BIN_DIR)
214-
go build -tags tools -o $@ github.com/observatorium/observatorium/test/mock
215+
go build -tags tools -o $@ github.com/observatorium/api/test/mock
215216

216217
$(GENERATE_TLS_CERT): | deps $(BIN_DIR)
217218
# A thin wrapper around github.com/cloudflare/cfssl
218-
go build -tags tools -o $@ github.com/observatorium/observatorium/test/tls
219+
go build -tags tools -o $@ github.com/observatorium/api/test/tls
219220

220221
$(PROTOC): $(TMP_DIR) $(BIN_DIR)
221222
@PROTOC_VERSION="$(PROTOC_VERSION)" TMP_DIR="$(TMP_DIR)" BIN_DIR="$(BIN_DIR)" scripts/install_protoc.sh

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Observatorium
22

3-
[![CircleCI](https://circleci.com/gh/observatorium/observatorium.svg?style=svg)](https://circleci.com/gh/observatorium/observatorium)
4-
[![Go Doc](https://godoc.org/github.com/observatorium/observatorium?status.svg)](http://godoc.org/github.com/observatorium/observatorium)
5-
[![Go Report Card](https://goreportcard.com/badge/github.com/observatorium/observatorium)](https://goreportcard.com/report/github.com/observatorium/observatorium)
3+
[![CircleCI](https://circleci.com/gh/observatorium/api.svg?style=svg)](https://circleci.com/gh/observatorium/api)
4+
[![Go Doc](https://godoc.org/github.com/observatorium/api?status.svg)](http://godoc.org/github.com/observatorium/api)
5+
[![Go Report Card](https://goreportcard.com/badge/github.com/observatorium/api)](https://goreportcard.com/report/github.com/observatorium/api)
66

77
This project is an API server for Observatorium.
88
The API provides an authenticated and authorized, multi-tenant interface for writing and reading observability signals, i.e. metrics and logs.

api/logs/v1/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/prometheus/client_golang/prometheus"
1414
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
1515

16-
"github.com/observatorium/observatorium/proxy"
16+
"github.com/observatorium/api/proxy"
1717
)
1818

1919
const (

api/metrics/legacy/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/prometheus/client_golang/prometheus"
1313
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
1414

15-
"github.com/observatorium/observatorium/proxy"
15+
"github.com/observatorium/api/proxy"
1616
)
1717

1818
const (

api/metrics/v1/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/prometheus/client_golang/prometheus"
1313
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
1414

15-
"github.com/observatorium/observatorium/proxy"
15+
"github.com/observatorium/api/proxy"
1616
)
1717

1818
const (

authorization/http.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package authorization
33
import (
44
"net/http"
55

6-
"github.com/observatorium/observatorium/authentication"
7-
"github.com/observatorium/observatorium/rbac"
6+
"github.com/observatorium/api/authentication"
7+
"github.com/observatorium/api/rbac"
88
)
99

1010
// WithAuthorizers returns a middleware that authorizes subjects taken from a request context

examples/main.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local config = {
33
name: 'observatorium-api',
44
namespace: 'observatorium',
55
version: 'master-2020-09-04-v0.1.1-131-ga4c5a9c',
6-
image: 'quay.io/observatorium/observatorium:' + cfg.version,
6+
image: 'quay.io/observatorium/api:' + cfg.version,
77
replicas: 3,
88
metrics: {
99
readEndpoint: 'http://127.0.0.1:9091',

examples/manifests/deployment-with-tls.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ spec:
4545
- --tls.healthchecks.server-ca-file=/var/run/tls/ca
4646
- --tls.reload-interval=1m
4747
- --tls.healthchecks.server-name=example.com
48+
# TODO(onprem): Update to observatorium/api when a image is published.
4849
image: quay.io/observatorium/observatorium:master-2020-09-04-v0.1.1-131-ga4c5a9c
4950
livenessProbe:
5051
failureThreshold: 10

0 commit comments

Comments
 (0)