You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/serverless-jobs/concepts.mdx
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,26 +10,9 @@ import ServerlessConcepts from '@macros/serverless/serverless-concepts.mdx'
10
10
11
11
## Commands and arguments
12
12
13
-
Serverless Jobs allows you to customize the `command` and `args` instructions of your container image directly from the [Scaleway console](https://console.scaleway.com) and via the [Scaleway API](https://www.scaleway.com/en/developers/api/serverless-jobs/).
13
+
Field `command` is deprecated prior `startup_command` in `v1alpha2`.
14
14
15
-
<Messagetype="note">
16
-
If `startup_command` is already filled then the `command` instruction is ignored.
17
-
</Message>
18
-
19
-
- The `command` instruction defines the command, process, or script executed when your job starts.
20
-
- The `args` instruction defines the arguments passed to the `command` instruction. Arguments can be passed as environment variables, as shown in the example below.
21
-
22
-
**Example**
23
-
24
-
```yaml
25
-
env:
26
-
- name: MESSAGE
27
-
value: "hello world"
28
-
command: ["/bin/echo"]
29
-
args: ["$(MESSAGE)"]
30
-
```
31
-
32
-
Refer to the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/) for more information on commands and arguments behavior.
15
+
For more details see [startup command and arguments](/serverless-jobs/concepts/#startup-commands-and-arguments) and [v1alpha2 migration guide](/serverless-jobs/reference-content/v1alpha1-to-v1alpha2/).
33
16
34
17
## Container Registry
35
18
@@ -91,9 +74,30 @@ For more details about advantages of using Serverless, [read the Serverless over
91
74
92
75
A secret reference is a mechanism that allows you to use a secret stored in [Secret Manager](/secret-manager/) within Serverless Jobs. It allows you to securely reference sensitive data, such as API secret keys, passwords, tokens, or certificates.
93
76
94
-
## Startup command
77
+
## Startup commands and arguments
78
+
79
+
Serverless Jobs allows you to customize the `startup_command` and `args` instructions to override default image instructions.
95
80
96
-
Deprecated and replaced by [Commands and arguments](#commands-and-arguments).
81
+
<Messagetype="note">
82
+
*`command` field is deprecated prior `startup_command`.
83
+
* If `startup_command` is already filled then the `command` instruction is ignored.
84
+
*`startup_command` and `args` can interpret environment variables, allowing for easier automations.
85
+
</Message>
86
+
87
+
- The `startup_command` instruction defines the command, process, or script executed when your job starts. It overrides the `ENTRYPOINT` of the image.
88
+
- The `args` instruction defines the arguments passed to the `startup_command` instruction. Arguments can be passed as environment variables, as shown in the example below.
89
+
90
+
**Example**
91
+
92
+
```yaml
93
+
env:
94
+
- name: MESSAGE
95
+
value: "hello world"
96
+
startup_command: ["/bin/echo"]
97
+
args: ["$(MESSAGE)"]
98
+
```
99
+
100
+
Refer to the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/) for more information on commands and arguments behavior.
The Serverless Jobs `v1alpha2` API introduces a new startup execution mechanism based on [commands and arguments](/serverless-containers/concepts/#commands-and-arguments), replacing the legacy startup command.
12
+
The Serverless Jobs `v1alpha2` API introduces a new startup execution mechanism based on [commands and arguments](/serverless-containers/concepts/#startup-command-and-arguments), replacing the legacy `command`.
13
13
14
14
The Scaleway console allows you to quickly and easily migrate your existing jobs to the new system.
15
15
16
+
Migration from `command` field to `startup_command` field is mostly transparent for customers using Scaleway Console but can require some attention of API, CLI and other devtools users.
17
+
18
+
The change allows for:
19
+
- More customisation for executing complex command, by separating `startup_command` and `args`.
20
+
- To match our underlying [Kubernetes implementation](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/).
21
+
- It allows to compute environment variables used in command and argument strings.
22
+
-`startup_command` is now an array of commands instead of a single string.
23
+
16
24
<Requirements />
17
25
18
26
- A Scaleway account logged into the [console](https://console.scaleway.com)
19
27
-[Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
20
28
- An existing job that uses a startup command
21
29
22
-
## How to migrate from startup command to commands and arguments
30
+
## How to migrate from command to startup commands and arguments
23
31
24
32
1. Click **Jobs** in the **Serverless** section of the side menu. The jobs page displays.
25
33
@@ -39,7 +47,7 @@ Your Serverless Job now uses the command and arguments mechanism.
39
47
40
48
### Simple command
41
49
42
-
**Legacy startup command**
50
+
**Legacy command**
43
51
44
52
```bash
45
53
sleep 60s
@@ -48,13 +56,13 @@ sleep 60s
48
56
**Corresponding command and arguments**
49
57
50
58
```yaml
51
-
command: [sleep]
59
+
startup_command: [sleep]
52
60
args: [60s]
53
61
```
54
62
55
63
### Complex command
56
64
57
-
**Legacy startup command**
65
+
**Legacy command**
58
66
59
67
```bash
60
68
/app/migrate up --database "$DB_URL" --password "$DB_PASSWORD" --port 3002
Refer to the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/) for more information on command and arguments behavior and syntax.
0 commit comments