Skip to content

Commit dc885f0

Browse files
authored
feat(serverless_jobs): add local storage limit (scaleway#1145)
1 parent 8c8bcdd commit dc885f0

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

packages/clients/src/api/jobs/v1alpha1/marshalling.gen.ts

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const unmarshalJobDefinition = (data: unknown): JobDefinition => {
5353
id: data.id,
5454
imageUri: data.image_uri,
5555
jobTimeout: data.job_timeout,
56+
localStorageCapacity: data.local_storage_capacity,
5657
memoryLimit: data.memory_limit,
5758
name: data.name,
5859
projectId: data.project_id,
@@ -77,6 +78,7 @@ export const unmarshalJobRun = (data: unknown): JobRun => {
7778
exitCode: data.exit_code,
7879
id: data.id,
7980
jobDefinitionId: data.job_definition_id,
81+
localStorageCapacity: data.local_storage_capacity,
8082
memoryLimit: data.memory_limit,
8183
region: data.region,
8284
runDuration: data.run_duration,
@@ -161,6 +163,7 @@ export const marshalCreateJobDefinitionRequest = (
161163
: undefined,
162164
image_uri: request.imageUri,
163165
job_timeout: request.jobTimeout,
166+
local_storage_capacity: request.localStorageCapacity,
164167
memory_limit: request.memoryLimit,
165168
name: request.name || randomName('job'),
166169
project_id: request.projectId ?? defaults.defaultProjectId,
@@ -200,6 +203,7 @@ export const marshalUpdateJobDefinitionRequest = (
200203
environment_variables: request.environmentVariables,
201204
image_uri: request.imageUri,
202205
job_timeout: request.jobTimeout,
206+
local_storage_capacity: request.localStorageCapacity,
203207
memory_limit: request.memoryLimit,
204208
name: request.name,
205209
})

packages/clients/src/api/jobs/v1alpha1/types.gen.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface JobDefinition {
4242
description: string
4343
jobTimeout?: string
4444
cronSchedule?: CronSchedule
45+
localStorageCapacity: number
4546
/**
4647
* Region to target. If none is passed will use default region from the
4748
* config.
@@ -63,6 +64,7 @@ export interface JobRun {
6364
memoryLimit: number
6465
command: string
6566
environmentVariables: Record<string, string>
67+
localStorageCapacity: number
6668
/**
6769
* Region to target. If none is passed will use default region from the
6870
* config.
@@ -85,8 +87,10 @@ export type CreateJobDefinitionRequest = {
8587
name?: string
8688
/** CPU limit of the job. */
8789
cpuLimit: number
88-
/** Memory limit of the job. */
90+
/** Memory limit of the job (in MiB). */
8991
memoryLimit: number
92+
/** Local storage capacity of the job (in MiB). */
93+
localStorageCapacity?: number
9094
/** Image to use for the job. */
9195
imageUri: string
9296
/** Startup command. */
@@ -209,8 +213,10 @@ export type UpdateJobDefinitionRequest = {
209213
name?: string
210214
/** CPU limit of the job. */
211215
cpuLimit?: number
212-
/** Memory limit of the job. */
216+
/** Memory limit of the job (in MiB). */
213217
memoryLimit?: number
218+
/** Local storage capacity of the job (in MiB). */
219+
localStorageCapacity?: number
214220
/** Image to use for the job. */
215221
imageUri?: string
216222
/** Startup command. */

packages/clients/src/api/jobs/v1alpha1/validation-rules.gen.ts

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export const CreateJobDefinitionRequest = {
99
pattern:
1010
/^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/,
1111
},
12+
localStorageCapacity: {
13+
greaterThan: 0,
14+
},
1215
memoryLimit: {
1316
greaterThan: 0,
1417
},
@@ -73,6 +76,9 @@ export const UpdateJobDefinitionRequest = {
7376
pattern:
7477
/^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/,
7578
},
79+
localStorageCapacity: {
80+
greaterThan: 0,
81+
},
7682
memoryLimit: {
7783
greaterThan: 0,
7884
},

0 commit comments

Comments
 (0)