Skip to content

Commit b82ddce

Browse files
feat(serverless_jobs): migrate to v1alpha2 (#5328)
Co-authored-by: Scaleway Bot <github@scaleway.com>
1 parent 504eb02 commit b82ddce

16 files changed

+59
-929
lines changed

cmd/scw/testdata/test-all-usage-jobs-definition-create-usage.golden

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ USAGE:
77

88
ARGS:
99
name=<generated> Name of the job definition
10-
cpu-limit CPU limit of the job
10+
cpu-limit CPU limit of the job (in mvCPU)
1111
memory-limit Memory limit of the job (in MiB)
1212
[local-storage-capacity] Local storage capacity of the job (in MiB)
1313
image-uri Image to use for the job
14-
[command] Startup command. If empty or not defined, the image's default command is used.
14+
[startup-command.{index}] Job startup command. Overrides the default defined in the job image.
15+
[args.{index}] Job arguments. Overrides the default arguments defined in the job image.
1516
[project-id] Project ID to use. If none is passed the default project ID will be used
1617
[environment-variables.{key}] Environment variables of the job
1718
[description] Description of the job
@@ -20,6 +21,9 @@ ARGS:
2021
[cron-schedule.timezone]
2122
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
2223

24+
DEPRECATED ARGS:
25+
[command] Startup command. If empty or not defined, the image's default command is used.
26+
2327
FLAGS:
2428
-h, --help help for create
2529
--list-sub-commands List all subcommands

cmd/scw/testdata/test-all-usage-jobs-definition-start-usage.golden

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Run an existing job definition by its unique identifier. This will create a new job run.
3+
Run an existing job definition using its unique identifier and create a new job run.
44

55
USAGE:
66
scw jobs definition start <job-definition-id ...> [arg=value ...]
77

88
ARGS:
99
job-definition-id UUID of the job definition to start
10-
[command] Contextual startup command for this specific job run
10+
[startup-command.{index}] Contextual startup command for this specific job run.
11+
[args.{index}] Contextual arguments for this specific job run.
1112
[environment-variables.{key}] Contextual environment variables for this specific job run
1213
[replicas] Number of jobs to run
1314
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1415

16+
DEPRECATED ARGS:
17+
[command] Contextual startup command for this specific job run.
18+
1519
FLAGS:
1620
-h, --help help for start
1721
--list-sub-commands List all subcommands

cmd/scw/testdata/test-all-usage-jobs-definition-update-usage.golden

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@ USAGE:
88
ARGS:
99
job-definition-id UUID of the job definition to update
1010
[name] Name of the job definition
11-
[cpu-limit] CPU limit of the job
11+
[cpu-limit] CPU limit of the job (in mvCPU)
1212
[memory-limit] Memory limit of the job (in MiB)
1313
[local-storage-capacity] Local storage capacity of the job (in MiB)
1414
[image-uri] Image to use for the job
15-
[command] Startup command
15+
[startup-command.{index}] Job startup command. Overrides the default defined in the job image.
16+
[args.{index}] Job arguments. Overrides the default arguments defined in the job image.
1617
[environment-variables.{key}] Environment variables of the job
1718
[description] Description of the job
1819
[job-timeout] Timeout of the job in seconds
1920
[cron-schedule.schedule]
2021
[cron-schedule.timezone]
2122
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
2223

24+
DEPRECATED ARGS:
25+
[command] Startup command. If empty or not defined, the image's default command is used.
26+
2327
FLAGS:
2428
-h, --help help for update
2529
--list-sub-commands List all subcommands

cmd/scw/testdata/test-all-usage-jobs-definition-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AVAILABLE COMMANDS:
88
delete Delete an existing job definition by its unique identifier
99
get Get a job definition by its unique identifier
1010
list List all your job definitions with filters
11-
start Run an existing job definition by its unique identifier. This will create a new job run
11+
start Run an existing job definition using its unique identifier and create a new job run
1212
update Update an existing job definition associated with the specified unique identifier
1313

1414
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-run-list-usage.golden

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ ARGS:
99
[order-by] (created_at_asc | created_at_desc)
1010
[job-definition-id]
1111
[project-id]
12-
[state] (unknown_state | queued | scheduled | running | succeeded | failed | canceled | internal_error)
13-
[states.{index}] (unknown_state | queued | scheduled | running | succeeded | failed | canceled | internal_error)
12+
[state] (unknown_state | initialized | validated | queued | running | succeeded | failed | interrupting | interrupted)
13+
[states.{index}] (unknown_state | initialized | validated | queued | running | succeeded | failed | interrupting | interrupted)
14+
[reasons.{index}] (unknown_reason | invalid_request | timeout | cancellation | technical_error | image_not_found | invalid_image | memory_usage_exceeded | storage_usage_exceeded | exited_with_error | secret_disabled | secret_not_found | quota_exceeded)
1415
[organization-id]
1516
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
1617

cmd/scw/testdata/test-all-usage-jobs-run-stop-usage.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Stop a job run by its unique identifier.
3+
Stop a job run using its unique identifier.
44

55
USAGE:
6-
scw jobs run stop <job-run-id ...> [arg=value ...]
6+
scw jobs run stop [arg=value ...]
77

88
ARGS:
99
job-run-id UUID of the job run to stop

cmd/scw/testdata/test-all-usage-jobs-run-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ USAGE:
66
AVAILABLE COMMANDS:
77
get Get a job run by its unique identifier
88
list List all job runs with filters
9-
stop Stop a job run by its unique identifier
9+
stop Stop a job run using its unique identifier
1010
wait Wait for a job run to reach a stable state
1111

1212
FLAGS:

cmd/scw/testdata/test-all-usage-jobs-secret-delete-usage.golden

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ USAGE:
66
scw jobs secret delete [arg=value ...]
77

88
ARGS:
9-
job-definition-id UUID of the job definition
10-
secret-id UUID of the secret reference within the job
11-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
secret-id UUID of the secret reference within the job
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1211

1312
FLAGS:
1413
-h, --help help for delete

cmd/scw/testdata/test-all-usage-jobs-secret-get-usage.golden

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ USAGE:
66
scw jobs secret get [arg=value ...]
77

88
ARGS:
9-
job-definition-id UUID of the job definition
10-
secret-id UUID of the secret reference within the job
11-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
9+
secret-id UUID of the secret reference within the job
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1211

1312
FLAGS:
1413
-h, --help help for get

cmd/scw/testdata/test-all-usage-jobs-secret-update-usage.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ USAGE:
66
scw jobs secret update [arg=value ...]
77

88
ARGS:
9-
job-definition-id UUID of the job definition
109
secret-id UUID of the secret reference within the job
1110
[secret-manager-version] Version of the secret in Secret Manager
1211
[path] Path of the secret to mount inside the job (either `path` or `env_var_name` must be set)

0 commit comments

Comments
 (0)