Skip to content

Commit

Permalink
chore(integration): read namespace ID from creation / update request,…
Browse files Browse the repository at this point in the history
… not object
  • Loading branch information
jvallesm committed Oct 28, 2024
1 parent 9bc6998 commit 7ff7ac4
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 529 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
github.com/iFaceless/godub v0.0.0-20200728093528-a30bb4d1a0f1
github.com/iancoleman/strcase v0.3.0
github.com/influxdata/influxdb-client-go/v2 v2.12.3
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241022025309-9afd9231a821
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241028124910-57116e86f1d5
github.com/instill-ai/usage-client v0.2.4-alpha.0.20240123081026-6c78d9a5197a
github.com/instill-ai/x v0.5.0-alpha
github.com/itchyny/gojq v0.12.14
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.12.3 h1:28nRlNMRIV4QbtIUvxhWqaxn0
github.com/influxdata/influxdb-client-go/v2 v2.12.3/go.mod h1:IrrLUbCjjfkmRuaCiGQg4m2GbkaeJDcuWoxiWdQEbA0=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241022025309-9afd9231a821 h1:yDtTSAjeM7gkiHkL2XX4yil+VHOIm2kbyk0ZlHskRW8=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241022025309-9afd9231a821/go.mod h1:rf0UY7VpEgpaLudYEcjx5rnbuwlBaaLyD4FQmWLtgAY=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241028124910-57116e86f1d5 h1:LLcuLUda/hpybBTfceMwFGidhYzk/ROiZ9JTYZad2QU=
github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241028124910-57116e86f1d5/go.mod h1:rf0UY7VpEgpaLudYEcjx5rnbuwlBaaLyD4FQmWLtgAY=
github.com/instill-ai/usage-client v0.2.4-alpha.0.20240123081026-6c78d9a5197a h1:gmy8BcCFDZQan40c/D3f62DwTYtlCwi0VrSax+pKffw=
github.com/instill-ai/usage-client v0.2.4-alpha.0.20240123081026-6c78d9a5197a/go.mod h1:EpX3Yr661uWULtZf5UnJHfr5rw2PDyX8ku4Kx0UtYFw=
github.com/instill-ai/x v0.5.0-alpha h1:xIeIvrLzwJYOBmZwOePVFVkKGEcMDqtHmn1cfVVNlIE=
Expand Down
9 changes: 5 additions & 4 deletions integration-test/proto/vdp/pipeline/v1beta/integration.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ message Connection {
// ID.
string id = 2 [(google.api.field_behavior) = REQUIRED];
// ID of the namespace owning the connection.
string namespace_id = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
string namespace_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Integration ID. It determines for which type of components can reference
// this connection.
string integration_id = 4 [
Expand Down Expand Up @@ -125,6 +122,8 @@ message GetNamespaceConnectionResponse {
// CreateNamespaceConnectionRequest represents a request to create a
// connection.
message CreateNamespaceConnectionRequest {
// ID of the namespace that owns the connection.
string namespace_id = 2 [(google.api.field_behavior) = REQUIRED];
// Properties of the connection to be created.
Connection connection = 1 [(google.api.field_behavior) = REQUIRED];
}
Expand All @@ -140,6 +139,8 @@ message CreateNamespaceConnectionResponse {
message UpdateNamespaceConnectionRequest {
// ID of the connection to be updated, as present in the database.
string connection_id = 1 [(google.api.field_behavior) = REQUIRED];
// ID of the namespace that owns the connection.
string namespace_id = 4 [(google.api.field_behavior) = REQUIRED];
// Connection object with the new properties to be updated. Immutable and
// output-only fields will be ignored. The Setup property must be updated
// in block (no partial update is supported).
Expand Down
225 changes: 98 additions & 127 deletions integration-test/proto/vdp/pipeline/v1beta/pipeline.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ enum State {
STATE_ERROR = 3;
}

// Endpoints describe the endpoints of a pipeline.
message Endpoints {
// WebhookEndpoint describe a webhook endpoint.
message WebhookEndpoint {
// Webhook URL.
string url = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Description.
string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Webhook endpoints.
map<string, WebhookEndpoint> webhooks = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// A Pipeline is an end-to-end workflow that automates a sequence of components
// to process data.
//
Expand Down Expand Up @@ -152,6 +166,8 @@ message Pipeline {
optional string license = 30 [(google.api.field_behavior) = OPTIONAL];
// Pipeline profile image in base64 format.
optional string profile_image = 31 [(google.api.field_behavior) = OPTIONAL];
// Pipeline endpoints.
Endpoints endpoints = 32 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// TriggerMetadata contains the traces of the pipeline inference.
Expand Down Expand Up @@ -232,6 +248,8 @@ message PipelineRelease {
// Recipe in YAML format describes the components of a pipeline and how they
// are connected.
string raw_recipe = 15 [(google.api.field_behavior) = OPTIONAL];
// Pipeline endpoints.
Endpoints endpoints = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// ListPipelinesRequest represents a request to list pipelines.
Expand Down Expand Up @@ -432,18 +450,20 @@ message RenameNamespacePipelineResponse {
message CloneNamespacePipelineRequest {
// Namespace ID
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED];

// Pipeline ID
string pipeline_id = 2 [(google.api.field_behavior) = REQUIRED];
// The target pipeline. It can be under a user or an organization
// namespace, so the following formats are accepted:
// - `{user.id}/{pipeline.id}`
// - `{organization.id}/{pipeline.id}`
string target = 3 [(google.api.field_behavior) = REQUIRED];

// Deprecated `target` field
reserved 3;

// Pipeline description.
string description = 4 [(google.api.field_behavior) = OPTIONAL];
// Pipeline sharing information.
Sharing sharing = 5 [(google.api.field_behavior) = OPTIONAL];
// Target Namespace ID.
string target_namespace_id = 6 [(google.api.field_behavior) = REQUIRED];
// Target Pipeline ID.
string target_pipeline_id = 7 [(google.api.field_behavior) = REQUIRED];
}

// CloneNamespacePipelineResponse contains a cloned pipeline.
Expand All @@ -454,22 +474,22 @@ message CloneNamespacePipelineResponse {}
message CloneNamespacePipelineReleaseRequest {
// Namespace ID
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED];

// Pipeline ID
string pipeline_id = 2 [(google.api.field_behavior) = REQUIRED];

// Release ID
string release_id = 3 [(google.api.field_behavior) = REQUIRED];

// The target pipeline. It can be under a user or an organization
// namespace, so the following formats are accepted:
// - `{user.id}/{pipeline.id}`
// - `{organization.id}/{pipeline.id}`
string target = 4 [(google.api.field_behavior) = REQUIRED];
// Deprecated `target` field
reserved 4;

// Pipeline description.
string description = 5 [(google.api.field_behavior) = OPTIONAL];
// Pipeline sharing information.
Sharing sharing = 6 [(google.api.field_behavior) = OPTIONAL];
// Target Namespace ID.
string target_namespace_id = 7 [(google.api.field_behavior) = REQUIRED];
// Target Pipeline ID.
string target_pipeline_id = 8 [(google.api.field_behavior) = REQUIRED];
}

// CloneNamespacePipelineReleaseResponse contains a cloned pipeline.
Expand Down Expand Up @@ -939,59 +959,6 @@ message RenameUserPipelineResponse {
Pipeline pipeline = 1;
}

// CloneUserPipelineRequest represents a request to clone a pipeline owned by a
// user.
message CloneUserPipelineRequest {
// The resource name of the pipeline, which allows its access by parent user
// and ID.
// - Format: `users/{user.id}/pipelines/{pipeline.id}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.instill.tech/Pipeline"},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
field_configuration: {path_param_name: "user_pipeline_name"}
}
];
// The target pipeline. It can be under a user or an organization
// namespace, so the following formats are accepted:
// - `{user.id}/{pipeline.id}`
// - `{organization.id}/{pipeline.id}`
string target = 2 [(google.api.field_behavior) = REQUIRED];
// Pipeline description.
string description = 3 [(google.api.field_behavior) = OPTIONAL];
// Pipeline sharing information.
Sharing sharing = 4 [(google.api.field_behavior) = OPTIONAL];
}

// CloneUserPipelineResponse contains a cloned pipeline.
message CloneUserPipelineResponse {}

// CloneUserPipelineReleaseRequest represents a request to clone a pipeline
// release owned by a user.
message CloneUserPipelineReleaseRequest {
// The resource name of the pipeline release.
// - Format: `users/{user.id}/pipelines/{pipeline.id}/releases/{version}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.instill.tech/Pipeline"},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
field_configuration: {path_param_name: "user_pipeline_release_name"}
}
];
// The target pipeline. It can be under a user or an organization
// namespace, so the following formats are accepted:
// - `{user.id}/{pipeline.id}`
// - `{organization.id}/{pipeline.id}`
string target = 2 [(google.api.field_behavior) = REQUIRED];
// Pipeline description.
string description = 3 [(google.api.field_behavior) = OPTIONAL];
// Pipeline sharing information.
Sharing sharing = 4 [(google.api.field_behavior) = OPTIONAL];
}

// CloneUserPipelineReleaseResponse contains a cloned pipeline.
message CloneUserPipelineReleaseResponse {}

// TriggerUserPipelineRequest represents a request to trigger a user-owned
// pipeline synchronously.
message TriggerUserPipelineRequest {
Expand Down Expand Up @@ -1476,59 +1443,6 @@ message RenameOrganizationPipelineResponse {
Pipeline pipeline = 1;
}

// CloneOrganizationPipelineRequest represents a request to clone a pipeline
// owned by an organization.
message CloneOrganizationPipelineRequest {
// The resource name of the pipeline, which allows its access by parent
// organization and ID.
// - Format: `organizations/{organization.id}/pipelines/{pipeline.id}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.instill.tech/Pipeline"},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
field_configuration: {path_param_name: "org_pipeline_name"}
}
];
// The target pipeline. It can be under a user or an organization
// namespace, so the following formats are accepted:
// - `{user.id}/{pipeline.id}`
// - `{organization.id}/{pipeline.id}`
string target = 2 [(google.api.field_behavior) = REQUIRED];
// Pipeline description.
string description = 3 [(google.api.field_behavior) = OPTIONAL];
// Pipeline sharing information.
Sharing sharing = 4 [(google.api.field_behavior) = OPTIONAL];
}

// CloneOrganizationPipelineResponse contains a cloned pipeline.
message CloneOrganizationPipelineResponse {}

// CloneOrganizationPipelineReleaseRequest represents a request to clone a pipeline
// release owned by an organization.
message CloneOrganizationPipelineReleaseRequest {
// The resource name of the pipeline release
// - Format: `organizations/{org.id}/pipelines/{pipeline.id}/releases/{version}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.instill.tech/Pipeline"},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
field_configuration: {path_param_name: "org_pipeline_release_name"}
}
];
// The target pipeline. It can be under a user or an organization
// namespace, so the following formats are accepted:
// - `{user.id}/{pipeline.id}`
// - `{organization.id}/{pipeline.id}`
string target = 2 [(google.api.field_behavior) = REQUIRED];
// Pipeline description.
string description = 3 [(google.api.field_behavior) = OPTIONAL];
// Pipeline sharing information.
Sharing sharing = 4 [(google.api.field_behavior) = OPTIONAL];
}

// CloneOrganizationPipelineReleaseResponse contains a cloned pipeline.
message CloneOrganizationPipelineReleaseResponse {}

// TriggerOrganizationPipelineRequest represents a request to trigger an
// organization-owned pipeline synchronously.
message TriggerOrganizationPipelineRequest {
Expand Down Expand Up @@ -1954,9 +1868,9 @@ message ListPipelineRunsRequest {
// are 10 and 100, respectively.
int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];

// View allows clients to specify the desired run view in the response.
// Deprecated: View allows clients to specify the desired run view in the response.
// The basic view excludes input / output data.
optional Pipeline.View view = 5 [(google.api.field_behavior) = OPTIONAL];
reserved 5;
// Filter can hold an [AIP-160](https://google.aip.dev/160)-compliant filter
// expression.
// - Example: `create_time>timestamp("2000-06-19T23:31:08.657Z")`.
Expand All @@ -1966,13 +1880,58 @@ message ListPipelineRunsRequest {
optional string order_by = 7 [(google.api.field_behavior) = OPTIONAL];
}

// ListPipelineRunsByRequesterRequest is the request message for ListPipelineRunsByRequester.
message ListPipelineRunsByRequesterRequest {
// The page number to retrieve.
int32 page = 1 [(google.api.field_behavior) = OPTIONAL];

// The maximum number of items per page to return. The default and cap values
// are 10 and 100, respectively.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

// Filter can hold an [AIP-160](https://google.aip.dev/160)-compliant filter
// expression.
// The following filters are supported:
// - `status`
// - `source`
//
// **Example**: `status="RUN_STATUS_COMPLETED"`.
optional string filter = 3 [(google.api.field_behavior) = OPTIONAL];
// Order by field, with options for ordering by `id`, `create_time` or `update_time`.
// Format: `order_by=id` or `order_by=create_time desc`, default is `asc`.
optional string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
// Beginning of the time range from which the records will be fetched.
// The default value is the beginning of the current day, in UTC.
optional google.protobuf.Timestamp start = 5;
// End of the time range from which the records will be fetched.
// The default value is the current timestamp.
optional google.protobuf.Timestamp stop = 6;
// Requester ID.
string requester_id = 7 [(google.api.field_behavior) = REQUIRED];
}

// ListPipelineRunsResponse is the response message for ListPipelineRuns.
message ListPipelineRunsResponse {
// The list of pipeline runs.
repeated PipelineRun pipeline_runs = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// The total number of pipeline runs matching the request.
int64 total_size = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
int32 total_size = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The current page number.
int32 page = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// The number of items per page.
int32 page_size = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// ListPipelineRunsByRequesterResponse is the response message for ListPipelineRunsByRequester.
message ListPipelineRunsByRequesterResponse {
// The list of pipeline runs.
repeated PipelineRun pipeline_runs = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// The total number of pipeline runs matching the request.
int32 total_size = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The current page number.
int32 page = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand Down Expand Up @@ -2011,7 +1970,7 @@ message ListComponentRunsResponse {
repeated ComponentRun component_runs = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// The total number of component runs matching the request.
int64 total_size = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
int32 total_size = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The current page number.
int32 page = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand Down Expand Up @@ -2064,16 +2023,18 @@ message PipelineRun {
(google.api.field_behavior) = OPTIONAL
];

// Input files for the run.
repeated FileReference inputs_reference = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
// Reversed for `inputs_reference`
reserved 9;

// Pipeline input parameters.
repeated google.protobuf.Struct inputs = 10 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.field_behavior) = OPTIONAL
];

// Output files from the run.
repeated FileReference outputs_reference = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// Reversed for `outputs_reference`
reserved 11;

// Pipeline inference outputs.
repeated google.protobuf.Struct outputs = 12 [
(google.api.field_behavior) = OUTPUT_ONLY,
Expand Down Expand Up @@ -2104,6 +2065,16 @@ message PipelineRun {
];
// Data specifications.
DataSpecification data_specification = 18 [(google.api.field_behavior) = OUTPUT_ONLY];

// The ID of the pipeline
optional string pipeline_id = 19 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.field_behavior) = OPTIONAL
];

// Requester ID. This field might be empty if the pipeline run belongs to a
// deleted namespace.
string requester_id = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// ComponentRun represents the execution details of a single component within a pipeline run.
Expand Down
Loading

0 comments on commit 7ff7ac4

Please sign in to comment.