Skip to content

Commit

Permalink
GRPC clients version 10.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
clarifai-prod committed May 30, 2024
1 parent 3d32e42 commit 2620263
Show file tree
Hide file tree
Showing 18 changed files with 6,787 additions and 573 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.3.3
10.4.0
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.3.3",
"version": "10.4.0",
"description": "The official Clarifai Node.js gRPC client",
"main": "src/index.js",
"repository": "https://github.com/Clarifai/clarifai-javascript-grpc",
Expand Down
197 changes: 117 additions & 80 deletions proto/clarifai/api/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,27 @@ message ConceptQuery {
string name = 1;
// The language of the concept name in a search. Defaults to English.
string language = 2;
// The id of workflow. If no id is provided, then application base workflow is used.
string workflow_id = 3;
// The concepts must belong to workflow models with specified use cases.

// Deprecated: Use workflow.id instead.
string workflow_id = 3 [deprecated = true];

// The concepts must belong to models with specified use cases.
// Multiple values are joined using an OR condition.
repeated WorkflowModelUseCase use_cases = 4;

// By default, we return app concepts combined with concepts from this source.
// If source is not set, then application default workflow is used as source.
// ########## Supported fields ##########
// - model.id - fetch concepts from this model
// - model.model_version.id - if set, then use the specified model version. if not set, use latest model version
//
// - workflow.id - fetch concepts from this workflow
// - workflow.version.id - if set, then use the specified workflow version. if not set, use latest workflow version
// ######################################
oneof source {
Model model = 5;
Workflow workflow = 6;
}
}
enum WorkflowModelUseCase {
WORKFLOW_MODEL_USE_CASE_NOT_SET = 0;
Expand Down Expand Up @@ -2571,6 +2587,8 @@ message User {
string job_role = 20;
// This specifies user intent when registering on clarifai
string intention = 24;
// This specifies how one got to know about clarifai
string referral_source = 25;
string bill_type = 7 [deprecated = true];

// When the user was created. We follow the XXXX timestamp
Expand Down Expand Up @@ -3359,6 +3377,7 @@ message TaskMetrics {
reserved 1;

TaskWorkMetrics work = 2;
TaskReviewMetrics review = 3;
}

message TaskWorkMetrics {
Expand All @@ -3369,6 +3388,14 @@ message TaskWorkMetrics {
uint32 inputs_percent_estimated = 2;
}

message TaskReviewMetrics {
// Estimated number of reviewed inputs.
uint64 inputs_count_estimated = 1;
// Estimated percent of inputs that were reviewed. Calculated as count of reviewed inputs / total task inputs
// This is a value between 0 and 100, where 0 = 0% and 100 = 100%.
uint32 inputs_percent_estimated = 2;
}

enum RoleType {
TEAM = 0;
ORG = 1;
Expand Down Expand Up @@ -3583,14 +3610,6 @@ enum StatTimeAggType {











// PCAProjectionComparator
message PCAProjectionComparator {
// Within what distance do we consider two annotations duplicates
Expand Down Expand Up @@ -4258,14 +4277,14 @@ message BookmarkOrigin {
// A worker for compute within a nodepool of instances.
// This asks the API for work
message Runner {
// A unique ID for this app module.
// A unique ID for this runner.
// This is a UUID since runners can be automatically orchestrated.
string id = 1;
// A short description for this app module to be used in grids of modules.
// short description about the runner.
string description = 2;
// When the app module was created.
// When the runner was created.
google.protobuf.Timestamp created_at = 3;
// When the app module was last modified.
// When the runner was last modified.
google.protobuf.Timestamp modified_at = 4;

// To handle arbitrary json metadata you can use a struct field:
Expand All @@ -4279,24 +4298,15 @@ message Runner {
// Labels to match in order to find work.
repeated string labels = 7 [deprecated = true];

// RunnerObject
// Instead of just matching on labels we might want to have more explicit matching of what
// work this runner is looking for.
// The thing that the autoscaling cnfig applies to for this nodepool.
oneof object {
// Model: match work to only a specific model.
Model model = 9;
// Workflow: match work to only a specific workflow.
Workflow workflow = 10;
// We could also support matching by labels here for future "job" like functionality where
// the item itself fully defines the work that needs to be done.
// RunnerLabels runner_labels = 11; // FUTURE
}
// The thing that the autoscaling config applies to for this nodepool.
Worker worker = 8;

// Runners are defined within nodepools so this field needs the id and user_id of the nodepool
// to be provided when creating a Runner.
// This nodepool must be accessible to you or an org you are part of.
Nodepool nodepool = 12;
Nodepool nodepool = 9;

////////////////////////////
// Need resources on the runner so we can schedule this Runner into the Nodepool.
Expand All @@ -4306,7 +4316,7 @@ message Runner {
// Having this on the underlying object like Model and Workflow allows us to represent the minimum
// requirements on those object, which may be less than what the Runner allocates (as a safety
// margin for the runner to for sure run the resource).
ComputeInfo compute_info = 13;
ComputeInfo compute_info = 10;
}


Expand All @@ -4319,102 +4329,120 @@ message Runner {
message Nodepool {
// The user defined ID of the nodepool.
string id = 1;
// Short description about the nodepool.
string description = 2;
// When the nodepool was created.
google.protobuf.Timestamp created_at = 3;
// When the nodepool was last modified.
google.protobuf.Timestamp modified_at = 4;

// The user/org that this nodepool belongs to.
string user_id = 2;

// Which cloud region this nodepool is within.
CloudRegion cloud_region = 3;
string user_id = 5;

// Type of nodes that are ok for instances in this pool.
// If both spot and on-demand are provided then the runner will be able to run on either
// with a preference for spot until they are not available.
enum CapacityType {
UKNOWN_CAPACITY_TYPE = 0;
ONDEMAND_TYPE = 1;
SPOT_TYPE = 2;
}
repeated CapacityType capacity_types = 4;
// Which cluster this nodepool is within.
ComputeCluster compute_cluster = 6;

//////////////////////////////////////
// The instance types that will be available in this pool of nodes.
// Clarifai offers multiple different choices that combine cpu cores, memory and accelerator.
repeated string instance_types = 8;
//////////////////////////////////////
NodeCapacityType node_capacity_type = 7;

repeated InstanceType instance_types = 8;

// Minimum number of instances in this nodepool. This allows the nodeool to scale down to this
// Minimum number of instances in this nodepool. This allows the nodepool to scale down to this
// amount. A nodepool needs a minimum of 1 instance.
uint32 min_instances = 9;

// An upper limit on the number of instances in this nodepool. This allows the nodepool to scale
// up to this amount.
uint32 max_instances = 10;

// The visibility field represents whether this message is privately/publicly visible.
// To be visible to the public the App that contains it AND the User that contains the App must
// also be publicly visible.
Visibility visibility = 11;

// To handle arbitrary json metadata:
// https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto
google.protobuf.Struct metadata = 12;

// Other future configuration we can add:
// - disk information
// - architecture type (ARM/x86)
// - base OS
// - repeated availability zones.
}

// Type of nodes that are ok for instances in this pool.
// If both spot and on-demand are provided then the runner will be able to run on either
// with a preference for spot until they are not available.
message NodeCapacityType {
enum CapacityType {
UKNOWN_CAPACITY_TYPE = 0;
ON_DEMAND_TYPE = 1;
SPOT_TYPE = 2;
}
repeated CapacityType capacity_types = 1;
}

// The instance types that will be available in this pool of nodes.
// Clarifai offers multiple different choices that combine cpu cores, memory and accelerator.
message InstanceType {
string id = 1;
// Short description of instance type.
string description = 2;
ComputeInfo compute_info = 3;
}

// CloudProvider represents the entity that provides the infrastructure where the Nodepools are deployed.
// This could be a public cloud provider like AWS, GCP, Azure, etc., or a self-hosted infrastructure.
message CloudProvider {
// Unique identifier of the cloud provider.
string id = 1;
// Name of the cloud provider.
string name = 2;
}

// We define a cloud region here to be used in Nodepools and by the cloud agent.
// There will be one cloud agent per CloudRegion.
// This allows us to define CloudRegions that are VPCs within one physical cloud and have that
// managed by one cloud agent which can list all nodepools for that VPC to deploy them and
// We define a cluster here to be used in Nodepools and by the cloud provider.
// There will be one cloud provider per Cluster.
// This allows us to define Clusters that are VPCs within one physical cloud and have that
// managed by one cloud provider which can list all nodepools for that VPC to deploy them and
// orchestrate work within them.
message CloudRegion {
message ComputeCluster {
string id = 1;
// Short description of cluster region.
string description = 2;

enum Cloud {
UNKOWN_CLOUD = 0;
// Run on a user's own infrastructure. This has restrictions on who can access resources
// that are being run by SELF_HOSTED runners. Only those who are part of the user/org where they
// exist can leverage them.
SELF_HOSTED = 1;
AWS = 2;
GCP = 3;
AZURE = 4;
LAMBDA = 5;
}
Cloud cloud = 3;
CloudProvider cloud_provider = 3;

// The region. The naming here depends on the cloud choice above and will be validated
// against which clouds+regions that Clarifai currently supports.
// The region. The naming here depends on the cluster choice above and will be validated
// against which clusters+regions that Clarifai currently supports.
string region = 4;

// The user/org that this compute cluster belongs to.
string user_id = 5;
// When the compute cluster was created.
google.protobuf.Timestamp created_at = 6;
// When the compute cluster was last modified.
google.protobuf.Timestamp modified_at = 7;

// For future support of different VPC.
// To support splitting a region into multiple VPCs.
// string vpc_id = 5; // FUTURE
// string vpc_id = 8; // FUTURE
// The user/org that this VPC belongs to.
// string vpc_user_id = 6; // FUTURE
// string vpc_user_id = 9; // 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 = 7; // FUTURE
// string base_api_url = 10; // FUTURE

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













// These are the resource needs of a given API object such as a model.
// This is what they require as a minimum to run and will be used upon scheduling
// as the request and limit for the k8s pod. If we want to separate limits and requests in the
Expand Down Expand Up @@ -4536,6 +4564,15 @@ message Deployment {
PREFER_ONDEMAND = 8; // choose on-demand instances over spot.
}
SchedulingChoice scheduling_choice = 7;

// The visibility field represents whether this message is privately/publicly visible.
// To be visible to the public the App that contains it AND the User that contains the App must
// also be publicly visible.
Visibility visibility = 8;

// To handle arbitrary json metadata:
// https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto
google.protobuf.Struct metadata = 9;
}


Expand Down
Loading

0 comments on commit 2620263

Please sign in to comment.