diff --git a/app/deployment/app.go b/app/deployment/app.go index 7fb1fb0593..ccd146e5a8 100644 --- a/app/deployment/app.go +++ b/app/deployment/app.go @@ -11,6 +11,7 @@ import ( appstate "github.com/ovrclk/akash/state" "github.com/ovrclk/akash/types" "github.com/ovrclk/akash/types/code" + "github.com/ovrclk/akash/validation" tmtypes "github.com/tendermint/abci/types" "github.com/tendermint/tmlibs/log" ) @@ -245,10 +246,10 @@ func (a *app) doCheckCreateTx(state appstate.State, ctx apptypes.Context, tx *ty } } - if len(tx.Groups) == 0 { + if err := validation.ValidateGroupSpecs(tx.Groups); err != nil { return tmtypes.ResponseCheckTx{ Code: code.INVALID_TRANSACTION, - Log: "No groups in deployment", + Log: err.Error(), } } diff --git a/cmd/akash/deployment.go b/cmd/akash/deployment.go index 7834331339..502ebbd044 100644 --- a/cmd/akash/deployment.go +++ b/cmd/akash/deployment.go @@ -16,6 +16,7 @@ import ( "github.com/ovrclk/akash/txutil" "github.com/ovrclk/akash/types" . "github.com/ovrclk/akash/util" + "github.com/ovrclk/akash/validation" "github.com/spf13/cobra" ) @@ -375,7 +376,7 @@ func manifestValidateResources(session session.Session, mani *types.Manifest, da if err != nil { return err } - return manifest.ValidateWithDeployment(mani, dgroups.Items) + return validation.ValidateManifestWithDeployment(mani, dgroups.Items) } func doSendManifest(session session.Session, signer txutil.Signer, daddr []byte, mani *types.Manifest) error { diff --git a/manifest/validate.go b/manifest/validate.go deleted file mode 100644 index 395f70b681..0000000000 --- a/manifest/validate.go +++ /dev/null @@ -1,76 +0,0 @@ -package manifest - -import ( - "fmt" - - "github.com/ovrclk/akash/types" -) - -func ValidateWithDeployment(m *types.Manifest, dgroups []*types.DeploymentGroup) error { - return validateResourceGroups(m.Groups, dgroups) -} - -func validateResourceGroups(mgroups []*types.ManifestGroup, dgroups []*types.DeploymentGroup) error { - if len(mgroups) != len(dgroups) { - return fmt.Errorf("invalid manifest: group count mismatch (%v != %v)", len(mgroups), len(dgroups)) - } - -mainloop: - for _, mgroup := range mgroups { - for _, dgroup := range dgroups { - if mgroup.Name != dgroup.Name { - continue - } - if err := validateResourceGroup(mgroup, dgroup); err != nil { - return err - } - continue mainloop - } - return fmt.Errorf("invalid manifest: unknown deployment group ('%v')", mgroup.Name) - } - return nil -} - -func validateResourceGroup(mgroup types.ResourceList, dgroup types.ResourceList) error { - mlist := make([]types.ResourceGroup, len(mgroup.GetResources())) - copy(mlist, mgroup.GetResources()) - -mainloop: - for _, drec := range dgroup.GetResources() { - - for idx := range mlist { - mrec := mlist[idx] - - if mrec.Count == 0 { - continue - } - - if !drec.Unit.Equal(mrec.Unit) { - continue - } - - if mrec.Count > drec.Count { - mrec.Count -= drec.Count - drec.Count = 0 - } else { - drec.Count -= mrec.Count - mrec.Count = 0 - } - - mlist[idx] = mrec - - if drec.Count == 0 { - continue mainloop - } - } - return fmt.Errorf("invalid manifest: unused deployment resources ('%v')", dgroup.GetName()) - } - - for _, mrec := range mlist { - if mrec.Count > 0 { - return fmt.Errorf("invalid manifest: excess manifest resources ('%v')", mgroup.GetName()) - } - } - - return nil -} diff --git a/provider/bidengine/config.go b/provider/bidengine/config.go index 35cfe0c281..876af59240 100644 --- a/provider/bidengine/config.go +++ b/provider/bidengine/config.go @@ -1,9 +1,9 @@ package bidengine type config struct { - FulfillmentCPUMax int64 `env:"AKASH_FULFILLMENT_CPU_MAX" envDefault:"1000"` + FulfillmentCPUMax int64 `env:"AKASH_FULFILLMENT_CPU_MAX" envDefault:"1000"` FulfillmentMemoryMax int64 `env:"AKASH_FULFILLMENT_MEMORY_MAX" envDefault:"1073741824"` // 1Gi - FulfillmentDiskMax int64 `env:"AKASH_FULFILLMENT_DISK_MAX" envDefault:"5368709120"` // 5Gi + FulfillmentDiskMax int64 `env:"AKASH_FULFILLMENT_DISK_MAX" envDefault:"5368709120"` // 5Gi FulfillmentMemPriceMin int64 `env:"AKASH_MEM_PRICE_MIN" envDefault:"50"` FulfillmentMemPriceMax int64 `env:"AKASH_MEM_PRICE_MAX" envDefault:"150"` diff --git a/provider/manifest/handler.go b/provider/manifest/handler.go index 899c7598db..cb501a2ab5 100644 --- a/provider/manifest/handler.go +++ b/provider/manifest/handler.go @@ -12,6 +12,7 @@ import ( "github.com/ovrclk/akash/types" "github.com/ovrclk/akash/types/base" "github.com/ovrclk/akash/util/runner" + "github.com/ovrclk/akash/validation" ) var ErrNotRunning = errors.New("not running") @@ -171,6 +172,13 @@ loop: case req := <-h.mreqch: + if err := validation.ValidateManifest(req.value.Manifest); err != nil { + h.session.Log().Error("manifest validation failed", + "err", err, "deployment", req.value.Deployment) + req.ch <- err + break + } + manager, err := h.ensureManger(req.value.Deployment) if err != nil { h.session.Log().Error("error fetching manager for manifest", diff --git a/provider/manifest/manager.go b/provider/manifest/manager.go index 854b27a18b..08a4d2eda8 100644 --- a/provider/manifest/manager.go +++ b/provider/manifest/manager.go @@ -14,6 +14,7 @@ import ( "github.com/ovrclk/akash/types" "github.com/ovrclk/akash/types/base" "github.com/ovrclk/akash/util/runner" + "github.com/ovrclk/akash/validation" ) func newManager(h *handler, daddr base.Bytes) (*manager, error) { @@ -309,7 +310,7 @@ func (m *manager) validateRequests() { } func (m *manager) validateRequest(req manifestRequest) error { - if err := mutil.ValidateWithDeployment(req.value.Manifest, m.data.dgroups); err != nil { + if err := validation.ValidateManifestWithDeployment(req.value.Manifest, m.data.dgroups); err != nil { return err } return mutil.VerifyRequest(req.value, m.data.deployment) diff --git a/sdl/sdl.go b/sdl/sdl.go index ba59491f41..9861e2c864 100644 --- a/sdl/sdl.go +++ b/sdl/sdl.go @@ -4,6 +4,7 @@ import ( "io/ioutil" "github.com/ovrclk/akash/types" + "github.com/ovrclk/akash/validation" yaml "gopkg.in/yaml.v2" ) @@ -27,5 +28,29 @@ func Read(buf []byte) (SDL, error) { if err := yaml.Unmarshal(buf, obj); err != nil { return nil, err } - return obj, obj.Validate() + + if err := obj.Validate(); err != nil { + return nil, err + } + + dgroups, err := obj.DeploymentGroups() + if err != nil { + return nil, err + } + if err := validation.ValidateGroupSpecs(dgroups); err != nil { + return nil, err + } + + m, err := obj.Manifest() + if err != nil { + return nil, err + } + if err := validation.ValidateManifest(m); err != nil { + return nil, err + } + if err := validation.ValidateManifestWithGroupSpecs(m, dgroups); err != nil { + return nil, err + } + + return obj, nil } diff --git a/sdl/v1.go b/sdl/v1.go index 8538bab179..3ecbe826cf 100644 --- a/sdl/v1.go +++ b/sdl/v1.go @@ -97,13 +97,6 @@ func (sdl *v1) Validate() error { return fmt.Errorf("invalid version: '%v' required", allowedVersion) } - if _, err := sdl.Manifest(); err != nil { - return err - } - - if _, err := sdl.DeploymentGroups(); err != nil { - return err - } return nil } diff --git a/testutil/deployment.go b/testutil/deployment.go index 6f7618cc53..f8538f35dc 100644 --- a/testutil/deployment.go +++ b/testutil/deployment.go @@ -22,6 +22,7 @@ func CreateDeployment(t *testing.T, st state.State, app apptypes.Application, ac for _, group := range groups.GetItems() { s := &types.GroupSpec{ + Name: group.Name, Resources: group.Resources, Requirements: group.Requirements, } diff --git a/types/types.pb.go b/types/types.pb.go index 3f54f905f8..67ffc78cdd 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -996,7 +996,7 @@ type Deployment struct { Address github_com_ovrclk_akash_types_base.Bytes `protobuf:"bytes,1,opt,name=address,proto3,customtype=github.com/ovrclk/akash/types/base.Bytes" json:"address"` Tenant github_com_ovrclk_akash_types_base.Bytes `protobuf:"bytes,2,opt,name=tenant,proto3,customtype=github.com/ovrclk/akash/types/base.Bytes" json:"tenant"` State Deployment_DeploymentState `protobuf:"varint,3,opt,name=state,proto3,enum=types.Deployment_DeploymentState" json:"state,omitempty"` - Version github_com_ovrclk_akash_types_base.Bytes `protobuf:"bytes,4,opt,name=Version,proto3,customtype=github.com/ovrclk/akash/types/base.Bytes" json:"Version"` + Version github_com_ovrclk_akash_types_base.Bytes `protobuf:"bytes,4,opt,name=version,proto3,customtype=github.com/ovrclk/akash/types/base.Bytes" json:"version"` } func (m *Deployment) Reset() { *m = Deployment{} } @@ -10767,160 +10767,159 @@ var ( func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 2466 bytes of a gzipped FileDescriptorProto + // 2460 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x19, 0x4d, 0x6f, 0x1c, 0x49, - 0xd5, 0xdd, 0xf3, 0xd9, 0xcf, 0x9e, 0x64, 0x5c, 0xf6, 0x66, 0x67, 0x4d, 0x14, 0x87, 0xde, 0x95, - 0xd6, 0xbb, 0x49, 0x3c, 0xc6, 0xd9, 0x65, 0xf3, 0x05, 0xac, 0xc7, 0x9e, 0xc4, 0x0e, 0x5e, 0xdb, + 0xd5, 0xdd, 0xf3, 0xd9, 0xcf, 0x9e, 0x64, 0x5c, 0xf6, 0x66, 0x27, 0x26, 0x8a, 0x43, 0xef, 0x4a, + 0xeb, 0xdd, 0x24, 0x1e, 0xe3, 0xec, 0xb2, 0xf9, 0x02, 0xd6, 0x63, 0x4f, 0x62, 0x2f, 0x5e, 0xdb, 0x2a, 0x8f, 0x97, 0xc3, 0x1e, 0x50, 0x7b, 0xa6, 0x3c, 0x69, 0xb9, 0xa7, 0x6b, 0xd2, 0xdd, 0xe3, 0xb5, 0x95, 0xf5, 0x85, 0x03, 0xd2, 0x8a, 0x1b, 0x48, 0x88, 0x03, 0x48, 0x20, 0x71, 0xe0, 0xc2, 0x05, 0x89, 0xff, 0x80, 0xe0, 0xb2, 0x12, 0x08, 0x45, 0x20, 0x05, 0x65, 0x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1e, 0xf5, 0x88, 0x1f, 0x49, 0x49, - 0x5e, 0x8b, 0x37, 0x65, 0x09, 0x56, 0xc7, 0xf0, 0x88, 0x6d, 0x82, 0xd9, 0x4e, 0xbf, 0x93, 0x66, - 0x96, 0xcf, 0x30, 0xcb, 0x12, 0x08, 0x66, 0x59, 0x2c, 0xba, 0x03, 0x15, 0x75, 0xc4, 0x66, 0xd0, - 0x21, 0x41, 0xad, 0xc0, 0xf9, 0x4c, 0x67, 0x84, 0xe2, 0x6b, 0xab, 0x63, 0x38, 0x4d, 0x8c, 0x36, - 0x60, 0x4a, 0x21, 0xee, 0x0e, 0xbc, 0x3d, 0xd7, 0xf3, 0xb8, 0x2c, 0x45, 0xce, 0x63, 0x26, 0xc3, - 0x43, 0xa3, 0x58, 0x1d, 0xc3, 0xa3, 0x36, 0xea, 0xd2, 0xac, 0x13, 0x27, 0x24, 0xb5, 0xd2, 0x48, - 0x69, 0xf8, 0x9a, 0x2e, 0x0d, 0x47, 0xa0, 0x26, 0x54, 0x15, 0x62, 0x2b, 0xa0, 0x07, 0x2e, 0xbb, - 0x4e, 0x99, 0x33, 0x78, 0x35, 0xc3, 0x40, 0x2d, 0xaf, 0x8e, 0xe1, 0xa1, 0x2d, 0x68, 0x15, 0x26, - 0xa3, 0xc3, 0x65, 0x8f, 0x86, 0xba, 0x7a, 0x2d, 0xce, 0xa7, 0x96, 0xf0, 0x49, 0xaf, 0xaf, 0x8e, - 0xe1, 0xe1, 0x4d, 0xd2, 0xec, 0x0c, 0xa9, 0x6b, 0x07, 0xb2, 0x66, 0xcf, 0x10, 0x48, 0xb3, 0x67, - 0xb0, 0xe8, 0x26, 0x4c, 0x48, 0xac, 0x50, 0xcd, 0x38, 0x67, 0x33, 0x95, 0x66, 0xa3, 0x34, 0x93, - 0x22, 0x6d, 0x58, 0xb1, 0xf7, 0xdb, 0xdf, 0x33, 0xa0, 0x24, 0x43, 0x0b, 0xdd, 0x87, 0x92, 0xd3, + 0x2e, 0xc6, 0x9b, 0xb2, 0x04, 0xab, 0x63, 0x78, 0xc4, 0x36, 0xc1, 0x6c, 0xa7, 0xdf, 0x49, 0x33, + 0xcb, 0x67, 0x98, 0x65, 0x09, 0x04, 0xb3, 0x2c, 0x16, 0xdd, 0x85, 0x8a, 0x3a, 0x62, 0x33, 0xe8, + 0x90, 0xa0, 0x56, 0xe0, 0x7c, 0xa6, 0x33, 0x42, 0xf1, 0xb5, 0xd5, 0x31, 0x9c, 0x26, 0x46, 0x1b, + 0x30, 0xa5, 0x10, 0xf7, 0x06, 0xde, 0x9e, 0xeb, 0x79, 0x5c, 0x96, 0x22, 0xe7, 0x31, 0x93, 0xe1, + 0xa1, 0x51, 0xac, 0x8e, 0xe1, 0x51, 0x1b, 0x75, 0x69, 0xd6, 0x89, 0x13, 0x92, 0x5a, 0x69, 0xa4, + 0x34, 0x7c, 0x4d, 0x97, 0x86, 0x23, 0x50, 0x13, 0xaa, 0x0a, 0xb1, 0x15, 0xd0, 0x03, 0x97, 0x5d, + 0xa7, 0xcc, 0x19, 0xbc, 0x9a, 0x61, 0xa0, 0x96, 0x57, 0xc7, 0xf0, 0xd0, 0x16, 0xb4, 0x0a, 0x93, + 0xd1, 0xe1, 0xb2, 0x47, 0x43, 0x5d, 0xbd, 0x16, 0xe7, 0x53, 0x4b, 0xf8, 0xa4, 0xd7, 0x57, 0xc7, + 0xf0, 0xf0, 0x26, 0x69, 0x76, 0x86, 0xd4, 0xb5, 0x03, 0x59, 0xb3, 0x67, 0x08, 0xa4, 0xd9, 0x33, + 0x58, 0x74, 0x0b, 0x26, 0x24, 0x56, 0xa8, 0x66, 0x9c, 0xb3, 0x99, 0x4a, 0xb3, 0x51, 0x9a, 0x49, + 0x91, 0x36, 0xac, 0xd8, 0xfb, 0xed, 0xef, 0x19, 0x50, 0x92, 0xa1, 0x85, 0xde, 0x87, 0x92, 0xd3, 0xe9, 0x04, 0x24, 0x0c, 0x45, 0x20, 0x35, 0x16, 0x58, 0x08, 0xfc, 0xe9,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, 0x4f, 0xb3, 0xca, 0x93, 0xd5, 0x95, 0x96, 0x14, 0x81, 0xcc, 0x83, - 0xda, 0x0e, 0x69, 0xab, 0xf7, 0xc1, 0x52, 0xc4, 0x21, 0xba, 0x0e, 0x56, 0x5f, 0x01, 0x32, 0x71, + 0xda, 0x0e, 0x69, 0xab, 0xf7, 0xc0, 0x52, 0xc4, 0x21, 0xba, 0x01, 0x56, 0x5f, 0x01, 0x32, 0x71, 0x9f, 0xcf, 0x70, 0x94, 0x8c, 0x12, 0x3a, 0xfb, 0xb7, 0x06, 0x54, 0xb3, 0x11, 0x98, 0x5c, 0xdf, 0x38, 0xb3, 0xeb, 0x9b, 0xcf, 0xba, 0x7e, 0xee, 0x45, 0xaf, 0x9f, 0x38, 0x70, 0x5e, 0x73, 0x60, - 0xfb, 0x23, 0x98, 0xc0, 0x24, 0xa4, 0x83, 0xa0, 0x4d, 0x76, 0x7c, 0x37, 0x42, 0xaf, 0x41, 0x6e, - 0x79, 0x6b, 0x87, 0xdf, 0xa2, 0xd2, 0x28, 0xfd, 0xfd, 0xc9, 0x6c, 0xae, 0xdd, 0x1f, 0x60, 0x86, - 0x63, 0x2e, 0xd5, 0x23, 0x3d, 0x1a, 0x1c, 0xc9, 0xd0, 0x90, 0x10, 0x42, 0x90, 0xef, 0xb8, 0xe1, - 0xbe, 0x74, 0x34, 0xfe, 0x2d, 0x75, 0xdd, 0x87, 0x8a, 0x62, 0x7e, 0x2f, 0xa0, 0x83, 0x3e, 0xba, - 0x06, 0xf9, 0x81, 0xef, 0x46, 0x9c, 0x7d, 0x12, 0xf4, 0xba, 0x00, 0x52, 0x70, 0x4e, 0xc6, 0x44, - 0xe6, 0x21, 0xce, 0x0f, 0xac, 0x60, 0x01, 0x30, 0x6c, 0x3f, 0x70, 0x93, 0x48, 0xe4, 0x80, 0x3c, - 0x71, 0x19, 0x26, 0x87, 0x74, 0xc1, 0x04, 0xf4, 0x9d, 0x9e, 0x28, 0x7a, 0x16, 0xe6, 0xdf, 0x8c, - 0xc9, 0x81, 0xe3, 0x0d, 0x88, 0xd4, 0xb2, 0x00, 0x24, 0x93, 0x9f, 0x18, 0x60, 0x71, 0x79, 0xb7, - 0xfb, 0xa4, 0x3d, 0x72, 0x77, 0x03, 0x26, 0x02, 0xf2, 0x70, 0xe0, 0x06, 0x84, 0xe5, 0xb4, 0xb0, - 0x66, 0x3e, 0x97, 0x35, 0x52, 0x7b, 0xd0, 0x0d, 0xb0, 0x02, 0x79, 0x71, 0x65, 0xce, 0xe9, 0x8c, - 0x42, 0xb8, 0x10, 0xca, 0x01, 0x63, 0x62, 0xfb, 0x18, 0x26, 0x93, 0xec, 0xcc, 0x69, 0xd6, 0x56, - 0xd0, 0x16, 0x40, 0x27, 0xc9, 0xf3, 0xa7, 0xf5, 0x42, 0x8d, 0x07, 0x6b, 0x4e, 0x42, 0xf2, 0x50, - 0x1a, 0x9b, 0x7d, 0xde, 0xca, 0xff, 0xe8, 0xa7, 0xb3, 0x63, 0xf6, 0x3f, 0x4d, 0x38, 0x9f, 0x39, - 0x1f, 0x2d, 0x82, 0xe9, 0x76, 0xa4, 0x59, 0x95, 0x1a, 0x86, 0x64, 0x6c, 0x94, 0x99, 0x3c, 0x9f, - 0x3d, 0x99, 0x35, 0xb0, 0xe9, 0x76, 0x62, 0xc5, 0x9a, 0x9a, 0x62, 0x67, 0xa0, 0x4c, 0x59, 0x49, - 0x6e, 0xb5, 0xd6, 0xb9, 0x79, 0x73, 0x38, 0x86, 0xd1, 0x12, 0x14, 0xc2, 0xc8, 0x89, 0x84, 0x03, - 0x9f, 0x5b, 0xbc, 0x32, 0xfa, 0x98, 0x2c, 0xbc, 0xcd, 0xb6, 0x60, 0xb1, 0x73, 0xc8, 0x6e, 0x85, - 0x97, 0xb5, 0x5b, 0xf1, 0x45, 0xec, 0x76, 0x13, 0xa6, 0x47, 0x09, 0x87, 0xca, 0x90, 0xdf, 0xdc, - 0x6a, 0x6e, 0x54, 0xc7, 0xd0, 0x38, 0x94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, 0x3d, 0x85, 0xe9, 0xf8, 0xbc, 0x75, - 0x63, 0x68, 0xde, 0x7a, 0x0a, 0x4e, 0xda, 0x84, 0x36, 0xed, 0xd1, 0xb9, 0x33, 0xf0, 0xe8, 0x2b, - 0x50, 0xee, 0xc9, 0x8b, 0xcb, 0xe9, 0xa8, 0x1a, 0x51, 0xc4, 0xfa, 0x88, 0x09, 0xec, 0x1b, 0x50, - 0x56, 0x58, 0x74, 0x35, 0xee, 0xb9, 0x8c, 0xd4, 0x2b, 0x45, 0x11, 0x88, 0x87, 0x81, 0xea, 0xbb, - 0xbe, 0x05, 0x95, 0xd4, 0xc2, 0xc8, 0x77, 0xef, 0x22, 0x94, 0x43, 0x12, 0x1c, 0xb8, 0xec, 0xe9, - 0x63, 0xa6, 0xde, 0x1b, 0x6a, 0xef, 0xb6, 0x58, 0xc6, 0x31, 0x9d, 0xfd, 0x47, 0x23, 0xb1, 0x9c, - 0x5c, 0x3d, 0xe9, 0x45, 0xee, 0xf6, 0x9c, 0x6e, 0xfc, 0x22, 0xe7, 0x00, 0xa3, 0x74, 0x82, 0xae, - 0x78, 0x20, 0x5b, 0x98, 0x7f, 0xb3, 0xbe, 0x80, 0xf8, 0x07, 0x7c, 0x02, 0x64, 0x61, 0xf6, 0x89, - 0xde, 0x94, 0x73, 0x85, 0xc2, 0x89, 0x73, 0x85, 0xec, 0x44, 0xa1, 0xa8, 0x4f, 0x14, 0xde, 0x81, - 0x22, 0x39, 0xec, 0x53, 0x3e, 0xa8, 0x65, 0x97, 0xba, 0x38, 0xfa, 0x52, 0x4d, 0x4e, 0x83, 0x25, - 0x2d, 0x6b, 0x43, 0x5e, 0x19, 0x49, 0xc1, 0x84, 0xee, 0xd3, 0x40, 0x24, 0xb4, 0x0a, 0xe6, 0xdf, - 0xc8, 0x86, 0x09, 0x72, 0x18, 0x91, 0xc0, 0x77, 0xbc, 0x2d, 0xb6, 0x26, 0x46, 0x1a, 0x29, 0x9c, - 0x08, 0x31, 0x1a, 0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x37, 0x42, 0x17, 0x21, 0xb7, + 0xbc, 0xb5, 0xc3, 0x6f, 0x51, 0x69, 0x94, 0xfe, 0xfe, 0x64, 0x36, 0xd7, 0xee, 0x0f, 0x30, 0xc3, + 0x31, 0x97, 0xea, 0x91, 0x1e, 0x0d, 0x8e, 0x64, 0x68, 0x48, 0x08, 0x21, 0xc8, 0x77, 0xdc, 0x70, + 0x5f, 0x3a, 0x1a, 0xff, 0x96, 0xba, 0xee, 0x43, 0x45, 0x31, 0xbf, 0x1f, 0xd0, 0x41, 0x1f, 0x5d, + 0x87, 0xfc, 0xc0, 0x77, 0x23, 0xce, 0x3e, 0x09, 0x7a, 0x5d, 0x00, 0x29, 0x38, 0x27, 0x63, 0x22, + 0xf3, 0x10, 0xe7, 0x07, 0x56, 0xb0, 0x00, 0x18, 0xb6, 0x1f, 0xb8, 0x49, 0x24, 0x72, 0x40, 0x9e, + 0xb8, 0x0c, 0x93, 0x43, 0xba, 0x60, 0x02, 0xfa, 0x4e, 0x4f, 0x14, 0x3d, 0x0b, 0xf3, 0x6f, 0xc6, + 0xe4, 0xc0, 0xf1, 0x06, 0x44, 0x6a, 0x59, 0x00, 0x92, 0xc9, 0x4f, 0x0c, 0xb0, 0xb8, 0xbc, 0xdb, + 0x7d, 0xd2, 0x1e, 0xb9, 0xbb, 0x01, 0x13, 0x01, 0x79, 0x38, 0x70, 0x03, 0xc2, 0x72, 0x5a, 0x58, + 0x33, 0x9f, 0xcb, 0x1a, 0xa9, 0x3d, 0xe8, 0x26, 0x58, 0x81, 0xbc, 0xb8, 0x32, 0xe7, 0x74, 0x46, + 0x21, 0x5c, 0x08, 0xe5, 0x80, 0x31, 0xb1, 0x7d, 0x0c, 0x93, 0x49, 0x76, 0xe6, 0x34, 0x6b, 0x2b, + 0x68, 0x0b, 0xa0, 0x93, 0xe4, 0xf9, 0xd3, 0x7a, 0xa1, 0xc6, 0x83, 0x35, 0x27, 0x21, 0x79, 0x28, + 0x8d, 0xcd, 0x3e, 0x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x5f, 0xe3, 0x42, 0xbc, 0x8b, 0xde, 0x79, 0x31, 0x21, 0xea, + 0x8f, 0x98, 0x9b, 0x1f, 0xa3, 0x01, 0x8c, 0x4b, 0xbe, 0xeb, 0xb4, 0x1b, 0x22, 0x2d, 0x59, 0xa8, + 0xe3, 0xb5, 0x58, 0xb4, 0x9b, 0xfc, 0xb0, 0x6f, 0xd8, 0x6f, 0xd7, 0x3d, 0xda, 0x0d, 0x5f, 0xf0, + 0xac, 0xdb, 0x2a, 0xed, 0x2c, 0x18, 0x8d, 0xea, 0xe3, 0xa7, 0x97, 0x8d, 0x7f, 0x3c, 0xbd, 0x6c, + 0x7c, 0xf6, 0xf9, 0x65, 0xe3, 0xf1, 0xe7, 0x97, 0x8d, 0xdd, 0x22, 0xef, 0x3f, 0x6e, 0xfc, 0x3b, + 0x00, 0x00, 0xff, 0xff, 0x3a, 0x12, 0x0d, 0x6e, 0x50, 0x21, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index b06a25ccd6..fa0c9d2c0b 100644 --- a/types/types.proto +++ b/types/types.proto @@ -157,7 +157,7 @@ message Deployment { CLOSED = 2; } DeploymentState state = 3; - bytes Version = 4 [(gogoproto.customtype)="github.com/ovrclk/akash/types/base.Bytes",(gogoproto.nullable) = false]; + bytes version = 4 [(gogoproto.customtype)="github.com/ovrclk/akash/types/base.Bytes",(gogoproto.nullable) = false]; } message Deployments { diff --git a/validation/config.go b/validation/config.go new file mode 100644 index 0000000000..cfaffb35a6 --- /dev/null +++ b/validation/config.go @@ -0,0 +1,23 @@ +package validation + +import ( + "github.com/caarlos0/env" +) + +type config struct { + MaxUnitCPU uint `env:"AKASH_MAX_UNIT_CPU" envDefault:"10"` + MaxUnitMemory uint `env:"AKASH_MAX_UNIT_MEMORY" envDefault:"1073741824"` // 1Gi + MaxUnitDisk uint `env:"AKASH_MAX_UNIT_DISK" envDefault:"1073741824"` // 1Gi + MaxUnitCount uint `env:"AKASH_MAX_UNIT_COUNT" envDefault:"10"` + MaxUnitPrice uint `env:"AKASH_MAX_UNIT_PRICE" envDefault:"10000"` + + MaxGroupCount uint `env:"AKASH_MAX_GROUP_COUNT" envDefault:"10"` +} + +var defaultConfig = config{} + +func init() { + if err := env.Parse(&defaultConfig); err != nil { + panic(err) + } +} diff --git a/validation/deployment.go b/validation/deployment.go new file mode 100644 index 0000000000..69395844c0 --- /dev/null +++ b/validation/deployment.go @@ -0,0 +1,29 @@ +package validation + +import ( + "fmt" + + "github.com/ovrclk/akash/types" +) + +func ValidateDeploymentGroups(groups []*types.DeploymentGroup) error { + rlists := make([]types.ResourceList, 0, len(groups)) + for _, group := range groups { + rlists = append(rlists, group) + } + if err := validateResourceLists(defaultConfig, rlists); err != nil { + return fmt.Errorf("deployment groups: %v", err) + } + return nil +} + +func ValidateGroupSpecs(groups []*types.GroupSpec) error { + rlists := make([]types.ResourceList, 0, len(groups)) + for _, group := range groups { + rlists = append(rlists, group) + } + if err := validateResourceLists(defaultConfig, rlists); err != nil { + return fmt.Errorf("group specs: %v", err) + } + return nil +} diff --git a/validation/manifest.go b/validation/manifest.go new file mode 100644 index 0000000000..8af42795f0 --- /dev/null +++ b/validation/manifest.go @@ -0,0 +1,104 @@ +package validation + +import ( + "fmt" + + "github.com/ovrclk/akash/types" +) + +func ValidateManifest(m *types.Manifest) error { + return validateManifestGroups(m.Groups) +} + +func validateManifestGroups(groups []*types.ManifestGroup) error { + rlists := make([]types.ResourceList, 0, len(groups)) + for _, group := range groups { + rlists = append(rlists, group) + } + if err := validateResourceLists(defaultConfig, rlists); err != nil { + return fmt.Errorf("manifest groups: %v", err) + } + return nil +} + +func ValidateManifestWithGroupSpecs(m *types.Manifest, gspecs []*types.GroupSpec) error { + rlists := make([]types.ResourceList, 0, len(gspecs)) + for _, gspec := range gspecs { + rlists = append(rlists, gspec) + } + return validateManifestDeploymentGroups(m.Groups, rlists) +} + +func ValidateManifestWithDeployment(m *types.Manifest, dgroups []*types.DeploymentGroup) error { + rlists := make([]types.ResourceList, 0, len(dgroups)) + for _, dgroup := range dgroups { + rlists = append(rlists, dgroup) + } + return validateManifestDeploymentGroups(m.Groups, rlists) +} + +func validateManifestDeploymentGroups(mgroups []*types.ManifestGroup, dgroups []types.ResourceList) error { + + if len(mgroups) != len(dgroups) { + return fmt.Errorf("invalid manifest: group count mismatch (%v != %v)", len(mgroups), len(dgroups)) + } + +mainloop: + for _, mgroup := range mgroups { + for _, dgroup := range dgroups { + if mgroup.GetName() != dgroup.GetName() { + continue + } + if err := validateManifestDeploymentGroup(mgroup, dgroup); err != nil { + return err + } + continue mainloop + } + return fmt.Errorf("invalid manifest: unknown deployment group ('%v')", mgroup.GetName()) + } + return nil +} + +func validateManifestDeploymentGroup(mgroup types.ResourceList, dgroup types.ResourceList) error { + mlist := make([]types.ResourceGroup, len(mgroup.GetResources())) + copy(mlist, mgroup.GetResources()) + +mainloop: + for _, drec := range dgroup.GetResources() { + + for idx := range mlist { + mrec := mlist[idx] + + if mrec.Count == 0 { + continue + } + + if !drec.Unit.Equal(mrec.Unit) { + continue + } + + if mrec.Count > drec.Count { + mrec.Count -= drec.Count + drec.Count = 0 + } else { + drec.Count -= mrec.Count + mrec.Count = 0 + } + + mlist[idx] = mrec + + if drec.Count == 0 { + continue mainloop + } + } + return fmt.Errorf("invalid manifest: unused deployment resources ('%v')", dgroup.GetName()) + } + + for _, mrec := range mlist { + if mrec.Count > 0 { + return fmt.Errorf("invalid manifest: excess manifest resources ('%v')", mgroup.GetName()) + } + } + + return nil +} diff --git a/manifest/validate_test.go b/validation/manifest_test.go similarity index 95% rename from manifest/validate_test.go rename to validation/manifest_test.go index f26602cff3..9c859dda70 100644 --- a/manifest/validate_test.go +++ b/validation/manifest_test.go @@ -1,13 +1,14 @@ -package manifest +package validation_test import ( "testing" "github.com/ovrclk/akash/types" + "github.com/ovrclk/akash/validation" "github.com/stretchr/testify/assert" ) -func Test_ValidateWithDeployment(t *testing.T) { +func Test_ValidateManifest(t *testing.T) { tests := []struct { name string @@ -242,7 +243,7 @@ func Test_ValidateWithDeployment(t *testing.T) { for _, test := range tests { m := &types.Manifest{Groups: test.mgroups} - err := ValidateWithDeployment(m, test.dgroups) + err := validation.ValidateManifestWithDeployment(m, test.dgroups) if test.ok { assert.NoError(t, err, test.name) diff --git a/validation/resources.go b/validation/resources.go new file mode 100644 index 0000000000..e6432f0e69 --- /dev/null +++ b/validation/resources.go @@ -0,0 +1,67 @@ +package validation + +import ( + "fmt" + + "github.com/ovrclk/akash/types" +) + +func validateResourceLists(config config, rlists []types.ResourceList) error { + + if len(rlists) == 0 { + return fmt.Errorf("error: no groups present") + } + + names := make(map[string]bool) + + for _, rlist := range rlists { + + if ok := names[rlist.GetName()]; ok { + return fmt.Errorf("error: duplicate name (%v)", rlist.GetName()) + } + names[rlist.GetName()] = true + + if err := validateResourceList(config, rlist); err != nil { + return err + } + } + return nil +} + +func validateResourceList(config config, rlist types.ResourceList) error { + if rlist.GetName() == "" { + return fmt.Errorf("group: empty name") + } + for _, resource := range rlist.GetResources() { + if err := validateResourceGroup(config, resource); err != nil { + return fmt.Errorf("group %v: %v", rlist.GetName(), err) + } + } + return nil +} + +func validateResourceGroup(config config, rg types.ResourceGroup) error { + if err := validateResourceUnit(config, rg.Unit); err != nil { + return nil + } + if rg.Count > uint32(config.MaxUnitCount) { + return fmt.Errorf("error: unit count too high (%v > %v).", rg.Count, config.MaxUnitCount) + } + if rg.Price > uint64(config.MaxUnitPrice) { + return fmt.Errorf("error: unit price too high (%v > %v).", rg.Price, config.MaxUnitPrice) + } + return nil +} + +func validateResourceUnit(config config, unit types.ResourceUnit) error { + if unit.CPU > uint32(config.MaxUnitCPU) { + return fmt.Errorf("error: unit cpu too high (%v > %v).", unit.CPU, config.MaxUnitCPU) + } + if unit.Memory > uint64(config.MaxUnitMemory) { + return fmt.Errorf("error: unit memory too high (%v > %v).", unit.Memory, config.MaxUnitMemory) + } + if unit.Disk > uint64(config.MaxUnitDisk) { + return fmt.Errorf("error: unit disk too high (%v > %v).", unit.Disk, config.MaxUnitDisk) + } + return nil +}