Skip to content

Commit

Permalink
feat(serverless_jobs): add local storage limit (#1145)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Feb 14, 2024
1 parent 8c8bcdd commit dc885f0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/clients/src/api/jobs/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const unmarshalJobDefinition = (data: unknown): JobDefinition => {
id: data.id,
imageUri: data.image_uri,
jobTimeout: data.job_timeout,
localStorageCapacity: data.local_storage_capacity,
memoryLimit: data.memory_limit,
name: data.name,
projectId: data.project_id,
Expand All @@ -77,6 +78,7 @@ export const unmarshalJobRun = (data: unknown): JobRun => {
exitCode: data.exit_code,
id: data.id,
jobDefinitionId: data.job_definition_id,
localStorageCapacity: data.local_storage_capacity,
memoryLimit: data.memory_limit,
region: data.region,
runDuration: data.run_duration,
Expand Down Expand Up @@ -161,6 +163,7 @@ export const marshalCreateJobDefinitionRequest = (
: undefined,
image_uri: request.imageUri,
job_timeout: request.jobTimeout,
local_storage_capacity: request.localStorageCapacity,
memory_limit: request.memoryLimit,
name: request.name || randomName('job'),
project_id: request.projectId ?? defaults.defaultProjectId,
Expand Down Expand Up @@ -200,6 +203,7 @@ export const marshalUpdateJobDefinitionRequest = (
environment_variables: request.environmentVariables,
image_uri: request.imageUri,
job_timeout: request.jobTimeout,
local_storage_capacity: request.localStorageCapacity,
memory_limit: request.memoryLimit,
name: request.name,
})
10 changes: 8 additions & 2 deletions packages/clients/src/api/jobs/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface JobDefinition {
description: string
jobTimeout?: string
cronSchedule?: CronSchedule
localStorageCapacity: number
/**
* Region to target. If none is passed will use default region from the
* config.
Expand All @@ -63,6 +64,7 @@ export interface JobRun {
memoryLimit: number
command: string
environmentVariables: Record<string, string>
localStorageCapacity: number
/**
* Region to target. If none is passed will use default region from the
* config.
Expand All @@ -85,8 +87,10 @@ export type CreateJobDefinitionRequest = {
name?: string
/** CPU limit of the job. */
cpuLimit: number
/** Memory limit of the job. */
/** Memory limit of the job (in MiB). */
memoryLimit: number
/** Local storage capacity of the job (in MiB). */
localStorageCapacity?: number
/** Image to use for the job. */
imageUri: string
/** Startup command. */
Expand Down Expand Up @@ -209,8 +213,10 @@ export type UpdateJobDefinitionRequest = {
name?: string
/** CPU limit of the job. */
cpuLimit?: number
/** Memory limit of the job. */
/** Memory limit of the job (in MiB). */
memoryLimit?: number
/** Local storage capacity of the job (in MiB). */
localStorageCapacity?: number
/** Image to use for the job. */
imageUri?: string
/** Startup command. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export const CreateJobDefinitionRequest = {
pattern:
/^((?:(?:(?:[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,}))?$/,
},
localStorageCapacity: {
greaterThan: 0,
},
memoryLimit: {
greaterThan: 0,
},
Expand Down Expand Up @@ -73,6 +76,9 @@ export const UpdateJobDefinitionRequest = {
pattern:
/^((?:(?:(?:[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,}))?$/,
},
localStorageCapacity: {
greaterThan: 0,
},
memoryLimit: {
greaterThan: 0,
},
Expand Down

0 comments on commit dc885f0

Please sign in to comment.