33 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			33 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
|  | package processing | ||
|  | 
 | ||
|  | import oclib "oc-lib" | ||
|  | 
 | ||
|  | type Processing struct { | ||
|  | 	oclib.AbstractResource    `json:"resource" required:"true"` | ||
|  | 	Container   string              `json:"container,omitempty"`  // We could create a specific class for container, that could check if the name exists/is available | ||
|  | 	Repository  string              `json:"repository,omitempty"` // Indicate where to find the container image	=> Could add a struct handling authentication to the repo | ||
|  | 	Command     string              `json:"command,omitempty"` | ||
|  | 	Arguments   []string            `json:"arguments,omitempty"` | ||
|  | 	Environment []map[string]string `json:"environment,omitempty"` // a key/value struct is what ressembles the most a NAME=VALUE struct | ||
|  | 
 | ||
|  | 	ExecutionRequirements ExecutionRequirementsModel `json:"execution_requirements,omitempty"` | ||
|  | 
 | ||
|  | 	Price   uint   `json:"price,omitempty"` | ||
|  | 	License string `json:"license,omitempty"` | ||
|  | 
 | ||
|  | } | ||
|  | 
 | ||
|  | type ExecutionRequirementsModel struct { | ||
|  | 	CPUs uint `json:"cp_us,omitempty"` | ||
|  | 	GPUs uint `json:"gp_us,omitempty"` | ||
|  | 	RAM  uint `json:"ram,omitempty"` | ||
|  | 
 | ||
|  | 	Parallel     bool   `json:"parallel,omitempty"` | ||
|  | 	ScalingModel uint   `json:"scaling_model,omitempty"` | ||
|  | 	DiskIO       string `json:"disk_io,omitempty"` | ||
|  | } | ||
|  | 
 | ||
|  | func (p *Processing) GetType() oclib.ResourceType{ | ||
|  | 	return oclib.PROCESSING | ||
|  | } |