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: docs/modules/user-guide/partials/proc_adding-a-name-to-a-devfile.adoc
+6-12
Original file line number
Diff line number
Diff line change
@@ -10,39 +10,33 @@ Adding a name to a devfile is mandatory. Both `name` and `generateName` are opti
10
10
11
11
.Procedure
12
12
13
-
. To specify a static name for the workspace, define the `name` attribute.
13
+
. To specify a static name for the workspace, define the `name` attribute.
14
14
+
15
15
.Adding a static name to a devfile
16
-
====
16
+
17
17
[source,yaml]
18
18
----
19
19
schemaVersion: 2.0.0
20
20
metadata:
21
21
name: devfile-sample
22
22
----
23
-
====
24
23
25
-
. To specify a prefix for automatically generated workspace names, define the `generateName` attribute and don't define the `name` attribute. The workspace name will be in the `<generateName>YYYYY` format (for example, `che-2y7kp`). `Y` is random `[a-z0-9]` character.
24
+
. To specify a prefix for automatically generated workspace names, define the `generateName` attribute and don't define the `name` attribute. The workspace name will be in the `<generateName>YYYYY` format (for example, `devfile-sample-2y7kp`). `Y` is random `[a-z0-9]` character.
26
25
+
27
26
.Adding a generated name to a devfile
28
-
====
27
+
29
28
[source,yaml]
30
29
----
31
30
schemaVersion: 2.0.0
32
31
metadata:
33
-
generateName: che-
32
+
generateName: devfile-sample-
34
33
----
35
-
====
36
-
37
34
38
35
[NOTE]
39
-
====
40
-
For workspaces created using a factory, defining `name` or `generateName` has the same effect. The defined value is used as the name prefix: `<name>YYYYY` or `<generateName>YYYYY`. When both `generateName` and `name` are defined, `generateName` takes precedence.
41
-
====
42
36
37
+
For workspaces created using a factory, defining `name` or `generateName` has the same effect. The defined value is used as the name prefix: `<name>YYYYY` or `<generateName>YYYYY`. When both `generateName` and `name` are defined, `generateName` takes precedence.
* Any component on which commands are executed must define a `name` attribute. This name is used to reference the component in the command definition. Example: `name: go-cli` in the component definition and `component: go-cli` in the command definition. This ensures that {che-prod} can find the correct container to run the command in.
71
+
72
+
* Any component on which commands are executed must define a `name` attribute. This name is used to reference the component in the command definition. Example: `name: go-cli` in the component definition and `component: go-cli` in the command definition.
77
73
78
74
* A command can have only one action, though you can use `composite` commands to execute several commands either sequentially or in parallel.
79
-
====
80
75
81
76
. Define attributes for the `vscode-task` or `vscode-launch` command to run using the Editor.
82
77
+
83
-
If the editor in the workspace supports it, the devfile can specify additional configuration in the editor-specific format. This is dependent on the integration code present in the workspace editor itself and so is not a generic mechanism. However, the default Che-Theia editor within {che-prod} is equipped to understand the `tasks.json` and `launch.json` files provided in the devfile.
78
+
If the editor in the workspace supports it, the devfile can specify additional configuration in the editor-specific format. This is dependent on the integration code present in the workspace editor itself and so is not a generic mechanism.
84
79
+
85
-
====
86
80
[source,yaml]
87
81
----
88
82
schemaVersion: 2.0.0
@@ -111,14 +105,12 @@ commands:
111
105
}
112
106
----
113
107
114
-
This example shows association of a `tasks.json` file with a devfile. Notice the `vscode-task` type that instructs the Che-Theia editor to interpret this command as a tasks definition and `referenceContent` attribute that contains the contents of the file itself. You can also save this file separately from the devfile and use `reference` attribute to specify a relative or absolute URL to it.
115
-
====
108
+
This example shows association of a `tasks.json` file with a devfile. Notice the `vscode-task` type that instructs the editor to interpret this command as a tasks definition and `referenceContent` attribute that contains the contents of the file itself. You can also save this file separately from the devfile and use `reference` attribute to specify a relative or absolute URL to it.
116
109
117
110
. Command group
118
111
+
119
112
A given command can be assigned to one or more groups that represents the nature of the command. The support groups are: `build`, `run`, `test` and `debug`. For each of the groups, one default command can be defined in each group by specifying the `isDefault` value.
120
113
+
121
-
====
122
114
[source,yaml]
123
115
----
124
116
schemaVersion: 2.0.0
@@ -140,24 +132,22 @@ commands:
140
132
- id: package
141
133
exec:
142
134
component: maven
143
-
commandLine: “mvn package”
135
+
commandLine: "mvn package"
144
136
group:
145
137
kind: build
146
138
- id: install
147
139
exec:
148
140
component: maven
149
-
commandLine: “mvn install”
141
+
commandLine: "mvn install"
150
142
group:
151
143
kind: build
152
144
isDefault: true
153
145
----
154
-
====
155
146
156
147
. Composite command
157
148
+
158
149
A composite command can be defined to chain multiple commands together. The individual commands that are called from a composite command can be referenced by the `name` of the command. A `parallel` boolean can be specified to determine if the commands within a composite command are being executed sequentially or in parallel.
159
150
+
160
-
====
161
151
[source,yaml]
162
152
----
163
153
schemaVersion: 2.0.0
@@ -179,13 +169,13 @@ commands:
179
169
- id: package
180
170
exec:
181
171
component: maven
182
-
commandLine: “mvn package”
172
+
commandLine: "mvn package"
183
173
group:
184
174
kind: build
185
175
- id: install
186
176
exec:
187
177
component: maven
188
-
commandLine: “mvn install”
178
+
commandLine: "mvn install"
189
179
group:
190
180
kind: build
191
181
isDefault: true
@@ -196,13 +186,11 @@ commands:
196
186
- package
197
187
parallel: false
198
188
----
199
-
====
200
189
201
190
. Command preview URL
202
191
+
203
192
It is possible to specify a preview URL for commands that expose web UI. This URL is offered for opening when the command is executed.
204
193
+
205
-
====
206
194
[source,yaml]
207
195
----
208
196
commands:
@@ -213,14 +201,12 @@ commands:
213
201
path: /myweb <2>
214
202
component: go-cli
215
203
commandLine: "go run webserver.go"
216
-
workingDir: ${CHE_PROJECTS_ROOT}/webserver
204
+
workingDir: ${PROJECTS_ROOT}/webserver
217
205
----
218
206
<1> TCP port where the application listens. Mandatory parameter.
219
207
<2> The path part of the URL to the UI. Optional parameter. The default is root (`/`).
220
208
221
209
The example above opens `++http://__<server-domain>__/myweb++`, where `_<server-domain>_` is the URL to the dynamically created Kubernetes Ingress or OpenShift Route.
Copy file name to clipboardExpand all lines: docs/modules/user-guide/partials/proc_adding-container-component-to-a-devfile.adoc
+1-7
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,6 @@ A component type that allows to define a container image-based configuration of
15
15
. Define a component using the type `container`.
16
16
+
17
17
.A `container` component
18
-
====
19
18
[source,yaml]
20
19
----
21
20
components:
@@ -41,10 +40,8 @@ A component type that allows to define a container image-based configuration of
41
40
command: ['tail']
42
41
args: ['-f', '/dev/null']
43
42
----
44
-
====
45
43
+
46
44
.A minimal `container` component*
47
-
====
48
45
[source,yaml]
49
46
----
50
47
schemaVersion: 2.0.0
@@ -57,7 +54,6 @@ components:
57
54
memoryLimit: 512Mi
58
55
command: ['sleep', 'infinity']
59
56
----
60
-
====
61
57
+
62
58
It specifies the type of the component, `container` and the `image` attribute names the image to be used for the component using the usual Docker naming conventions, that is, the above `image` attribute is equal to `docker.io/library/golang:latest`.
63
59
+
@@ -67,7 +63,6 @@ A `container` component has many features that enable augmenting the image with
67
63
+
68
64
For the `container` component to have access to the project sources, you must set the `mountSources` attribute to `true`.
69
65
+
70
-
====
71
66
[source,yaml]
72
67
----
73
68
schemaVersion: 2.0.0
@@ -81,9 +76,8 @@ components:
81
76
mountSources: true
82
77
command: ['sleep', 'infinity']
83
78
----
84
-
====
85
79
+
86
-
The sources is mounted on a location stored in the `CHE_PROJECTS_ROOT` environment variable that is made available in the running container of the image. This location defaults to `/projects`. If `sourceMapping` is defined in the container, it overrides the 'CHE_PROJECT_ROOT' value if present and mounts the source to the path defined by `sourceMapping`.
80
+
The sources is mounted on a location stored in the `PROJECTS_ROOT` environment variable that is made available in the running container of the image. This location defaults to `/projects`. If `sourceMapping` is defined in the container, it overrides the 'PROJECT_ROOT' value if present and mounts the source to the path defined by `sourceMapping`.
Copy file name to clipboardExpand all lines: docs/modules/user-guide/partials/proc_limiting-resources-usage.adoc
+11-12
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ To specify a container(s) memory limit for `container`, `plugin`, use the `memor
17
17
components:
18
18
- name: exec-plugin
19
19
plugin:
20
-
id: eclipse/che-machine-exec-plugin/0.0.1
20
+
id: eclipse/machine-exec-plugin/0.0.1
21
21
memoryLimit: 1Gi
22
22
- name: maven
23
23
container:
@@ -30,8 +30,6 @@ This limit will be applied to every container of the given component.
30
30
+
31
31
For `plugin` components, RAM limits can be described in the plug-in descriptor file, typically named `meta.yaml`.
32
32
+
33
-
If none of them are specified, system-wide defaults will be applied (see description of `pass:[CHE_WORKSPACE_SIDECAR_DEFAULT__MEMORY__LIMIT__MB]` system property).
34
-
35
33
36
34
. Specify container memory request for components
37
35
+
@@ -44,7 +42,7 @@ To specify a container(s) memory request for `plugin` use the `memoryRequest` pa
44
42
components:
45
43
- name: exec-plugin
46
44
plugin:
47
-
id: eclipse/che-machine-exec-plugin/0.0.1
45
+
id: eclipse/machine-exec-plugin/0.0.1
48
46
memoryLimit: 1Gi
49
47
memoryRequest: 512M
50
48
- name: maven
@@ -59,8 +57,8 @@ This limit will be applied to every container of the given component.
59
57
+
60
58
For `plugin` components, RAM requests can be described in the plug-in descriptor file, typically named `meta.yaml`.
61
59
+
62
-
If none of them are specified, system-wide defaults are applied (see description of `pass:[CHE_WORKSPACE_SIDECAR_DEFAULT__MEMORY__REQUEST__MB]` system property).
63
-
60
+
If they are not specified, the values are undetermined: they may or may not be inferred from the application that consumes the devfile or from Kubernetes.
61
+
+
64
62
65
63
. Specify container CPU limit for components
66
64
+
@@ -73,7 +71,7 @@ To specify a container(s) CPU limit for `plugin` or `container` use the `cpuLimi
73
71
components:
74
72
- name: exec-plugin
75
73
plugin:
76
-
id: eclipse/che-machine-exec-plugin/0.0.1
74
+
id: eclipse/machine-exec-plugin/0.0.1
77
75
cpuLimit: 1.5
78
76
- name: maven
79
77
container:
@@ -86,8 +84,8 @@ This limit will be applied to every container of the given component.
86
84
+
87
85
For the `plugin` components, CPU limits can be described in the plug-in descriptor file, typically named `meta.yaml`.
88
86
+
89
-
If none of them are specified, system-wide defaults are applied (see description of `pass:[CHE_WORKSPACE_SIDECAR_DEFAULT__CPU__LIMIT__CORES]` system property).
90
-
87
+
If they are not specified, the values are undetermined: they may or may not be inferred from the application that consumes the devfile or from Kubernetes.
88
+
+
91
89
92
90
. Specify container CPU request for components
93
91
+
@@ -100,7 +98,7 @@ To specify a container(s) CPU request for `plugin` or `container` use the `cpuRe
100
98
components:
101
99
- name: exec-plugin
102
100
plugin:
103
-
id: eclipse/che-machine-exec-plugin/0.0.1
101
+
id: eclipse/machine-exec-plugin/0.0.1
104
102
cpuLimit: 1.5
105
103
cpuRequest: 0.225
106
104
- name: maven
@@ -113,6 +111,7 @@ To specify a container(s) CPU request for `plugin` or `container` use the `cpuRe
113
111
+
114
112
This limit will be applied to every container of the given component.
115
113
+
116
-
For the `pugin` component type, CPU requests can be described in the plug-in descriptor file, typically named `meta.yaml`.
114
+
For the `plugin` component type, CPU requests can be described in the plug-in descriptor file, typically named `meta.yaml`.
115
+
+
116
+
If they are not specified, the values are undetermined: they may or may not be inferred from the application that consumes the devfile or from Kubernetes.
117
117
+
118
-
If none of them are specified, system-wide defaults are applied (see description of `pass:[CHE_WORKSPACE_SIDECAR_DEFAULT__CPU__REQUEST__CORES]` system property).
0 commit comments