Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.

Commit c229987

Browse files
authored
chore(deps): upgrade protobufs version to beta (#33)
Because - we are going to release beta version of VDP This commit - upgrade protobufs version to beta
1 parent c8bd764 commit c229987

32 files changed

+1457
-786
lines changed

cmd/main/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
"github.com/instill-ai/controller-vdp/pkg/service"
3838

3939
custom_otel "github.com/instill-ai/controller-vdp/pkg/logger/otel"
40-
controllerPB "github.com/instill-ai/protogen-go/vdp/controller/v1alpha"
40+
controllerPB "github.com/instill-ai/protogen-go/vdp/controller/v1beta"
4141
)
4242

4343
var propagator propagation.TextMapPropagator
@@ -112,7 +112,7 @@ func main() {
112112
grpc_zap.WithDecider(func(fullMethodName string, err error) bool {
113113
// will not log gRPC calls if it was a call to liveness or readiness and no error was raised
114114
if err == nil {
115-
if match, _ := regexp.MatchString("vdp.controller.v1alpha.ControllerPrivateService/.*", fullMethodName); match {
115+
if match, _ := regexp.MatchString("vdp.controller.v1beta.ControllerPrivateService/.*", fullMethodName); match {
116116
return false
117117
}
118118
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/golang/mock v1.6.0
88
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
99
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0
10-
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231121163720-206d6eff20a7
10+
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231206042803-5ace80a1eafe
1111
github.com/knadh/koanf v1.5.0
1212
github.com/redis/go-redis/v9 v9.2.0
1313
github.com/stretchr/testify v1.8.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKe
242242
github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs=
243243
github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E=
244244
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
245-
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231121163720-206d6eff20a7 h1:vhMCJLPhVvhINR31VgOyq5ct8f7TZx2ZteQXpjGwaEc=
246-
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231121163720-206d6eff20a7/go.mod h1:q/YL5TZXD9nvmJ7Rih4gY3/B2HT2+GiFdxeZp9D+yE4=
245+
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231206042803-5ace80a1eafe h1:8x6a2zzX858AgXd5Cuq+/xkf3kYmcgHbOkzgg1K61VU=
246+
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231206042803-5ace80a1eafe/go.mod h1:q/YL5TZXD9nvmJ7Rih4gY3/B2HT2+GiFdxeZp9D+yE4=
247247
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
248248
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
249249
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=

integration-test/controller-private.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import * as constant from "./const.js"
88

99
const clientPrivate = new grpc.Client();
10-
clientPrivate.load(['proto/vdp/controller/v1alpha'], 'controller_service.proto');
10+
clientPrivate.load(['proto/vdp/controller/v1beta'], 'controller_service.proto');
1111

1212

1313
export function CheckConnector() {
@@ -21,24 +21,24 @@ export function CheckConnector() {
2121
});
2222

2323
group("Controller API: Create connector resource state in etcd", () => {
24-
var resCreateConnectorHTTP = clientPrivate.invoke('vdp.controller.v1alpha.ControllerPrivateService/UpdateResource', {
24+
var resCreateConnectorHTTP = clientPrivate.invoke('vdp.controller.v1beta.ControllerPrivateService/UpdateResource', {
2525
resource: httpConnector
2626
})
2727
check(resCreateConnectorHTTP, {
28-
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response StatusOK": (r) => r.status === grpc.StatusOK,
29-
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response connector resource_permalink matched": (r) => r.message.resource.resourcePermalink == httpConnector.resource_permalink,
28+
"vdp.controller.v1beta.ControllerPrivateService/UpdateResource response StatusOK": (r) => r.status === grpc.StatusOK,
29+
"vdp.controller.v1beta.ControllerPrivateService/UpdateResource response connector resource_permalink matched": (r) => r.message.resource.resourcePermalink == httpConnector.resource_permalink,
3030
});
3131
});
3232

3333
group("Controller API: Get connector resource state in etcd", () => {
34-
var resGetConnectorHTTP = clientPrivate.invoke(`vdp.controller.v1alpha.ControllerPrivateService/GetResource`, {
34+
var resGetConnectorHTTP = clientPrivate.invoke(`vdp.controller.v1beta.ControllerPrivateService/GetResource`, {
3535
resource_permalink: httpConnector.resource_permalink
3636
})
3737

3838
check(resGetConnectorHTTP, {
39-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
40-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response connector resource_permalink matched`]: (r) => r.message.resource.resourcePermalink === httpConnector.resource_permalink,
41-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response connector state matched STATE_CONNECTED`]: (r) => r.message.resource.connectorState == "STATE_CONNECTED",
39+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
40+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response connector resource_permalink matched`]: (r) => r.message.resource.resourcePermalink === httpConnector.resource_permalink,
41+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response connector state matched STATE_CONNECTED`]: (r) => r.message.resource.connectorState == "STATE_CONNECTED",
4242
});
4343
});
4444
}
@@ -54,25 +54,25 @@ export function CheckPipelineResource() {
5454
});
5555

5656
group("Controller API: Create pipeline resource state in etcd", () => {
57-
var resCreatePipelineHTTP = clientPrivate.invoke('vdp.controller.v1alpha.ControllerPrivateService/UpdateResource', {
57+
var resCreatePipelineHTTP = clientPrivate.invoke('vdp.controller.v1beta.ControllerPrivateService/UpdateResource', {
5858
resource: httpPipelineResource
5959
})
6060

6161
check(resCreatePipelineHTTP, {
62-
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response StatusOK": (r) => r.status === grpc.StatusOK,
63-
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response pipeline resource_permalink matched": (r) => r.message.resource.resourcePermalink == httpPipelineResource.resource_permalink,
62+
"vdp.controller.v1beta.ControllerPrivateService/UpdateResource response StatusOK": (r) => r.status === grpc.StatusOK,
63+
"vdp.controller.v1beta.ControllerPrivateService/UpdateResource response pipeline resource_permalink matched": (r) => r.message.resource.resourcePermalink == httpPipelineResource.resource_permalink,
6464
});
6565
});
6666

6767
group("Controller API: Get pipeline resource state in etcd", () => {
68-
var resGetPipelineHTTP = clientPrivate.invoke(`vdp.controller.v1alpha.ControllerPrivateService/GetResource`, {
68+
var resGetPipelineHTTP = clientPrivate.invoke(`vdp.controller.v1beta.ControllerPrivateService/GetResource`, {
6969
resource_permalink: httpPipelineResource.resource_permalink
7070
})
7171

7272
check(resGetPipelineHTTP, {
73-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpPipelineResource.resource_permalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
74-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpPipelineResource.resource_permalink} response pipeline resource_permalink matched`]: (r) => r.message.resource.resourcePermalink === httpPipelineResource.resource_permalink,
75-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpPipelineResource.resource_permalink} response pipeline state matched STATE_ACTIVE`]: (r) => r.message.resource.pipelineState == "STATE_ACTIVE",
73+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpPipelineResource.resource_permalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
74+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpPipelineResource.resource_permalink} response pipeline resource_permalink matched`]: (r) => r.message.resource.resourcePermalink === httpPipelineResource.resource_permalink,
75+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpPipelineResource.resource_permalink} response pipeline state matched STATE_ACTIVE`]: (r) => r.message.resource.pipelineState == "STATE_ACTIVE",
7676
});
7777
});
7878
}
@@ -88,25 +88,25 @@ export function CheckServiceResource() {
8888
});
8989

9090
group("Controller API: Create service resource state in etcd", () => {
91-
var resCreateServiceHTTP = clientPrivate.invoke('vdp.controller.v1alpha.ControllerPrivateService/UpdateResource', {
91+
var resCreateServiceHTTP = clientPrivate.invoke('vdp.controller.v1beta.ControllerPrivateService/UpdateResource', {
9292
resource: httpServiceResource
9393
})
9494

9595
check(resCreateServiceHTTP, {
96-
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response StatusOK": (r) => r.status === grpc.StatusOK,
97-
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response service name matched": (r) => r.message.resource.name == httpServiceResource.name,
96+
"vdp.controller.v1beta.ControllerPrivateService/UpdateResource response StatusOK": (r) => r.status === grpc.StatusOK,
97+
"vdp.controller.v1beta.ControllerPrivateService/UpdateResource response service name matched": (r) => r.message.resource.name == httpServiceResource.name,
9898
});
9999
});
100100

101101
group("Controller API: Get service resource state in etcd", () => {
102-
var resGetServiceHTTP = clientPrivate.invoke(`vdp.controller.v1alpha.ControllerPrivateService/GetResource`, {
102+
var resGetServiceHTTP = clientPrivate.invoke(`vdp.controller.v1beta.ControllerPrivateService/GetResource`, {
103103
resource_permalink: httpServiceResource.resource_permalink
104104
})
105105

106106
check(resGetServiceHTTP, {
107-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpServiceResource.resource_permalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
108-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpServiceResource.resource_permalink} response service name matched`]: (r) => r.message.resource.resourcePermalink === httpServiceResource.resource_permalink,
109-
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpServiceResource.resource_permalink} response service state matched STATE_ACTIVE`]: (r) => r.message.resource.backendState == "SERVING_STATUS_SERVING",
107+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpServiceResource.resource_permalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
108+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpServiceResource.resource_permalink} response service name matched`]: (r) => r.message.resource.resourcePermalink === httpServiceResource.resource_permalink,
109+
[`vdp.controller.v1beta.ControllerPrivateService/GetResource ${httpServiceResource.resource_permalink} response service state matched STATE_ACTIVE`]: (r) => r.message.resource.backendState == "SERVING_STATUS_SERVING",
110110
});
111111
});
112112
}

integration-test/grpc.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import * as constant from "./const.js"
88
import * as controller_service from './controller-private.js';
99
const client = new grpc.Client();
10-
client.load(['proto/vdp/controller/v1alpha'], 'controller_service.proto');
10+
client.load(['proto/vdp/controller/v1beta'], 'controller_service.proto');
1111

1212
export let options = {
1313
setupTimeout: '10s',
@@ -29,12 +29,12 @@ export default function (data) {
2929
plaintext: true
3030
});
3131

32-
check(client.invoke('vdp.controller.v1alpha.ControllerPrivateService/Liveness', {}), {
32+
check(client.invoke('vdp.controller.v1beta.ControllerPrivateService/Liveness', {}), {
3333
'Liveness Status is OK': (r) => r && r.status === grpc.StatusOK,
3434
'Response status is SERVING_STATUS_SERVING': (r) => r && r.message.healthCheckResponse.status === "SERVING_STATUS_SERVING",
3535
});
3636

37-
check(client.invoke('vdp.controller.v1alpha.ControllerPrivateService/Readiness', {}), {
37+
check(client.invoke('vdp.controller.v1beta.ControllerPrivateService/Readiness', {}), {
3838
'Readiness Status is OK': (r) => r && r.status === grpc.StatusOK,
3939
'Response status is SERVING_STATUS_SERVING': (r) => r && r.message.healthCheckResponse.status === "SERVING_STATUS_SERVING",
4040
});
@@ -58,22 +58,22 @@ export function teardown(data) {
5858
});
5959
group("Controller API: Delete all resources created by the test", () => {
6060

61-
check(client.invoke(`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource`, {
61+
check(client.invoke(`vdp.controller.v1beta.ControllerPrivateService/DeleteResource`, {
6262
resource_permalink: constant.connectorPermalink
6363
}), {
64-
[`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource ${constant.connectorPermalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
64+
[`vdp.controller.v1beta.ControllerPrivateService/DeleteResource ${constant.connectorPermalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
6565
});
6666

67-
check(client.invoke(`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource`, {
67+
check(client.invoke(`vdp.controller.v1beta.ControllerPrivateService/DeleteResource`, {
6868
resource_permalink: constant.pipelineResourcePermalink
6969
}), {
70-
[`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource ${constant.pipelineResourcePermalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
70+
[`vdp.controller.v1beta.ControllerPrivateService/DeleteResource ${constant.pipelineResourcePermalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
7171
});
7272

73-
check(client.invoke(`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource`, {
73+
check(client.invoke(`vdp.controller.v1beta.ControllerPrivateService/DeleteResource`, {
7474
resource_permalink: constant.serviceResourcePermalink
7575
}), {
76-
[`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource ${constant.serviceResourcePermalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
76+
[`vdp.controller.v1beta.ControllerPrivateService/DeleteResource ${constant.serviceResourcePermalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
7777
});
7878
});
7979
client.close();

integration-test/proto/common/healthcheck/v1alpha/healthcheck.proto renamed to integration-test/proto/common/healthcheck/v1beta/healthcheck.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
22

3-
package common.healthcheck.v1alpha;
3+
package common.healthcheck.v1beta;
44

55
// Google API
66
import "google/api/field_behavior.proto";

integration-test/proto/vdp/controller/v1alpha/controller.proto renamed to integration-test/proto/vdp/controller/v1beta/controller.proto

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
syntax = "proto3";
22

3-
package vdp.controller.v1alpha;
3+
package vdp.controller.v1beta;
44

5-
import "../../../common/healthcheck/v1alpha/healthcheck.proto";
5+
import "../../../common/healthcheck/v1beta/healthcheck.proto";
66
// Google api
77
import "google/api/field_behavior.proto";
88
import "google/api/resource.proto";
99
// Protobuf standard
1010
import "protoc-gen-openapiv2/options/annotations.proto";
11-
import "../../../vdp/pipeline/v1alpha/connector.proto";
12-
import "../../../vdp/pipeline/v1alpha/pipeline.proto";
11+
import "../../../vdp/pipeline/v1beta/connector.proto";
12+
import "../../../vdp/pipeline/v1beta/pipeline.proto";
1313

1414
// LivenessRequest represents a request to check a service liveness status
1515
message LivenessRequest {
1616
// HealthCheckRequest message
17-
optional common.healthcheck.v1alpha.HealthCheckRequest health_check_request = 1 [(google.api.field_behavior) = OPTIONAL];
17+
optional common.healthcheck.v1beta.HealthCheckRequest health_check_request = 1 [(google.api.field_behavior) = OPTIONAL];
1818
}
1919

2020
// LivenessResponse represents a response for a service liveness status
2121
message LivenessResponse {
2222
// HealthCheckResponse message
23-
common.healthcheck.v1alpha.HealthCheckResponse health_check_response = 1;
23+
common.healthcheck.v1beta.HealthCheckResponse health_check_response = 1;
2424
}
2525

2626
// ReadinessRequest represents a request to check a service readiness status
2727
message ReadinessRequest {
2828
// HealthCheckRequest message
29-
optional common.healthcheck.v1alpha.HealthCheckRequest health_check_request = 1 [(google.api.field_behavior) = OPTIONAL];
29+
optional common.healthcheck.v1beta.HealthCheckRequest health_check_request = 1 [(google.api.field_behavior) = OPTIONAL];
3030
}
3131

3232
// ReadinessResponse represents a response for a service readiness status
3333
message ReadinessResponse {
3434
// HealthCheckResponse message
35-
common.healthcheck.v1alpha.HealthCheckResponse health_check_response = 1;
35+
common.healthcheck.v1beta.HealthCheckResponse health_check_response = 1;
3636
}
3737

3838
// Resource represents the current information of a resource
@@ -48,11 +48,11 @@ message Resource {
4848
// Resource state
4949
oneof state {
5050
// Pipeline state
51-
vdp.pipeline.v1alpha.State pipeline_state = 3;
51+
vdp.pipeline.v1beta.State pipeline_state = 3;
5252
// Connector state
53-
vdp.pipeline.v1alpha.Connector.State connector_state = 4;
53+
vdp.pipeline.v1beta.Connector.State connector_state = 4;
5454
// Backend service state
55-
common.healthcheck.v1alpha.HealthCheckResponse.ServingStatus backend_state = 5;
55+
common.healthcheck.v1beta.HealthCheckResponse.ServingStatus backend_state = 5;
5656
}
5757
// Resource longrunning progress
5858
optional int32 progress = 6 [(google.api.field_behavior) = OPTIONAL];
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
syntax = "proto3";
22

3-
package vdp.controller.v1alpha;
3+
package vdp.controller.v1beta;
44

55
// Google API
66
import "google/api/annotations.proto";
77
import "google/api/client.proto";
8-
import "../../../vdp/controller/v1alpha/controller.proto";
8+
import "../../../vdp/controller/v1beta/controller.proto";
99

1010
// Controller service responds to incoming controller requests
1111
service ControllerPrivateService {
@@ -14,39 +14,39 @@ service ControllerPrivateService {
1414
// See https://github.com/grpc/grpc/blob/master/doc/health-checking.md
1515
rpc Liveness(LivenessRequest) returns (LivenessResponse) {
1616
option (google.api.http) = {
17-
get: "/v1alpha/__liveness"
17+
get: "/v1beta/__liveness"
1818
additional_bindings: [
19-
{get: "/v1alpha/health/controller"}]
19+
{get: "/v1beta/health/controller"}]
2020
};
2121
}
2222

2323
// Readiness method receives a ReadinessRequest message and returns a
2424
// ReadinessResponse message.
2525
// See https://github.com/grpc/grpc/blob/master/doc/health-checking.md
2626
rpc Readiness(ReadinessRequest) returns (ReadinessResponse) {
27-
option (google.api.http) = {get: "/v1alpha/__readiness"};
27+
option (google.api.http) = {get: "/v1beta/__readiness"};
2828
}
2929

3030
// GetResource method receives a GetResourceRequest message
3131
// and returns a GetResourceResponse
3232
rpc GetResource(GetResourceRequest) returns (GetResourceResponse) {
33-
option (google.api.http) = {get: "/v1alpha/{resource_permalink=resources/*/types/*}"};
33+
option (google.api.http) = {get: "/v1beta/{resource_permalink=resources/*/types/*}"};
3434
option (google.api.method_signature) = "resource_permalink";
3535
}
3636

3737
// UpdateResource method receives a UpdateResourceRequest message
3838
// and returns a UpdateResourceResponse
3939
rpc UpdateResource(UpdateResourceRequest) returns (UpdateResourceResponse) {
4040
option (google.api.http) = {
41-
patch: "/v1alpha/{resource.resource_permalink=resources/*/types/*}"
41+
patch: "/v1beta/{resource.resource_permalink=resources/*/types/*}"
4242
body: "resource"
4343
};
4444
}
4545

4646
// DeleteResource method receives a DeleteResourceRequest message
4747
// and returns a DeleteResourceResponse
4848
rpc DeleteResource(DeleteResourceRequest) returns (DeleteResourceResponse) {
49-
option (google.api.http) = {delete: "/v1alpha/{resource_permalink=resources/*/types/*}"};
49+
option (google.api.http) = {delete: "/v1beta/{resource_permalink=resources/*/types/*}"};
5050
option (google.api.method_signature) = "resource_permalink";
5151
}
5252
}

0 commit comments

Comments
 (0)