Skip to content

Commit

Permalink
fix: daemon service rest api not working (#119)
Browse files Browse the repository at this point in the history
* fix: daemon service rest api not working

Signed-off-by: Derek Wang <whynowy@gmail.com>

* test cases

Signed-off-by: Derek Wang <whynowy@gmail.com>

* .

Signed-off-by: Derek Wang <whynowy@gmail.com>

* fix

Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy committed Aug 6, 2022
1 parent ebc10f4 commit c09502a
Show file tree
Hide file tree
Showing 16 changed files with 221 additions and 193 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ lint: $(GOPATH)/bin/golangci-lint
start: image
kubectl apply -f test/manifests/numaflow-ns.yaml
kubectl kustomize test/manifests | sed 's@quay.io/numaproj/@$(IMAGE_NAMESPACE)/@' | sed 's/:$(BASE_VERSION)/:$(VERSION)/' | kubectl -n numaflow-system apply -l app.kubernetes.io/part-of=numaflow --prune=false --force -f -
kubectl -n numaflow-system wait --for=condition=Ready --timeout 60s pod --all
kubectl -n numaflow-system wait -lapp.kubernetes.io/part-of=numaflow --for=condition=Ready --timeout 60s pod --all

.PHONY: e2eapi-image
e2eapi-image: clean dist/e2eapi
Expand Down
2 changes: 1 addition & 1 deletion controllers/vertex/scaling/scaling.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (s *Scaler) scaleOneVertex(ctx context.Context, key string, worker int) err
if err != nil {
return fmt.Errorf("failed to get daemon service client for pipeline %s, %w", pl.Name, err)
}
vMetrics, err := dClient.GetVertexMetrics(ctx, namespace, pl.Name, vertex.Spec.Name)
vMetrics, err := dClient.GetVertexMetrics(ctx, pl.Name, vertex.Spec.Name)
if err != nil {
return fmt.Errorf("failed to get metrics of vertex key %q, %w", key, err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ The `Inter-Step Buffer Service` can be deleted by
kubectl delete -f https://raw.githubusercontent.com/numaproj/numaflow/stable/examples/1-simple-pipeline.yaml
```

## Coming UP
## Coming Up

Next, let's take a peek at [an advance pipeline](./advanced-start.md), to learn some powerful features of Numaflow.
157 changes: 49 additions & 108 deletions pkg/apis/proto/daemon/daemon.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 1 addition & 23 deletions pkg/apis/proto/daemon/daemon.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/apis/proto/daemon/daemon.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ message GetBufferResponse {
}

message GetVertexMetricsRequest {
required string namespace = 1;
required string pipeline = 2;
required string vertex = 3;

Expand All @@ -71,6 +70,6 @@ service DaemonService {
};

rpc GetVertexMetrics (GetVertexMetricsRequest) returns (GetVertexMetricsResponse) {
option (google.api.http).get = "/api/v1/namespace/{namespace}/pipelines/{pipeline}/vertices/{vertex}/metrics";
option (google.api.http).get = "/api/v1/pipelines/{pipeline}/vertices/{vertex}/metrics";
};
}
7 changes: 3 additions & 4 deletions pkg/daemon/client/daemon_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ func (dc *DaemonClient) GetPipelineBuffer(ctx context.Context, pipeline, buffer
}
}

func (dc *DaemonClient) GetVertexMetrics(ctx context.Context, namespace, pipeline, vertex string) (*daemon.VertexMetrics, error) {
func (dc *DaemonClient) GetVertexMetrics(ctx context.Context, pipeline, vertex string) (*daemon.VertexMetrics, error) {
if rspn, err := dc.client.GetVertexMetrics(ctx, &daemon.GetVertexMetricsRequest{
Namespace: &namespace,
Pipeline: &pipeline,
Vertex: &vertex,
Pipeline: &pipeline,
Vertex: &vertex,
}); err != nil {
return nil, err
} else {
Expand Down

0 comments on commit c09502a

Please sign in to comment.