Skip to content

Commit

Permalink
Merge pull request #23 from codesome/wal
Browse files Browse the repository at this point in the history
Rebase with master
  • Loading branch information
codesome committed Jul 10, 2019
2 parents 831080f + 8710a22 commit 0802aa6
Show file tree
Hide file tree
Showing 2,799 changed files with 615,671 additions and 189,584 deletions.
20 changes: 16 additions & 4 deletions .circleci/config.yml
Expand Up @@ -3,7 +3,7 @@ version: 2
# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
defaults: &defaults
docker:
- image: cortexproject/build-image:switch-imports-f7f4e51d7
- image: cortexproject/build-image:1370-pin-protoc-7ae297930
working_directory: /go/src/github.com/cortexproject/cortex

workflows:
Expand Down Expand Up @@ -34,7 +34,10 @@ jobs:
command: make BUILD_IN_CONTAINER=false lint
- run:
name: Check vendor directory is consistent.
command: make BUILD_IN_CONTAINER=false dep-check
command: make BUILD_IN_CONTAINER=false mod-check
- run:
name: Check protos are consistent.
command: make BUILD_IN_CONTAINER=false check-protos

test:
<<: *defaults
Expand All @@ -46,7 +49,7 @@ jobs:

integration:
docker:
- image: cortexproject/build-image:switch-imports-f7f4e51d7
- image: cortexproject/build-image:1370-pin-protoc-7ae297930
- image: circleci/postgres:9.6.2-alpine
environment:
POSTGRES_DB: configs_test
Expand All @@ -56,7 +59,7 @@ jobs:
- checkout
- run:
name: Integration Test
command: MIGRATIONS_DIR=$(pwd)/cmd/configs/migrations make BUILD_IN_CONTAINER=false configs-integration-test
command: MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations make BUILD_IN_CONTAINER=false configs-integration-test

build:
<<: *defaults
Expand All @@ -79,6 +82,15 @@ jobs:
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: make BUILD_IN_CONTAINER=false save-images
Expand Down
10 changes: 1 addition & 9 deletions .gitignore
@@ -1,13 +1,5 @@
cmd/alertmanager/alertmanager
cmd/configs/configs
cmd/distributor/distributor
cmd/ingester/ingester
cmd/querier/querier
cmd/query-frontend/query-frontend
cmd/ruler/ruler
cmd/table-manager/table-manager
cmd/lite/lite
cmd/test-exporter/test-exporter
cmd/cortex/cortex
.uptodate
.pkg
.cache
Expand Down
1 change: 1 addition & 0 deletions .lintignore
@@ -1,3 +1,4 @@
./.git*
./tools*
./vendor*
./pkg/configs/legacy_promql*
68 changes: 68 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -15,3 +15,71 @@ git commit -s -m "Here is my signed commit"
```

You can find further instructions [here](https://github.com/probot/dco#how-it-works).

## Building Cortex

To build:
```
make
```

(By default, the build runs in a Docker container, using an image built
with all the tools required. The source code is mounted from where you
run `make` into the build container as a Docker volume.)

To run the test suite:
```
make test
```

## Playing in `minikube`

First, start `minikube`.

You may need to load the Docker images into your minikube environment. There is
a convenient rule in the Makefile to do this:

```
make prime-minikube
```

Then run Cortex in minikube:
```
kubectl apply -f ./k8s
```

(these manifests use `latest` tags, i.e. this will work if you have
just built the images and they are available on the node(s) in your
Kubernetes cluster)

Cortex will sit behind an nginx instance exposed on port 30080. A job is deployed to scrape itself. Try it:

http://192.168.99.100:30080/api/prom/api/v1/query?query=up

If that doesn't work, your Minikube might be using a different ip address. Check with `minikube status`.

### Dependency management

We uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages.
This requires a working Go environment with version 1.11 or greater, git and [bzr](http://wiki.bazaar.canonical.com/Download) installed.

To add or update a new dependency, use the `go get` command:

```bash
# Pick the latest tagged release.
go get example.com/some/module/pkg

# Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z
```

Tidy up the `go.mod` and `go.sum` files:

```bash
go mod tidy
go mod vendor
git add go.mod go.sum vendor
git commit
```

You have to commit the changes to `go.mod` and `go.sum` before submitting the pull request.

0 comments on commit 0802aa6

Please sign in to comment.