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 #80

Closed
wants to merge 5 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.
2 changes: 1 addition & 1 deletion go/inventory/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
type GPUs []GPU

type Nodes []Node
type ClusterStorage map[string]ResourcePair
type ClusterStorage []Storage

Check failure on line 11 in go/inventory/v1/types.go

View workflow job for this annotation

GitHub Actions / test

undefined: Storage

Check failure on line 11 in go/inventory/v1/types.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: Storage

Check failure on line 11 in go/inventory/v1/types.go

View workflow job for this annotation

GitHub Actions / test

undefined: Storage

Check failure on line 11 in go/inventory/v1/types.go

View workflow job for this annotation

GitHub Actions / coverage

undefined: Storage

var _ sort.Interface = (*CPUs)(nil)
var _ sort.Interface = (*GPUs)(nil)
Expand Down
11 changes: 11 additions & 0 deletions proto/node/akash/market/v1beta3/bid.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package akash.market.v1beta3;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

import "akash/market/v1beta3/order.proto";
import "akash/base/v1beta3/resources.proto";

Expand Down Expand Up @@ -45,13 +46,23 @@ message MsgCreateBid {
(gogoproto.jsontag) = "deposit",
(gogoproto.moretags) = "yaml:\"deposit\""
];
<<<<<<< Updated upstream
repeated ResourceOffer resources_offer = 5 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "ResourcesOffer",
(gogoproto.customname) = "ResourcesOffer",
(gogoproto.jsontag) = "resources_offer",
(gogoproto.moretags) = "yaml:\"resources_offer\""
];
||||||| Stash base
=======
repeated akash.base.v1beta3.Resources resources = 5 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "resources",
(gogoproto.castrepeated) = "Volumes",
(gogoproto.moretags) = "yaml:\"resources\""
];
>>>>>>> Stashed changes
}

// MsgCreateBidResponse defines the Msg/CreateBid response type.
Expand Down
3 changes: 2 additions & 1 deletion proto/provider/akash/inventory/v1/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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";

Expand All @@ -19,7 +20,7 @@ message Cluster {
(gogoproto.moretags) = "yaml:\"nodes\""
];

map<string, ResourcePair> Storage = 2 [
repeated Storage storage = 2 [
(gogoproto.nullable) = false,
(gogoproto.casttype) = "ClusterStorage",
(gogoproto.customname) = "Storage",
Expand Down
33 changes: 23 additions & 10 deletions proto/provider/akash/inventory/v1/cpu.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,39 @@ import "akash/inventory/v1/resourcepair.proto";

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

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

string id = 2 [
message CPUInfo {
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\""
];
}

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

repeated CPUInfo info = 2 [
(gogoproto.customname) = "Info",
(gogoproto.jsontag) = "info",
(gogoproto.moretags) = "yaml:\"info\""
];
}
46 changes: 32 additions & 14 deletions proto/provider/akash/inventory/v1/gpu.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,43 @@ import "akash/inventory/v1/resourcepair.proto";

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

message GPUInfo {
string vendor = 1 [
(gogoproto.customname) = "Vendor",
(gogoproto.jsontag) = "vendor",
(gogoproto.moretags) = "yaml:\"vendor\""
];
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 {
ResourcePair quantity = 1 [
(gogoproto.customname) = "Quantity",
(gogoproto.jsontag) = "quantity",
(gogoproto.moretags) = "yaml:\"quantity\""
];
string id = 2 [
(gogoproto.customname) = "ID",
(gogoproto.jsontag) = "id",
(gogoproto.moretags) = "yaml:\"id\""
];
string vendor = 3 [
(gogoproto.customname) = "Vendor",
(gogoproto.jsontag) = "vendor",
(gogoproto.moretags) = "yaml:\"vendor\""
];
string model = 4 [
(gogoproto.customname) = "Model",
(gogoproto.jsontag) = "model",
(gogoproto.moretags) = "yaml:\"model\""
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\""
];
}

30 changes: 25 additions & 5 deletions proto/provider/akash/inventory/v1/node.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,42 @@ 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 Node {
repeated CPU cpu = 1 [
CPU cpu = 1 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "CPUs",
(gogoproto.customname) = "CPU",
(gogoproto.jsontag) = "cpu",
(gogoproto.moretags) = "yaml:\"cpu\""
];
repeated GPU gpu = 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\""
];

Storage storage = 4 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "Storage",
(gogoproto.customname) = "Storage",
(gogoproto.jsontag) = "storage",
(gogoproto.moretags) = "yaml:\"storage\""
];
}
3 changes: 2 additions & 1 deletion proto/provider/akash/inventory/v1/resourcepair.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ package akash.inventory.v1;

import "akash/base/v1beta3/attribute.proto";
import "gogoproto/gogo.proto";
import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
import "github.com/kubernetes/apimachinery/blob/master/pkg/api/resource/generated.proto";


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

Expand Down
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