Skip to content

Commit

Permalink
GRPC clients version 10.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
clarifai-prod committed Jul 11, 2024
1 parent 0650e5f commit f5a1d1a
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 66 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.6.0
10.6.1
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clarifai-nodejs-grpc",
"version": "10.6.0",
"version": "10.6.1",
"description": "The official Clarifai Node.js gRPC client",
"main": "src/index.js",
"repository": "https://github.com/Clarifai/clarifai-javascript-grpc",
Expand Down
38 changes: 33 additions & 5 deletions proto/clarifai/api/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4408,6 +4408,8 @@ message ComputeCluster {
// Short description of cluster region.
string description = 2;

// The cloud provider where this cluster is hosted.
// Some example cloud provider IDs may be aws, gcp, azure, local, kubernetes, etc.
CloudProvider cloud_provider = 3;

// The region. The naming here depends on the cluster choice above and will be validated
Expand All @@ -4426,22 +4428,47 @@ message ComputeCluster {
// also be publicly visible.
Visibility visibility = 8;

// We offer different types of compute clusters such as:
// 'serverless' which only Clarifai can create.
// 'dedicated' where you're in control of defining the nodepools within the cluster
// 'local-dev' which means you're responsible for starting runners manually which is great for local
// development but not recommended for production use cases.
string cluster_type = 9;

// Managed by represents who is responsible for the cluster.
// This is currently either "clarifai" where we fully manage the infrastructure.
// Or, "user" where the user is responsible for the underlying infrastructure.
string managed_by = 10;


// Key to use within the compute cluster for all requests to the API.
// You can post with the key.id filled in to set the key for the compute cluster.
// The responses will intentionaly only return the description of the key for security
// purposes since you may have other people through orgs/teams having access to this compute
// cluster who should not view your key.
// This must be a valid key created before creating the ComputeCluster.
// Deleting this key will not be prevented, which means all resources in this ComputeCluster
// will lose connection to the API, so delete keys at your own risk.
// The user_id who owns the key must match the user_id provided in the ComputeCluster.
Key key = 11;


// For future support of different VPC.
// To support splitting a region into multiple VPCs.
// string vpc_id = 9; // FUTURE
// string vpc_id = 12; // FUTURE
// The user/org that this VPC belongs to.
// string vpc_user_id = 10; // FUTURE
// string vpc_user_id = 13; // FUTURE

// this is the base url for the API for all runners in this nodepool to communicate with.
// This is necesary for multi-region / multi-cloud support since runners should only pick up
// work from the region/cloud that they are within. The runners will be orchestrated within the
// nodepool so can have this base_api_url injected as the CLARIFAI_API_BASE env variable.
// We include this in the proto in case a user needs to create a nodepool on their own
// infrastructure that talks with a specific region.
// string base_api_url = 11; // FUTURE
// string base_api_url = 14; // FUTURE

// The available set of instance types in this cluster.
// InstanceType instance_types = 12; // FUTURE
// InstanceType instance_types = 15; // FUTURE
}


Expand Down Expand Up @@ -4617,4 +4644,5 @@ message ProcessingInfo {
// A status of the processing. We use this for signalling end of a request stream, a runner
// item's processing should be cancelled, etc.
clarifai.api.status.Status status = 2;
}
}

12 changes: 12 additions & 0 deletions proto/clarifai/api/resources_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8196,6 +8196,15 @@ export class ComputeCluster extends jspb.Message {
clearVisibility(): void;
getVisibility(): Visibility | undefined;
setVisibility(value?: Visibility): ComputeCluster;
getClusterType(): string;
setClusterType(value: string): ComputeCluster;
getManagedBy(): string;
setManagedBy(value: string): ComputeCluster;

hasKey(): boolean;
clearKey(): void;
getKey(): Key | undefined;
setKey(value?: Key): ComputeCluster;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ComputeCluster.AsObject;
Expand All @@ -8217,6 +8226,9 @@ export namespace ComputeCluster {
createdAt?: google_protobuf_timestamp_pb.Timestamp.AsObject,
modifiedAt?: google_protobuf_timestamp_pb.Timestamp.AsObject,
visibility?: Visibility.AsObject,
clusterType: string,
managedBy: string,
key?: Key.AsObject,
}
}

