Skip to content
Closed
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
244 changes: 123 additions & 121 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,152 +11,154 @@ workflows:
test-build-deploy:
# You must specify a tag filter for each job that deploy depends on.
jobs:
- lint:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- test:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- integration:
requires:
- build
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- build:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- deploy:
requires:
- build
- test
- lint
- integration
filters:
branches:
only: master
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- lint:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- test:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- integration:
requires:
- build
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- build:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- deploy:
requires:
- build
- test
- lint
- integration
filters:
branches:
only: master
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/

commands:
install-docker:
steps:
- run:
name: Install Docker client
command: |
set -x
VER="17.03.0-ce"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
- run:
name: Install Docker client
command: |
set -x
VER="17.03.0-ce"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin

jobs:
lint:
<<: *defaults
steps:
- checkout
- run:
name: Lint
command: make BUILD_IN_CONTAINER=false lint
- run:
name: Check vendor directory is consistent.
command: make BUILD_IN_CONTAINER=false mod-check
- run:
name: Check protos are consistent.
command: make BUILD_IN_CONTAINER=false check-protos
- checkout
- run:
name: Lint
command: make BUILD_IN_CONTAINER=false lint
- run:
name: Check vendor directory is consistent.
command: make BUILD_IN_CONTAINER=false mod-check
- run:
name: Check protos are consistent.
command: make BUILD_IN_CONTAINER=false check-protos

test:
<<: *defaults
steps:
- checkout
- run:
name: Test
command: make BUILD_IN_CONTAINER=false test
- checkout
- run:
name: Test
command: make BUILD_IN_CONTAINER=false test

integration:
machine:
image: ubuntu-1604:201903-01

working_directory: ~/src/github.com/cortexproject/cortex
steps:
- checkout
- restore_cache:
key: v1-cortex-{{ .Branch }}-{{ .Revision }}
- run:
name: Integration Test
command: |
touch build-image/.uptodate
MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations make BUILD_IMAGE=cortexproject/build-image:1370-pin-protoc-7ae297930 configs-integration-test
- run:
name: Load Images
command: ln -s /tmp/images ./images; make BUILD_IN_CONTAINER=false load-images
- run:
name: Ingester hand-over test
command: ./integration-tests/test-handover.sh
- run:
name: Ingester flush test
command: |
./integration-tests/stop-components.sh
./integration-tests/test-flush.sh
- checkout
- restore_cache:
key: v1-cortex-{{ .Branch }}-{{ .Revision }}
- run:
name: Integration Test
command: |
touch build-image/.uptodate
MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations make BUILD_IMAGE=cortexproject/build-image:1370-pin-protoc-7ae297930 configs-integration-test
- run:
name: Load Images
command: ln -s /tmp/images ./images; make BUILD_IN_CONTAINER=false load-images
- run:
name: Ingester hand-over test
command: ./integration-tests/test-handover.sh
- run:
name: Ingester flush test
command: |
./integration-tests/stop-components.sh
./integration-tests/test-flush.sh

build:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- install-docker

- run:
name: Build
command: |
touch build-image/.uptodate
make BUILD_IN_CONTAINER=false

- store_artifacts:
path: pkg/querier/frontend/frontend.pb.go
- store_artifacts:
path: pkg/chunk/storage/caching_index_client.pb.go
- store_artifacts:
path: pkg/ring/ring.pb.go
- store_artifacts:
path: pkg/ingester/client/cortex.pb.go

- run:
name: Save Images
command: |
mkdir /tmp/images
ln -s /tmp/images ./images
make BUILD_IN_CONTAINER=false save-images

- save_cache:
key: v1-cortex-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/images/
- checkout
- setup_remote_docker
- install-docker

- run:
name: Build
command: |
touch build-image/.uptodate
make BUILD_IN_CONTAINER=false

- store_artifacts:
path: pkg/querier/frontend/frontend.pb.go
- store_artifacts:
path: pkg/chunk/storage/caching_index_client.pb.go
- store_artifacts:
path: pkg/ring/ring.pb.go
- store_artifacts:
path: pkg/ingester/client/cortex.pb.go
- store_artifacts:
path: pkg/ruler/rules/rules.pb.go

- run:
name: Save Images
command: |
mkdir /tmp/images
ln -s /tmp/images ./images
make BUILD_IN_CONTAINER=false save-images

- save_cache:
key: v1-cortex-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/images/

deploy:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- install-docker

- restore_cache:
key: v1-cortex-{{ .Branch }}-{{ .Revision }}

- run:
name: Load Images
command: ln -s /tmp/images ./images; make BUILD_IN_CONTAINER=false load-images

- run:
name: Deploy
command: |
if [ -n "$DOCKER_REGISTRY_PASSWORD" ]; then
docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
fi
if [ -n "$QUAY_PASSWORD" ]; then
docker login -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io;
fi
IMAGE_TAG=$CIRCLE_TAG ./push-images $NOQUAY
- checkout
- setup_remote_docker
- install-docker

- restore_cache:
key: v1-cortex-{{ .Branch }}-{{ .Revision }}

- run:
name: Load Images
command: ln -s /tmp/images ./images; make BUILD_IN_CONTAINER=false load-images

- run:
name: Deploy
command: |
if [ -n "$DOCKER_REGISTRY_PASSWORD" ]; then
docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
fi
if [ -n "$QUAY_PASSWORD" ]; then
docker login -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io;
fi
IMAGE_TAG=$CIRCLE_TAG ./push-images $NOQUAY
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pkg/querier/frontend/frontend.pb.go: pkg/querier/frontend/frontend.proto
pkg/querier/queryrange/queryrange.pb.go: pkg/querier/queryrange/queryrange.proto
pkg/chunk/storage/caching_index_client.pb.go: pkg/chunk/storage/caching_index_client.proto
pkg/distributor/ha_tracker.pb.go: pkg/distributor/ha_tracker.proto
pkg/ruler/rules/rules.pb.go: pkg/ruler/rules/rules.proto
all: $(UPTODATE_FILES)
test: protos
mod-check: protos
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ require (
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/consul/api v1.1.0
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/jonboulle/clockwork v0.1.0
github.com/json-iterator/go v1.1.6
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 // indirect
Expand All @@ -61,6 +60,7 @@ require (
github.com/sercand/kuberesolver v2.1.0+incompatible // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.2.2
github.com/stretchr/testify v1.3.0
github.com/tinylib/msgp v0.0.0-20161221055906-38a6f61a768d // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
Expand Down
Loading