Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inventory api updates #78

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added direnv.linux-amd64
Binary file not shown.
6 changes: 1 addition & 5 deletions proto/provider/akash/inventory/v1/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ package akash.inventory.v1;
import "gogoproto/gogo.proto";
import "akash/inventory/v1/node.proto";
import "akash/inventory/v1/resourcepair.proto";
import "akash/inventory/v1/storage.proto";

option go_package = "github.com/akash-network/akash-api/go/inventory/v1";

message Storage {
string class = 1;
ResourcePair quantity = 2;
}

message Cluster {
option (gogoproto.equal) = false;

Expand Down
17 changes: 8 additions & 9 deletions proto/provider/akash/inventory/v1/cpu.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@ import "akash/inventory/v1/resourcepair.proto";
option go_package = "github.com/akash-network/akash-api/go/inventory/v1";

message CPUInfo {
string id = 2 [
string id = 1 [
(gogoproto.customname) = "ID",
(gogoproto.jsontag) = "id",
(gogoproto.moretags) = "yaml:\"id\""
];
string vendor = 3 [
string vendor = 2 [
(gogoproto.customname) = "Vendor",
(gogoproto.jsontag) = "vendor",
(gogoproto.moretags) = "yaml:\"vendor\""
];
string model = 4 [
string model = 3 [
(gogoproto.customname) = "Model",
(gogoproto.jsontag) = "model",
(gogoproto.moretags) = "yaml:\"model\""
];
uint32 vcores = 4 [
(gogoproto.customname) = "Vcores",
(gogoproto.jsontag) = "vcores",
(gogoproto.moretags) = "yaml:\"vcores\""
];
}

// cpu 1 / 10vcores
// cpu 2 / 10vcores
// --> k8s->CoreV1->Node() -> 20 vcores
// 12 allocated


message CPU {
ResourcePair quantity = 1 [
(gogoproto.customname) = "Quantity",
Expand Down
39 changes: 25 additions & 14 deletions proto/provider/akash/inventory/v1/gpu.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,31 @@ import "akash/inventory/v1/resourcepair.proto";
option go_package = "github.com/akash-network/akash-api/go/inventory/v1";

message GPUInfo {
string id = 2 [
(gogoproto.customname) = "ID",
(gogoproto.jsontag) = "id",
(gogoproto.moretags) = "yaml:\"id\""
];
string vendor = 3 [
string vendor = 1 [
(gogoproto.customname) = "Vendor",
(gogoproto.jsontag) = "vendor",
(gogoproto.moretags) = "yaml:\"vendor\""
];
string model = 4 [
(gogoproto.customname) = "Model",
(gogoproto.jsontag) = "model",
(gogoproto.moretags) = "yaml:\"model\""
string name = 2 [
(gogoproto.customname) = "Name",
(gogoproto.jsontag) = "name",
(gogoproto.moretags) = "yaml:\"name\""
];
string modelid = 3 [
(gogoproto.customname) = "ModelID",
(gogoproto.jsontag) = "modelid",
(gogoproto.moretags) = "yaml:\"modelid\""
];
string interface = 4 [
(gogoproto.customname) = "Interface",
(gogoproto.jsontag) = "interface",
(gogoproto.moretags) = "yaml:\"interface\""
];
string memory = 5 [
(gogoproto.customname) = "Memory",
(gogoproto.jsontag) = "memory",
(gogoproto.moretags) = "yaml:\"memory\""
];


}

message GPU {
Expand All @@ -34,6 +42,9 @@ message GPU {
(gogoproto.jsontag) = "quantity",
(gogoproto.moretags) = "yaml:\"quantity\""
];

repeated GPUInfo info = 2;
repeated GPUInfo info = 2 [
(gogoproto.customname) = "Info",
(gogoproto.jsontag) = "info",
(gogoproto.moretags) = "yaml:\"info\""
];
}
47 changes: 47 additions & 0 deletions proto/provider/akash/inventory/v1/memory.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
syntax = "proto3";

package akash.inventory.v1;

import "gogoproto/gogo.proto";

import "akash/inventory/v1/resourcepair.proto";

option go_package = "github.com/akash-network/akash-api/go/inventory/v1";

message MemoryInfo {
string vendor = 1 [
(gogoproto.customname) = "Vendor",
(gogoproto.jsontag) = "vendor",
(gogoproto.moretags) = "yaml:\"vendor\""
];
string type = 2 [
(gogoproto.customname) = "Type",
(gogoproto.jsontag) = "type",
(gogoproto.moretags) = "yaml:\"type\""
];
string size = 3 [
(gogoproto.customname) = "Size",
(gogoproto.jsontag) = "size",
(gogoproto.moretags) = "yaml:\"size\""
];
string speed = 4 [
(gogoproto.customname) = "Speed",
(gogoproto.jsontag) = "speed",
(gogoproto.moretags) = "yaml:\"speed\""
];
}

message Memory {
ResourcePair quantity = 1 [
(gogoproto.customname) = "Quantity",
(gogoproto.jsontag) = "quantity",
(gogoproto.moretags) = "yaml:\"quantity\""
];

repeated MemoryInfo info = 2 [
(gogoproto.customname) = "Info",
(gogoproto.jsontag) = "info",
(gogoproto.moretags) = "yaml:\"info\""
];
}

41 changes: 21 additions & 20 deletions proto/provider/akash/inventory/v1/node.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,11 @@ package akash.inventory.v1;
import "gogoproto/gogo.proto";
import "akash/inventory/v1/cpu.proto";
import "akash/inventory/v1/gpu.proto";
import "akash/inventory/v1/storage.proto";
import "akash/inventory/v1/memory.proto";

option go_package = "github.com/akash-network/akash-api/go/inventory/v1";

message MemoryInfo {

}
message Memory {
ResourcePair quantity = 1 [
(gogoproto.customname) = "Quantity",
(gogoproto.jsontag) = "quantity",
(gogoproto.moretags) = "yaml:\"quantity\""
];

repeated MemoryInfo info = 2 [

]
}
option go_package = "github.com/akash-network/akash-api/go/inventory/v1";

message Node {
CPU cpu = 1 [
Expand All @@ -31,14 +19,27 @@ message Node {
(gogoproto.moretags) = "yaml:\"cpu\""
];

Memory memory = 2;
Memory memory = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "Memory",
(gogoproto.customname) = "Memory",
(gogoproto.jsontag) = "memory",
(gogoproto.moretags) = "yaml:\"memory\""
];

GPU gpu = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "GPUs",
(gogoproto.customname) = "GPU",
(gogoproto.jsontag) = "gpu",
(gogoproto.moretags) = "yaml:\"gpu\""
(gogoproto.customname) = "Gpus",
(gogoproto.jsontag) = "gpus",
(gogoproto.moretags) = "yaml:\"gpus\""
];

EphemeralStorage;
Storage storage = 4 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "Storage",
(gogoproto.customname) = "Storage",
(gogoproto.jsontag) = "storage",
(gogoproto.moretags) = "yaml:\"storage\""
];
}
45 changes: 45 additions & 0 deletions proto/provider/akash/inventory/v1/storage.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
syntax = "proto3";

package akash.inventory.v1;

import "gogoproto/gogo.proto";

import "akash/inventory/v1/resourcepair.proto";

option go_package = "github.com/akash-network/akash-api/go/inventory/v1";

message StorageInfo {
string vendor = 1 [
(gogoproto.customname) = "Vendor",
(gogoproto.jsontag) = "vendor",
(gogoproto.moretags) = "yaml:\"vendor\""
];
string class = 2 [
(gogoproto.customname) = "Class",
(gogoproto.jsontag) = "class",
(gogoproto.moretags) = "yaml:\"class\""
];
string capacity = 3 [
(gogoproto.customname) = "Capacity",
(gogoproto.jsontag) = "capacity",
(gogoproto.moretags) = "yaml:\"capacity\""
];
string IO = 4 [
(gogoproto.customname) = "IO",
(gogoproto.jsontag) = "io",
(gogoproto.moretags) = "yaml:\"io\""
];
}

message Storage {
ResourcePair quantity = 1 [
(gogoproto.customname) = "Quantity",
(gogoproto.jsontag) = "quantity",
(gogoproto.moretags) = "yaml:\"quantity\""
];
StorageInfo info = 2 [
(gogoproto.customname) = "Info",
(gogoproto.jsontag) = "info",
(gogoproto.moretags) = "yaml:\"info\""
];
}
Loading