Skip to content

Commit

Permalink
feat(artifact): add image tag list
Browse files Browse the repository at this point in the history
  • Loading branch information
jvallesm committed Mar 21, 2024
1 parent dbb1a6b commit de10e2e
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
50 changes: 50 additions & 0 deletions artifact/artifact/v1alpha/artifact.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ package artifact.artifact.v1alpha;
import "common/healthcheck/v1beta/healthcheck.proto";
// Google API
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
// OpenAPI definition
import "protoc-gen-openapiv2/options/annotations.proto";
// Protocol Buffers Well-Known Types
import "google/protobuf/timestamp.proto";

// LivenessRequest represents a request to check a service liveness status
message LivenessRequest {
Expand All @@ -29,3 +34,48 @@ message ReadinessResponse {
// HealthCheckResponse message
common.healthcheck.v1beta.HealthCheckResponse health_check_response = 1;
}

// ImageTag contains information about the version of a container image.
message ImageTag {
// The name of the tag, defined by its parent repository and ID.
// - Format: `repositories/{repository.id}/tags/{tag.id}`.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
// The tag identifier.
string id = 2 [(google.api.field_behavior) = IMMUTABLE];
// Unique identifier, computed from the manifest the tag refers to.
string digest = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Tag update time, i.e. timestamp of the last push.
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// ListRepositoryTagsRequest represents a request to list the tags of a
// container image repository.
message ListRepositoryTagsRequest {
// The maximum number of tags to return. The default and cap values are 10
// and 100, respectively.
optional int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
// Page number.
optional int32 page = 2 [(google.api.field_behavior) = OPTIONAL];
// The repository holding the different container image versions.
// - Format: `repositories/{repository.id}`.
// - Example: `repository/flaming-wombat/llava-34b`.
string parent = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {type: "api.instill.tech/Repository"},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
field_configuration: {path_param_name: "repository"}
}
];
}

// ListRepositoryTagsResponse contains a list of container image tags.
message ListRepositoryTagsResponse {
// A list of container image tags.
repeated ImageTag image_tags = 1;
// Total number of tags.
int32 total_size = 2;
// The requested page size.
int32 page_size = 3;
// The requested page offset.
int32 page = 4;
}
23 changes: 23 additions & 0 deletions artifact/artifact/v1alpha/artifact_public_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package artifact.artifact.v1alpha;
import "artifact/artifact/v1alpha/artifact.proto";
// Google API
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/visibility.proto";
// OpenAPI definition
import "protoc-gen-openapiv2/options/annotations.proto";
Expand Down Expand Up @@ -40,4 +41,26 @@ service ArtifactPublicService {
};
option (google.api.method_visibility).restriction = "INTERNAL";
}

// ----------
// Repository
// ----------
//
// The following section documents the public endpoints for content
// distribution (namely, container image) repositories. An image repository
// contains different (tagged) images that represent versions of a, for
// example, model or pipeline.
//
// TODO: this should be better documented in a Repository entity but for the
// current feature specs it is not needed. As this API grows, less or no
// context will be needed in this section.

// List the versions of an image.
//
// Returns a portion of the tags for the specified container image
// repository.
rpc ListRepositoryTags(ListRepositoryTagsRequest) returns (ListRepositoryTagsResponse) {
option (google.api.http) = {get: "/v1beta/{parent=repositories/*}/tags"};
option (google.api.method_signature) = "parent";
}
}

0 comments on commit de10e2e

Please sign in to comment.