Skip to content

Commit

Permalink
Merge branch 'cortexproject:master' into query-rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
erlan-z authored Jun 28, 2024
2 parents c7ad0a0 + 79ef088 commit 5461a54
Show file tree
Hide file tree
Showing 197 changed files with 7,781 additions and 3,510 deletions.
2 changes: 1 addition & 1 deletion .github/workflows-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ As of October 2020, GitHub Actions do not persist between different jobs in the
- name: Compressing Images
run: tar -zcvf images.tar.gz /tmp/images
- name: Cache Images
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Docker Images
path: ./images.tar.gz
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build Image

on:
push:
branches: [ master ]
paths:
- 'build-image/**'
- '.github/workflows/build-image.yml'
pull_request:
branches: [ master ]
paths:
- 'build-image/**'
- '.github/workflows/build-image.yml'

jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Save image
run: make save-multiarch-build-image

- name: Upload Docker Images Artifacts
uses: actions/upload-artifact@v4
with:
name: build-image
path: |
./build-image-amd64.tar
./build-image-arm64.tar
if-no-files-found: error

push:
needs: build
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0

- name: Download Docker Images Artifacts
uses: actions/download-artifact@v4
with:
name: build-image

- name: Load image
run: make load-multiarch-build-image

- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{secrets.QUAY_REGISTRY_USER}}
password: ${{secrets.QUAY_REGISTRY_PASSWORD}}

- name: Push image
run: make push-multiarch-build-image
32 changes: 19 additions & 13 deletions .github/workflows/test-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ on:
branches: [master]
tags:
- v[0-9]+.[0-9]+.[0-9]+** # Tag filters not as strict due to different regex system on Github Actions
paths-ignore:
- 'build-image/**'
- '.github/workflows/build-image.yml'
pull_request:
paths-ignore:
- 'build-image/**'
- '.github/workflows/build-image.yml'

jobs:
lint:
runs-on: ubuntu-20.04
container:
image: quay.io/cortexproject/build-image:node_version_upgrade-60582e680
image: quay.io/cortexproject/build-image:master-2866917df
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -40,7 +46,7 @@ jobs:
test:
runs-on: ubuntu-20.04
container:
image: quay.io/cortexproject/build-image:node_version_upgrade-60582e680
image: quay.io/cortexproject/build-image:master-2866917df
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -83,7 +89,7 @@ jobs:
build:
runs-on: ubuntu-20.04
container:
image: quay.io/cortexproject/build-image:node_version_upgrade-60582e680
image: quay.io/cortexproject/build-image:master-2866917df
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand All @@ -107,7 +113,7 @@ jobs:
touch build-image/.uptodate
make BUILD_IN_CONTAINER=false web-build
- name: Upload Website Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: website public
path: website/public/
Expand All @@ -119,7 +125,7 @@ jobs:
- name: Create Docker Images Archive
run: tar -cvf images.tar /tmp/images
- name: Upload Docker Images Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Docker Images
path: ./images.tar
Expand All @@ -142,7 +148,7 @@ jobs:
- name: Upgrade golang
uses: actions/setup-go@v2
with:
go-version: 1.21.9
go-version: 1.21.11
- name: Checkout Repo
uses: actions/checkout@v2
- name: Install Docker Client
Expand All @@ -152,7 +158,7 @@ jobs:
sudo mkdir -p /go/src/github.com/cortexproject/cortex
sudo ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
- name: Download Docker Images Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: Docker Images
- name: Extract Docker Images Archive
Expand Down Expand Up @@ -207,7 +213,7 @@ jobs:
- name: Install Docker Client
run: sudo ./.github/workflows/scripts/install-docker.sh
- name: Download Docker Images Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: Docker Images
- name: Extract Docker Images Archive
Expand All @@ -217,14 +223,14 @@ jobs:
run: |
touch build-image/.uptodate
MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations
make BUILD_IMAGE=quay.io/cortexproject/build-image:node_version_upgrade-60582e680 TTY='' configs-integration-test
make BUILD_IMAGE=quay.io/cortexproject/build-image:master-2866917df TTY='' configs-integration-test
deploy_website:
needs: [build, test]
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
runs-on: ubuntu-20.04
container:
image: quay.io/cortexproject/build-image:node_version_upgrade-60582e680
image: quay.io/cortexproject/build-image:master-2866917df
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand All @@ -241,7 +247,7 @@ jobs:
mkdir -p /go/src/github.com/cortexproject/cortex
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
- name: Download Website Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: website public
path: website/public
Expand All @@ -266,7 +272,7 @@ jobs:
if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
runs-on: ubuntu-20.04
container:
image: quay.io/cortexproject/build-image:node_version_upgrade-60582e680
image: quay.io/cortexproject/build-image:master-2866917df
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand All @@ -282,7 +288,7 @@ jobs:
mkdir -p /go/src/github.com/cortexproject/cortex
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
- name: Download Docker Images Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: Docker Images
- name: Extract Docker Images Archive
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ Makefile.local
.vscode
compose
compose-simple

