File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ The `DOCKER_COMPUTE_ENVIRONMENTS` environment variable should be a JSON array of
218218 - ** maxJobDuration** : Maximum duration in seconds for a free job.
219219 - ** minJobDuration** : Minimum duration in seconds for a free job.
220220 - ** maxJobs** : Maximum number of simultaneous free jobs.
221+ - ** allowImageBuild** : If building images is allowed on free envs. Default: false
221222 - ** access** : Access control configuration for free compute jobs. Works the same as the main ` access ` field.
222223 - ** addresses** : Array of Ethereum addresses allowed to run free compute jobs.
223224 - ** accessLists** : Array of AccessList contract addresses for free compute access control.
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ export interface ComputeEnvironmentFreeOptions {
106106 maxJobs ?: number // maximum number of simultaneous free jobs
107107 resources ?: ComputeResource [ ]
108108 access : ComputeAccessList
109+ allowImageBuild ?: boolean
109110}
110111export interface ComputeEnvironmentBaseConfig {
111112 description ?: string // v1
Original file line number Diff line number Diff line change @@ -1108,9 +1108,13 @@ export class C2DEngineDocker extends C2DEngine {
11081108 throw new Error ( `additionalDockerFiles cannot be used with queued jobs` )
11091109 }
11101110 }
1111- // if (algorithm.meta.container && algorithm.meta.container.dockerfile && isFree) {
1112- // throw new Error(`Building image is not allowed for free jobs`)
1113- // }
1111+ if (
1112+ algorithm . meta . container &&
1113+ algorithm . meta . container . dockerfile &&
1114+ ! env . free . allowImageBuild
1115+ ) {
1116+ throw new Error ( `Building image is not allowed for free jobs` )
1117+ }
11141118
11151119 const job : DBComputeJob = {
11161120 clusterHash : this . getC2DConfig ( ) . hash ,
Original file line number Diff line number Diff line change @@ -153,7 +153,8 @@ export const ComputeEnvironmentFreeOptionsSchema = z.object({
153153 . nullable ( )
154154 . optional ( )
155155 } )
156- . optional ( )
156+ . optional ( ) ,
157+ allowImageBuild : z . boolean ( ) . optional ( ) . default ( false )
157158} )
158159
159160export const C2DDockerConfigSchema = z . array (
You can’t perform that action at this time.
0 commit comments