Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change coordinator to query and add m3query service #817

Merged
merged 9 commits into from
Aug 2, 2018
Merged
Show file tree
Hide file tree
Changes from 8 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
8 changes: 4 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ coverage:
status:
project:
default: on
coordinator:
flags: coordinator
query:
flags: query
dbnode:
flags: dbnode
m3ninx:
Expand All @@ -18,9 +18,9 @@ coverage:
default: off

flags:
coordinator:
query:
paths:
- src/coordinator/
- src/query/
- src/cmd/services/m3coordinator/
dbnode:
paths:
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ SERVICES := \
m3coordinator \
m3nsch_server \
m3nsch_client \
m3query \

SUBDIRS := \
cmd \
dbnode \
coordinator \
query \
m3nsch \
m3ninx \

Expand Down
2 changes: 1 addition & 1 deletion docker/m3coordinator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ LABEL maintainer="The M3DB Authors <[email protected]>"
EXPOSE 7201/tcp 7203/tcp

COPY --from=builder /go/src/github.com/m3db/m3db/bin/m3coordinator /bin/
COPY --from=builder /go/src/github.com/m3db/m3db/src/coordinator/config/m3coordinator-local-etcd.yml /etc/m3coordinator/m3coordinator.yml
COPY --from=builder /go/src/github.com/m3db/m3db/src/query/config/m3coordinator-local-etcd.yml /etc/m3coordinator/m3coordinator.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm do you want to chance the directory name here too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah maybe we should move these config files outside of src completely? It's weird we have some YAML files in these dirs floating around.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess we should figure out if we want to have an m3coordinator and an m3query dockerfile? we can discuss today once everyone is in


ENTRYPOINT [ "/bin/m3coordinator" ]
CMD [ "-f", "/etc/m3coordinator/m3coordinator.yml" ]
4 changes: 2 additions & 2 deletions scripts/process-cover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ fi
COVERFILE=$1
SUBMIT_COVER="$(dirname $0)/../.ci/codecov.sh"

TARGETS=("dbnode" "coordinator" "m3ninx")
TARGETS=("dbnode" "query" "m3ninx")
target_patterns() {
case $1 in
'dbnode') echo "^mode|github.com/m3db/m3db/src/dbnode|github.com/m3db/m3db/src/cmd/services/m3dbnode";;
'coordinator') echo "^mode|github.com/m3db/m3db/src/coordinator|github.com/m3db/m3db/src/cmd/services/m3coordinator";;
'query') echo "^mode|github.com/m3db/m3db/src/query|github.com/m3db/m3db/src/cmd/services/m3coordinator";;
'm3ninx') echo "^mode|github.com/m3db/m3db/src/m3ninx";;
*) echo "unknown key: $1"; exit 1;;
esac
Expand Down
2 changes: 1 addition & 1 deletion scripts/site-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

ASSET_DIR=${1:-src/coordinator/generated/assets/openapi}
ASSET_DIR=${1:-src/query/generated/assets/openapi}

# Copy over OpenAPI doc.
mkdir -p m3metrics.io/openapi
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/services/m3coordinator/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
_ "net/http/pprof" // pprof: for debug listen server if configured
"os"

"github.com/m3db/m3db/src/coordinator/services/m3coordinator/server"
"github.com/m3db/m3db/src/query/services/m3coordinator/server"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan is to follow up and move the package being imported here to src/coordinator/server/... yeah?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes- and register the placement handlers there and remove them from src/github.com/m3db/m3db/src/query/services/m3coordinator/server (and also rename this to .../services/m3query/...

)

var (
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/services/m3dbnode/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"strings"
"time"

coordinatorcfg "github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
coordinatorcfg "github.com/m3db/m3db/src/cmd/services/m3query/config"
"github.com/m3db/m3db/src/dbnode/client"
"github.com/m3db/m3db/src/dbnode/environment"
"github.com/m3db/m3x/config/hostid"
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/services/m3dbnode/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3db/src/cmd/services/m3dbnode/config"
dbserver "github.com/m3db/m3db/src/cmd/services/m3dbnode/server"
coordinatorserver "github.com/m3db/m3db/src/coordinator/services/m3coordinator/server"
"github.com/m3db/m3db/src/dbnode/client"
coordinatorserver "github.com/m3db/m3db/src/query/services/m3coordinator/server"
xconfig "github.com/m3db/m3x/config"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"time"

etcdclient "github.com/m3db/m3cluster/client/etcd"
"github.com/m3db/m3db/src/coordinator/storage/local"
"github.com/m3db/m3db/src/query/storage/local"
"github.com/m3db/m3x/instrument"
)

