Documentation
¶
Index ¶
- func LoadModule(ctx context.Context, runtime wazero.Runtime, path string) (wazero.CompiledModule, error)
- func LoadRemoteModule(ctx context.Context, runtime wazero.Runtime, provider storage.StorageProvider, ...) (wazero.CompiledModule, error)
- func ValidateModuleAgainstJob(module wazero.CompiledModule, job model.Spec, ...) error
- func ValidateModuleAsEntryPoint(module wazero.CompiledModule, name string) error
- func ValidateModuleHasFunction(module wazero.CompiledModule, name string, parameters []api.ValueType, ...) error
- func ValidateModuleImports(module wazero.CompiledModule, importModules ...wazero.CompiledModule) error
- type Executor
- func (e *Executor) GetVolumeSize(ctx context.Context, volume model.StorageSpec) (uint64, error)
- func (e *Executor) HasStorageLocally(ctx context.Context, volume model.StorageSpec) (bool, error)
- func (e *Executor) IsInstalled(context.Context) (bool, error)
- func (e *Executor) RunShard(ctx context.Context, shard model.JobShard, jobResultsDir string) (*model.RunCommandResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadModule ¶
func LoadRemoteModule ¶
func LoadRemoteModule( ctx context.Context, runtime wazero.Runtime, provider storage.StorageProvider, spec model.StorageSpec, ) (wazero.CompiledModule, error)
func ValidateModuleAgainstJob ¶
func ValidateModuleAgainstJob( module wazero.CompiledModule, job model.Spec, importModules ...wazero.CompiledModule, ) error
ValidateModuleAgainstJob will return an error if the passed job does not represent a valid WASM executor job or the passed module is not able to be run to fulfill the job.
func ValidateModuleAsEntryPoint ¶
func ValidateModuleAsEntryPoint( module wazero.CompiledModule, name string, ) error
ValidateModuleAsEntryPoint returns an error if the passed module is not capable of being an entry point to a job, i.e. that it contains a function of the passed name that meets the specification of:
- the named function exists and is exported - the function takes no parameters - the function returns one i32 value (exit code)
func ValidateModuleHasFunction ¶
func ValidateModuleHasFunction( module wazero.CompiledModule, name string, parameters []api.ValueType, results []api.ValueType, ) error
ValidateModuleHasFunction returns an error if the passed module does not contain an exported function with the passed name, parameters and return values.
func ValidateModuleImports ¶
func ValidateModuleImports( module wazero.CompiledModule, importModules ...wazero.CompiledModule, ) error
ValidateModuleImports will return an error if the passed module requires imports that are not found in any of the passed importModules. Imports have to match exactly, i.e. function names and signatures must be an exact match.
Types ¶
type Executor ¶
type Executor struct {
StorageProvider storage.StorageProvider
}