/build-image-arm64.tar
/build-image-amd64.tar
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
* [ENHANCEMENT] KV: Etcd Added etcd.ping-without-stream-allowed parameter to disable/enable PermitWithoutStream #5933
* [ENHANCEMENT] Ingester: Add a new `limits_per_label_set` limit. This limit functions similarly to `max_series_per_metric`, but allowing users to define the maximum number of series per LabelSet. #5950 #5993
* [ENHANCEMENT] Store Gateway: Log gRPC requests together with headers configured in `http_request_headers_to_log`. #5958
* [ENHANCEMENT] Upgrade Alpine to 3.19. #6014
* [ENHANCEMENT] Upgrade go to 1.21.11 #6014
* [BUGFIX] Configsdb: Fix endline issue in db password. #5920
* [BUGFIX] Ingester: Fix `user` and `type` labels for the `cortex_ingester_tsdb_head_samples_appended_total` TSDB metric. #5952
* [BUGFIX] Querier: Enforce max query length check for `/api/v1/series` API even though `ignoreMaxQueryLength` is set to true. #6018

## 1.17.1 2024-05-20

Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Alan Protasio, Amazon Web Services <alanprot@gmail.com> (@alanprot)
Alvin Lin, Amazon Web Services <alvinlin123@gmail.com> (@alvinlin123)
Ben Ye, Amazon Web Services <yb532204897@gmail.com> (@yeya24)
Charlie Le, Apple <chtle4@gmail.com> (@CharlieTLe)
Friedrich Gonzalez, Adobe <friedrichg@gmail.com> (@friedrichg)
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,7 @@ fetch-build-image:
docker tag $(BUILD_IMAGE):$(LATEST_BUILD_IMAGE_TAG) $(BUILD_IMAGE):latest
touch build-image/.uptodate

push-multiarch-build-image:
@echo
# Build image for each platform separately... it tends to generate fewer errors.
$(SUDO) docker buildx build --platform linux/amd64 --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) build-image/
$(SUDO) docker buildx build --platform linux/arm64 --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) build-image/
# This command will run the same build as above, but it will reuse existing platform-specific images,
# put them together and push to registry.
$(SUDO) docker buildx build -o type=registry --platform linux/amd64,linux/arm64 --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) -t $(IMAGE_PREFIX)build-image:$(IMAGE_TAG) build-image/
-include build-image/Makefile