Expand Down
46 changes: 46 additions & 0 deletions src/cmd/services/m3query/main/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright (c) 2018 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package main

import (
"flag"
_ "net/http/pprof" // pprof: for debug listen server if configured
"os"

"github.com/m3db/m3db/src/query/services/m3coordinator/server"
)

var (
configFile = flag.String("f", "", "configuration file")
)

func main() {
flag.Parse()

if len(*configFile) == 0 {
flag.Usage()
os.Exit(1)
}

server.Run(server.RunOptions{
ConfigFile: *configFile,
})
}
2 changes: 0 additions & 2 deletions src/coordinator/integration/testdata/read_data.snappy

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/coordinator/README.md → src/query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ Run m3coordinator binary:

Run Prometheus Docker image:

$ docker run -p 9090:9090 -v $GOPATH/src/github.com/m3db/m3db/src/coordinator/docker/prometheus-mac.yml:/etc/prometheus/prometheus.yml quay.io/prometheus/prometheus
$ docker run -p 9090:9090 -v $GOPATH/src/github.com/m3db/m3db/src/query/docker/prometheus-mac.yml:/etc/prometheus/prometheus.yml quay.io/prometheus/prometheus

### Running on GCP

Setup GCP for [single m3db node](https://github.com/m3db/m3db/pull/452/files?short_path=20bfc3f#diff-20bfc3ff6a860483887b93bf9cf0d135)

> For a multi-node cluster, [see here](https://github.com/m3db/m3db/src/coordinator/tree/master/benchmark)
> For a multi-node cluster, [see here](https://github.com/m3db/m3db/src/query/tree/master/benchmark)

Setup GCP for m3coordinator:

Expand All @@ -80,7 +80,7 @@ Setup and run Prometheus:
- url: http://10.142.0.8:7201/api/v1/prom/remote/write
```
3. Run Prometheus
$ sudo docker run -p 9090:9090 -v $GOPATH/src/github.com/m3db/m3db/src/coordinator/docker/prometheus.yml:/etc/prometheus/prometheus.yml quay.io/prometheus/prometheus
$ sudo docker run -p 9090:9090 -v $GOPATH/src/github.com/m3db/m3db/src/query/docker/prometheus.yml:/etc/prometheus/prometheus.yml quay.io/prometheus/prometheus

[doc-img]: https://godoc.org/github.com/m3db/m3db/src/coordinator?status.svg
[doc]: https://godoc.org/github.com/m3db/m3db/src/coordinator
[doc-img]: https://godoc.org/github.com/m3db/m3db/src/query?status.svg
[doc]: https://godoc.org/github.com/m3db/m3db/src/query
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"strings"
"time"

"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ package database

import (
clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
dbconfig "github.com/m3db/m3db/src/cmd/services/m3dbnode/config"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/cmd/services/m3query/config"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/gorilla/mux"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ import (

clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3cluster/generated/proto/placementpb"
"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
dbconfig "github.com/m3db/m3db/src/cmd/services/m3dbnode/config"
"github.com/m3db/m3db/src/coordinator/api/v1/handler"
"github.com/m3db/m3db/src/coordinator/api/v1/handler/namespace"
"github.com/m3db/m3db/src/coordinator/api/v1/handler/placement"
"github.com/m3db/m3db/src/coordinator/generated/proto/admin"
"github.com/m3db/m3db/src/coordinator/util"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/cmd/services/m3query/config"
dbnamespace "github.com/m3db/m3db/src/dbnode/storage/namespace"
"github.com/m3db/m3db/src/query/api/v1/handler"
"github.com/m3db/m3db/src/query/api/v1/handler/namespace"
"github.com/m3db/m3db/src/query/api/v1/handler/placement"
"github.com/m3db/m3db/src/query/generated/proto/admin"
"github.com/m3db/m3db/src/query/util"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/golang/protobuf/jsonpb"
"go.uber.org/zap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import (
"github.com/m3db/m3cluster/kv"
"github.com/m3db/m3cluster/placement"
"github.com/m3db/m3cluster/services"
"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
dbconfig "github.com/m3db/m3db/src/cmd/services/m3dbnode/config"
"github.com/m3db/m3db/src/coordinator/api/v1/handler/namespace"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/cmd/services/m3query/config"
xtest "github.com/m3db/m3db/src/dbnode/x/test"
"github.com/m3db/m3db/src/query/api/v1/handler/namespace"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"net/http"

clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3db/src/coordinator/api/v1/handler"
"github.com/m3db/m3db/src/coordinator/generated/proto/admin"
"github.com/m3db/m3db/src/coordinator/util/logging"
nsproto "github.com/m3db/m3db/src/dbnode/generated/proto/namespace"
"github.com/m3db/m3db/src/dbnode/storage/namespace"
"github.com/m3db/m3db/src/query/api/v1/handler"
"github.com/m3db/m3db/src/query/generated/proto/admin"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/gogo/protobuf/jsonpb"
"go.uber.org/zap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3cluster/kv"
"github.com/m3db/m3db/src/coordinator/util/logging"
nsproto "github.com/m3db/m3db/src/dbnode/generated/proto/namespace"
"github.com/m3db/m3db/src/dbnode/storage/namespace"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/gorilla/mux"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"testing"

"github.com/m3db/m3cluster/kv"
"github.com/m3db/m3db/src/coordinator/util/logging"
nsproto "github.com/m3db/m3db/src/dbnode/generated/proto/namespace"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"strings"

clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3db/src/coordinator/api/v1/handler"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/dbnode/storage/namespace"
"github.com/m3db/m3db/src/query/api/v1/handler"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/gorilla/mux"
"go.uber.org/zap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (

clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3cluster/kv"
"github.com/m3db/m3db/src/coordinator/api/v1/handler"
"github.com/m3db/m3db/src/coordinator/generated/proto/admin"
"github.com/m3db/m3db/src/coordinator/util/logging"
nsproto "github.com/m3db/m3db/src/dbnode/generated/proto/namespace"
"github.com/m3db/m3db/src/query/api/v1/handler"
"github.com/m3db/m3db/src/query/generated/proto/admin"
"github.com/m3db/m3db/src/query/util/logging"

"go.uber.org/zap"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

"github.com/m3db/m3cluster/client"
"github.com/m3db/m3cluster/kv"
"github.com/m3db/m3db/src/coordinator/util/logging"
nsproto "github.com/m3db/m3db/src/dbnode/generated/proto/namespace"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ package openapi
import (
"net/http"

"github.com/m3db/m3db/src/coordinator/api/v1/handler"
assets "github.com/m3db/m3db/src/coordinator/generated/assets/openapi"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/query/api/v1/handler"
assets "github.com/m3db/m3db/src/query/generated/assets/openapi"
"github.com/m3db/m3db/src/query/util/logging"

"go.uber.org/zap"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (

clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3cluster/placement"
"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
"github.com/m3db/m3db/src/coordinator/api/v1/handler"
"github.com/m3db/m3db/src/coordinator/generated/proto/admin"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/cmd/services/m3query/config"
"github.com/m3db/m3db/src/query/api/v1/handler"
"github.com/m3db/m3db/src/query/generated/proto/admin"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/gogo/protobuf/jsonpb"
"go.uber.org/zap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"testing"

"github.com/m3db/m3cluster/placement"
"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
"github.com/m3db/m3db/src/cmd/services/m3query/config"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"github.com/m3db/m3cluster/placement"
"github.com/m3db/m3cluster/services"
"github.com/m3db/m3cluster/shard"
"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/cmd/services/m3query/config"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/gorilla/mux"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"net/http"

clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
"github.com/m3db/m3db/src/coordinator/api/v1/handler"
"github.com/m3db/m3db/src/coordinator/generated/proto/admin"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/cmd/services/m3query/config"
"github.com/m3db/m3db/src/query/api/v1/handler"
"github.com/m3db/m3db/src/query/generated/proto/admin"
"github.com/m3db/m3db/src/query/util/logging"

"github.com/gorilla/mux"
"go.uber.org/zap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"net/http"

clusterclient "github.com/m3db/m3cluster/client"
"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
"github.com/m3db/m3db/src/coordinator/api/v1/handler"
"github.com/m3db/m3db/src/coordinator/util/logging"
"github.com/m3db/m3db/src/cmd/services/m3query/config"
"github.com/m3db/m3db/src/query/api/v1/handler"
"github.com/m3db/m3db/src/query/util/logging"

"go.uber.org/zap"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"net/http/httptest"
"testing"

"github.com/m3db/m3db/src/cmd/services/m3coordinator/config"
"github.com/m3db/m3db/src/cmd/services/m3query/config"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
Loading