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

Commit

Permalink
chore(deps): adopt latest proto pkg (#31)
Browse files Browse the repository at this point in the history
Because

- we've updated the proto pkg to remove connector-backend

This commit

- adopt latest proto pkg
  • Loading branch information
donch1989 authored Nov 22, 2023
1 parent bfeef99 commit 955bdcb
Show file tree
Hide file tree
Showing 49 changed files with 2,031 additions and 3,945 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
component: [pipeline-backend, connector-backend, controller-vdp]
component: [pipeline-backend, controller-vdp]
uses: instill-ai/vdp/.github/workflows/integration-test-backend.yml@main
with:
component: ${{ matrix.component }}
Expand Down Expand Up @@ -139,17 +139,3 @@ jobs:
- name: Run integration-test
run: |
make integration-test API_GATEWAY_URL=localhost:8080
- name: Checkout (connector)
uses: actions/checkout@v3
with:
repository: instill-ai/connector-backend

- name: Load .env file
uses: cardinalby/export-env-action@v2
with:
envFile: .env

- name: Run integration-test
run: |
make integration-test API_GATEWAY_URL=localhost:8080
8 changes: 0 additions & 8 deletions cmd/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ func main() {
pipelinePrivateServiceClient, pipelinePrivateServiceClientConn := external.InitPipelinePrivateServiceClient(ctx)
defer pipelinePrivateServiceClientConn.Close()

connectorPublicServiceClient, connectorPublicServiceClientConn := external.InitConnectorPublicServiceClient(ctx)
defer connectorPublicServiceClientConn.Close()

connectorPrivateServiceClient, connectorPrivateServiceClientConn := external.InitConnectorPrivateServiceClient(ctx)
defer connectorPrivateServiceClientConn.Close()

mgmtPublicServiceClient, mgmtPublicServiceClientConn := external.InitMgmtPublicServiceClient(ctx)
defer mgmtPublicServiceClientConn.Close()

Expand All @@ -160,8 +154,6 @@ func main() {
service := service.NewService(
pipelinePublicServiceClient,
pipelinePrivateServiceClient,
connectorPublicServiceClient,
connectorPrivateServiceClient,
mgmtPublicServiceClient,
*etcdClient,
)
Expand Down
26 changes: 7 additions & 19 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ var Config AppConfig

// AppConfig defines
type AppConfig struct {
Server ServerConfig `koanf:"server"`
Etcd EtcdConfig `koanf:"etcd"`
Database DatabaseConfig `koanf:"database"`
Cache CacheConfig `koanf:"cache"`
ConnectorBackend ConnectorBackendConfig `koanf:"connectorbackend"`
PipelineBackend PipelineBackendConfig `koanf:"pipelinebackend"`
MgmtBackend MgmtBackendConfig `koanf:"mgmtbackend"`
Log LogConfig `koanf:"log"`
Server ServerConfig `koanf:"server"`
Etcd EtcdConfig `koanf:"etcd"`
Database DatabaseConfig `koanf:"database"`
Cache CacheConfig `koanf:"cache"`
PipelineBackend PipelineBackendConfig `koanf:"pipelinebackend"`
MgmtBackend MgmtBackendConfig `koanf:"mgmtbackend"`
Log LogConfig `koanf:"log"`
}

// ServerConfig defines HTTP server configurations
Expand Down Expand Up @@ -72,17 +71,6 @@ type CacheConfig struct {
}
}

// ConnectorBackendConfig related to connector-backend
type ConnectorBackendConfig struct {
Host string `koanf:"host"`
PublicPort int `koanf:"publicport"`
PrivatePort int `koanf:"privateport"`
HTTPS struct {
Cert string `koanf:"cert"`
Key string `koanf:"key"`
}
}

// PipelineBackendConfig related to pipeline-backend
type PipelineBackendConfig struct {
Host string `koanf:"host"`
Expand Down
7 changes: 0 additions & 7 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ tritonserver:
host: triton-server
grpcuri: triton-server:8001
modelstore: /model-repository
connectorbackend:
host: connector-backend
publicport: 8082
privateport: 3082
https:
cert:
key:
pipelinebackend:
host: pipeline-backend
publicport: 8081
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/golang/mock v1.6.0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231019202606-71607ddcd93f
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231121163720-206d6eff20a7
github.com/knadh/koanf v1.5.0
github.com/redis/go-redis/v9 v9.2.0
github.com/stretchr/testify v1.8.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKe
github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs=
github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231019202606-71607ddcd93f h1:hweU93u6qsg8GH/YSogOfa+wOZEnkilGsijcy1xKX7E=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231019202606-71607ddcd93f/go.mod h1:q/YL5TZXD9nvmJ7Rih4gY3/B2HT2+GiFdxeZp9D+yE4=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231121163720-206d6eff20a7 h1:vhMCJLPhVvhINR31VgOyq5ct8f7TZx2ZteQXpjGwaEc=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20231121163720-206d6eff20a7/go.mod h1:q/YL5TZXD9nvmJ7Rih4gY3/B2HT2+GiFdxeZp9D+yE4=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
Expand Down
2 changes: 1 addition & 1 deletion integration-test/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (__ENV.API_GATEWAY_PROTOCOL) {
export const controllerGRPCPrivateHost = `controller-vdp:3085`;


export const connectorResourcePermalink = `resources/${uuidv4()}/types/connectors`
export const connectorPermalink = `resources/${uuidv4()}/types/connectors`

export const pipelineResourcePermalink = `resources/${uuidv4()}/types/pipelines`

Expand Down
18 changes: 9 additions & 9 deletions integration-test/controller-private.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const clientPrivate = new grpc.Client();
clientPrivate.load(['proto/vdp/controller/v1alpha'], 'controller_service.proto');


export function CheckConnectorResource() {
var httpConnectorResource = {
"resource_permalink": constant.connectorResourcePermalink,
export function CheckConnector() {
var httpConnector = {
"resource_permalink": constant.connectorPermalink,
"connector_state": "STATE_CONNECTED"
}

Expand All @@ -22,23 +22,23 @@ export function CheckConnectorResource() {

group("Controller API: Create connector resource state in etcd", () => {
var resCreateConnectorHTTP = clientPrivate.invoke('vdp.controller.v1alpha.ControllerPrivateService/UpdateResource', {
resource: httpConnectorResource
resource: httpConnector
})
check(resCreateConnectorHTTP, {
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response StatusOK": (r) => r.status === grpc.StatusOK,
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response connectorResource resource_permalink matched": (r) => r.message.resource.resourcePermalink == httpConnectorResource.resource_permalink,
"vdp.controller.v1alpha.ControllerPrivateService/UpdateResource response connector resource_permalink matched": (r) => r.message.resource.resourcePermalink == httpConnector.resource_permalink,
});
});

group("Controller API: Get connector resource state in etcd", () => {
var resGetConnectorHTTP = clientPrivate.invoke(`vdp.controller.v1alpha.ControllerPrivateService/GetResource`, {
resource_permalink: httpConnectorResource.resource_permalink
resource_permalink: httpConnector.resource_permalink
})

check(resGetConnectorHTTP, {
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnectorResource.resource_permalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnectorResource.resource_permalink} response connectorResource resource_permalink matched`]: (r) => r.message.resource.resourcePermalink === httpConnectorResource.resource_permalink,
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnectorResource.resource_permalink} response connectorResource state matched STATE_CONNECTED`]: (r) => r.message.resource.connectorState == "STATE_CONNECTED",
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response connector resource_permalink matched`]: (r) => r.message.resource.resourcePermalink === httpConnector.resource_permalink,
[`vdp.controller.v1alpha.ControllerPrivateService/GetResource ${httpConnector.resource_permalink} response connector state matched STATE_CONNECTED`]: (r) => r.message.resource.connectorState == "STATE_CONNECTED",
});
});
}
Expand Down
6 changes: 3 additions & 3 deletions integration-test/grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function (data) {
client.close();
});

controller_service.CheckConnectorResource()
controller_service.CheckConnector()
// NOTE: we don't check pipeline state for now
// controller_service.CheckPipelineResource()
controller_service.CheckServiceResource()
Expand All @@ -59,9 +59,9 @@ export function teardown(data) {
group("Controller API: Delete all resources created by the test", () => {

check(client.invoke(`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource`, {
resource_permalink: constant.connectorResourcePermalink
resource_permalink: constant.connectorPermalink
}), {
[`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource ${constant.connectorResourcePermalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
[`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource ${constant.connectorPermalink} response StatusOK`]: (r) => r.status === grpc.StatusOK,
});

check(client.invoke(`vdp.controller.v1alpha.ControllerPrivateService/DeleteResource`, {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";

package common.healthcheck.v1alpha;

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

// HealthCheckRequest represents a request to health check a service
message HealthCheckRequest {
// Service name to check for its readiness status
optional string service = 1 [(google.api.field_behavior) = OPTIONAL];
}

// HealthCheckResponse represents a response for a service heath status
message HealthCheckResponse {
// ServingStatus enumerates the status of a queried service
enum ServingStatus {
// Serving status: UNSPECIFIED
SERVING_STATUS_UNSPECIFIED = 0;
// Serving status: SERVING
SERVING_STATUS_SERVING = 1;
// Serving status: NOT SERVING
SERVING_STATUS_NOT_SERVING = 2;
}

// Status is the instance of the enum type ServingStatus
ServingStatus status = 1;
}
144 changes: 0 additions & 144 deletions integration-test/proto/vdp/connector/v1alpha/auth.proto

This file was deleted.

Loading

0 comments on commit 955bdcb

Please sign in to comment.