Expand Down
113 changes: 112 additions & 1 deletion proto/clarifai/api/resources_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -67491,7 +67491,10 @@ proto.clarifai.api.ComputeCluster.toObject = function(includeInstance, msg) {
userId: jspb.Message.getFieldWithDefault(msg, 5, ""),
createdAt: (f = msg.getCreatedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
modifiedAt: (f = msg.getModifiedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
visibility: (f = msg.getVisibility()) && proto.clarifai.api.Visibility.toObject(includeInstance, f)
visibility: (f = msg.getVisibility()) && proto.clarifai.api.Visibility.toObject(includeInstance, f),
clusterType: jspb.Message.getFieldWithDefault(msg, 9, ""),
managedBy: jspb.Message.getFieldWithDefault(msg, 10, ""),
key: (f = msg.getKey()) && proto.clarifai.api.Key.toObject(includeInstance, f)
};

if (includeInstance) {
Expand Down Expand Up @@ -67564,6 +67567,19 @@ proto.clarifai.api.ComputeCluster.deserializeBinaryFromReader = function(msg, re
reader.readMessage(value,proto.clarifai.api.Visibility.deserializeBinaryFromReader);
msg.setVisibility(value);
break;
case 9:
var value = /** @type {string} */ (reader.readString());
msg.setClusterType(value);
break;
case 10:
var value = /** @type {string} */ (reader.readString());
msg.setManagedBy(value);
break;
case 11:
var value = new proto.clarifai.api.Key;
reader.readMessage(value,proto.clarifai.api.Key.deserializeBinaryFromReader);
msg.setKey(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -67653,6 +67669,28 @@ proto.clarifai.api.ComputeCluster.serializeBinaryToWriter = function(message, wr
proto.clarifai.api.Visibility.serializeBinaryToWriter
);
}
f = message.getClusterType();
if (f.length > 0) {
writer.writeString(
9,
f
);
}
f = message.getManagedBy();
if (f.length > 0) {
writer.writeString(
10,
f
);
}
f = message.getKey();
if (f != null) {
writer.writeMessage(
11,
f,
proto.clarifai.api.Key.serializeBinaryToWriter
);
}
};


Expand Down Expand Up @@ -67876,6 +67914,79 @@ proto.clarifai.api.ComputeCluster.prototype.hasVisibility = function() {
};


/**
* optional string cluster_type = 9;
* @return {string}
*/
proto.clarifai.api.ComputeCluster.prototype.getClusterType = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
};


/**
* @param {string} value
* @return {!proto.clarifai.api.ComputeCluster} returns this
*/
proto.clarifai.api.ComputeCluster.prototype.setClusterType = function(value) {
return jspb.Message.setProto3StringField(this, 9, value);
};


/**
* optional string managed_by = 10;
* @return {string}
*/
proto.clarifai.api.ComputeCluster.prototype.getManagedBy = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, ""));
};


/**
* @param {string} value
* @return {!proto.clarifai.api.ComputeCluster} returns this
*/
proto.clarifai.api.ComputeCluster.prototype.setManagedBy = function(value) {
return jspb.Message.setProto3StringField(this, 10, value);
};


/**
* optional Key key = 11;
* @return {?proto.clarifai.api.Key}
*/
proto.clarifai.api.ComputeCluster.prototype.getKey = function() {
return /** @type{?proto.clarifai.api.Key} */ (
jspb.Message.getWrapperField(this, proto.clarifai.api.Key, 11));
};