# We don't want find to scan inside a bunch of directories, to accelerate the
# 'make: Entering directory '/go/src/github.com/cortexproject/cortex' phase.
Expand Down Expand Up @@ -122,7 +115,7 @@ build-image/$(UPTODATE): build-image/*
SUDO := $(shell docker info >/dev/null 2>&1 || echo "sudo -E")
BUILD_IN_CONTAINER := true
BUILD_IMAGE ?= $(IMAGE_PREFIX)build-image
LATEST_BUILD_IMAGE_TAG ?= node_version_upgrade-60582e680
LATEST_BUILD_IMAGE_TAG ?= master-2866917df

# TTY is parameterized to allow Google Cloud Builder to run builds,
# as it currently disallows TTY devices. This value needs to be overridden
Expand Down
2 changes: 1 addition & 1 deletion build-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.9-bullseye
FROM golang:1.21.11-bullseye
ARG goproxyValue
ENV GOPROXY=${goproxyValue}
RUN apt-get update && apt-get install -y curl file jq unzip protobuf-compiler libprotobuf-dev && \
Expand Down
17 changes: 17 additions & 0 deletions build-image/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
save-multiarch-build-image:
@echo
# Build image for each platform separately... it tends to generate fewer errors.
$(SUDO) docker buildx build --platform linux/amd64 --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) -t $(IMAGE_PREFIX)build-image:$(IMAGE_TAG)-amd64 --output type=docker,dest=./build-image-amd64.tar build-image/
$(SUDO) docker buildx build --platform linux/arm64 --build-arg=revision=$(GIT_REVISION) --build-arg=goproxyValue=$(GOPROXY_VALUE) -t $(IMAGE_PREFIX)build-image:$(IMAGE_TAG)-arm64 --output type=docker,dest=./build-image-arm64.tar build-image/

load-multiarch-build-image:
$(SUDO) docker load -i build-image-amd64.tar
$(SUDO) docker load -i build-image-arm64.tar

push-multiarch-build-image:
# This command will run the same build as multiarch-build-image, but it will reuse existing platform-specific images,
# put them together and push to registry.
$(SUDO) docker push $(IMAGE_PREFIX)build-image:${IMAGE_TAG}-amd64
$(SUDO) docker push $(IMAGE_PREFIX)build-image:${IMAGE_TAG}-arm64
$(SUDO) docker manifest create $(IMAGE_PREFIX)build-image:$(IMAGE_TAG) --amend $(IMAGE_PREFIX)build-image:${IMAGE_TAG}-amd64 --amend $(IMAGE_PREFIX)build-image:${IMAGE_TAG}-arm64
$(SUDO) docker manifest push $(IMAGE_PREFIX)build-image:$(IMAGE_TAG)
2 changes: 1 addition & 1 deletion cmd/cortex/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19
ARG TARGETARCH

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion cmd/query-tee/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19
ARG TARGETARCH

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion cmd/test-exporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19
ARG TARGETARCH
RUN apk add --no-cache ca-certificates
COPY test-exporter-$TARGETARCH /test-exporter
Expand Down
2 changes: 1 addition & 1 deletion cmd/thanosconvert/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19
ARG TARGETARCH
RUN apk add --no-cache ca-certificates
COPY thanosconvert-$TARGETARCH /thanosconvert
Expand Down
2 changes: 1 addition & 1 deletion development/tsdb-blocks-storage-s3-gossip/dev.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18
FROM golang:1.19
ENV CGO_ENABLED=0
RUN go get github.com/go-delve/delve/cmd/dlv

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19

RUN mkdir /cortex
WORKDIR /cortex
Expand Down
4 changes: 2 additions & 2 deletions development/tsdb-blocks-storage-s3/dev.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.18
FROM golang:1.19
ENV CGO_ENABLED=0
RUN go get github.com/go-delve/delve/cmd/dlv

FROM alpine:3.18
FROM alpine:3.19

RUN mkdir /cortex
WORKDIR /cortex
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19

RUN mkdir /cortex
WORKDIR /cortex
Expand Down
12 changes: 12 additions & 0 deletions docs/api/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ _For more information, please check out Prometheus [Remote storage integrations]

_Requires [authentication](#authentication)._

### OTLP Receiver

```
POST /api/v1/otlp/v1/metrics
```

Entrypoint for the OTLP Receiver

This API endpoint accepts a HTTP POST request using [OTLP](https://opentelemetry.io/docs/specs/otlp/) format

_Requires [authentication](#authentication)._

### Distributor ring status

```
Expand Down
8 changes: 3 additions & 5 deletions docs/contributing/how-to-update-the-build-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ weight: 5
slug: how-to-update-the-build-image
---

The build image currently can only be updated by a Cortex maintainer. If you're not a maintainer you can still open a PR with the changes, asking a maintainer to assist you publishing the updated image. The procedure is:
The procedure is:

1. Update `build-image/Dockerfile`
1. Run `go env` and make sure `GOPROXY=https://proxy.golang.org,direct` (Go's default). Some environment may required `GOPROXY=direct`, and if you push a build image with this, build workflow on GitHub will take a lot longer to download modules.
1. `docker login quay.io`. Note that pushing to `quay.io/cortexproject/build-image` repository can only be done by a maintainer.
1. Build the and publish the image by using `make push-multiarch-build-image`. This will build and push multi-platform docker image (for linux/amd64 and linux/arm64). Running this step successfully requires [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/), but does not require a specific platform.
1. Replace the image tag in `.github/workflows/*` (_there may be multiple references_) and Makefile (variable `LATEST_BUILD_IMAGE_TAG`).
1. Create a PR to master with that changed, after the PR is merged to master, the new build image is available in the quay.io repository. Check github action logs [here](https://github.com/cortexproject/cortex/actions/workflows/build-image.yml) for to find the image tag.
1. Create another PR to replace the image tag in `.github/workflows/*` (_there may be multiple references_) and Makefile (variable `LATEST_BUILD_IMAGE_TAG`).
1. If you are updating Go's runtime version be sure to change `actions/setup-go`'s `go-version` in ``.github/workflows/*`.
1. Open a PR and make sure the CI with new build-image passes
2 changes: 1 addition & 1 deletion docs/getting-started/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORTEX_VERSION=v1.17.0
CORTEX_VERSION=v1.17.1
GRAFANA_VERSION=10.4.2
PROMETHEUS_VERSION=v2.51.2
SEAWEEDFS_VERSION=3.67
Loading

0 comments on commit 5461a54

Please sign in to comment.