diff --git a/.bashrc b/.bashrc new file mode 100644 index 00000000..885c279c --- /dev/null +++ b/.bashrc @@ -0,0 +1 @@ +eval "$(direnv hook bash)" diff --git a/Makefile b/Makefile index 0657aac7..b57c5c36 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ ifeq (, $(shell which direnv)) $(error "No direnv in $(PATH), consider installing. https://direnv.net") endif -ifneq (1, $(AKASH_DIRENV_SET)) +ifneq ("1", "$(AKASH_DIRENV_SET)") $(error "no envrc detected. might need to run \"direnv allow\"") endif diff --git a/proto/provider/akash/inventory/v1/cluster.proto b/proto/provider/akash/inventory/v1/cluster.proto index 6f761d82..8c67be03 100644 --- a/proto/provider/akash/inventory/v1/cluster.proto +++ b/proto/provider/akash/inventory/v1/cluster.proto @@ -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; diff --git a/proto/provider/akash/inventory/v1/cpu.proto b/proto/provider/akash/inventory/v1/cpu.proto index f19f51bf..9d9b44ad 100644 --- a/proto/provider/akash/inventory/v1/cpu.proto +++ b/proto/provider/akash/inventory/v1/cpu.proto @@ -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", diff --git a/proto/provider/akash/inventory/v1/gpu.proto b/proto/provider/akash/inventory/v1/gpu.proto index 4eae9c96..70ae4730 100644 --- a/proto/provider/akash/inventory/v1/gpu.proto +++ b/proto/provider/akash/inventory/v1/gpu.proto @@ -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 { @@ -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\"" + ]; } diff --git a/proto/provider/akash/inventory/v1/node.proto b/proto/provider/akash/inventory/v1/node.proto index 95f81057..7929751c 100644 --- a/proto/provider/akash/inventory/v1/node.proto +++ b/proto/provider/akash/inventory/v1/node.proto @@ -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 [ @@ -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\"" + ]; } diff --git a/proto/provider/akash/inventory/v1/storage.proto b/proto/provider/akash/inventory/v1/storage.proto new file mode 100644 index 00000000..19af668f --- /dev/null +++ b/proto/provider/akash/inventory/v1/storage.proto @@ -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\"" + ]; + } \ No newline at end of file