/**
* @param {?proto.clarifai.api.Key|undefined} value
* @return {!proto.clarifai.api.ComputeCluster} returns this
*/
proto.clarifai.api.ComputeCluster.prototype.setKey = function(value) {
return jspb.Message.setWrapperField(this, 11, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.clarifai.api.ComputeCluster} returns this
*/
proto.clarifai.api.ComputeCluster.prototype.clearKey = function() {
return this.setKey(undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.clarifai.api.ComputeCluster.prototype.hasKey = function() {
return jspb.Message.getField(this, 11) != null;
};



/**
* List of repeated fields within this message type.
Expand Down
28 changes: 8 additions & 20 deletions proto/clarifai/api/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3777,32 +3777,14 @@ service V2 {
}



// TODO(zeiler): i mocked these up bu tleft them commented for now because they will build all the
// handlers and we have to stub those out. Me/Sai will do that in follow up PRs, i just want to
// check in the protos so we can start using them first work through some of the routing stuff.

// // ListCloudAgentInformation with special auth.
// rpc ListCloudAgentInformation (ListCloudAgentInformationRequest) returns (MultiCloudAgentInformationResponse) {
// option (google.api.http) = {
// get: "/v2/cloud_agent_info"
// };
// option (clarifai.auth.util.cl_auth_type) = CloudAgentAuth;
// option (clarifai.auth.util.cl_depending_scopes) = Apps_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Models_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Runners_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Nodepools_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Deployments_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Keys_Get;
// }

// ComputeCluster CRUD
rpc GetComputeCluster (GetComputeClusterRequest) returns (SingleComputeClusterResponse) {
option (google.api.http) = {
get: "/v2/users/{user_app_id.user_id}/compute_clusters/{compute_cluster_id}"
};
option (clarifai.auth.util.cl_auth_type) = PATAuth;
option (clarifai.auth.util.cl_depending_scopes) = ComputeClusters_Get;
option (clarifai.auth.util.cl_depending_scopes) = Keys_Get;
}

rpc ListComputeClusters (ListComputeClustersRequest) returns (MultiComputeClusterResponse) {
Expand All @@ -3811,6 +3793,7 @@ service V2 {
};
option (clarifai.auth.util.cl_auth_type) = PATAuth;
option (clarifai.auth.util.cl_depending_scopes) = ComputeClusters_Get;
option (clarifai.auth.util.cl_depending_scopes) = Keys_Get;
}

rpc PostComputeClusters (PostComputeClustersRequest) returns (MultiComputeClusterResponse) {
Expand All @@ -3821,6 +3804,7 @@ service V2 {
option (clarifai.auth.util.cl_auth_type) = PATAuth;
option (clarifai.auth.util.cl_depending_scopes) = ComputeClusters_Get;
option (clarifai.auth.util.cl_depending_scopes) = ComputeClusters_Add;
option (clarifai.auth.util.cl_depending_scopes) = Keys_Get;
}

// Delete multiple compute_clusters in one request.
Expand All @@ -3836,6 +3820,7 @@ service V2 {
option (clarifai.auth.util.cl_depending_scopes) = Nodepools_Get;
option (clarifai.auth.util.cl_depending_scopes) = Nodepools_Add;
option (clarifai.auth.util.cl_depending_scopes) = Nodepools_Delete;
option (clarifai.auth.util.cl_depending_scopes) = Keys_Get;
}

// Nodepools CRUD
Expand Down Expand Up @@ -7997,4 +7982,7 @@ message SingleDeploymentResponse {
message MultiDeploymentResponse {
clarifai.api.status.Status status = 1;
repeated Deployment deployments = 2 [(clarifai.api.utils.cl_show_if_empty) = true];
}
}



20 changes: 1 addition & 19 deletions proto/clarifai/api/service_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -6569,25 +6569,7 @@ postModelVersionsTrainingTimeEstimate: {
responseSerialize: serialize_clarifai_api_MultiTrainingTimeEstimateResponse,
responseDeserialize: deserialize_clarifai_api_MultiTrainingTimeEstimateResponse,
},
// TODO(zeiler): i mocked these up bu tleft them commented for now because they will build all the
// handlers and we have to stub those out. Me/Sai will do that in follow up PRs, i just want to
// check in the protos so we can start using them first work through some of the routing stuff.
//
// // ListCloudAgentInformation with special auth.
// rpc ListCloudAgentInformation (ListCloudAgentInformationRequest) returns (MultiCloudAgentInformationResponse) {
// option (google.api.http) = {
// get: "/v2/cloud_agent_info"
// };
// option (clarifai.auth.util.cl_auth_type) = CloudAgentAuth;
// option (clarifai.auth.util.cl_depending_scopes) = Apps_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Models_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Runners_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Nodepools_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Deployments_Get;
// option (clarifai.auth.util.cl_depending_scopes) = Keys_Get;
// }
//
// ComputeCluster CRUD
// ComputeCluster CRUD
getComputeCluster: {
path: '/clarifai.api.V2/GetComputeCluster',
requestStream: false,
Expand Down
Loading

0 comments on commit f5a1d1a

Please sign in to comment.