Skip to content

Commit

Permalink
enhancement: a workspace example in snip (#2134)
Browse files Browse the repository at this point in the history
* a workspace example in snip

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* update

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* update

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* update

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* update

Signed-off-by: Michal Maléř <mmaler@redhat.com>

* update

Signed-off-by: Michal Maléř <mmaler@redhat.com>
  • Loading branch information
MichalMaler authored Oct 14, 2021
1 parent 208dfee commit c1b625b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[source,yaml]
----
apiVersion: 1.0.0
metadata:
generateName: nodejs-web-app-
projects:
-
name: react-web-app
source:
type: git
location: "https://github.com/che-samples/react-web-app"
components:
-
type: chePlugin
id: vscode/typescript-language-features/latest
-
type: dockerimage
alias: nodejs
image: quay.io/eclipse/che-nodejs12-community:ce0526f
endpoints:
- name: 'nodejs'
port: 3000
mountSources: true
----
40 changes: 14 additions & 26 deletions modules/administration-guide/partials/con_a-workspace-example.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,11 @@ This section describes a {prod-short} workspace example.

The following devfile defines the {prod-short} workspace:

[source,yaml]
----
apiVersion: 1.0.0
metadata:
generateName: guestbook-nodejs-sample-
projects:
- name: guestbook-nodejs-sample
source:
type: git
location: "https://github.com/l0rd/nodejs-sample"
components:
- type: chePlugin
id: che-incubator/typescript/latest
- type: kubernetes
alias: guestbook-frontend
reference: https://raw.githubusercontent.com/l0rd/nodejs-sample/master/kubernetes-manifests/guestbook-frontend.deployment.yaml
mountSources: true
entrypoints:
- command: ['sleep']
args: ['infinity']
----
include::example$snip_a-{project-context}-workspace-example.adoc[]

pass:[<!-- vale Vale.Spelling = NO -->]

pass:[<!-- vale Vale.Terms = NO -->]

This table provides the memory requirements for each workspace component:

Expand All @@ -47,15 +31,15 @@ This table provides the memory requirements for each workspace component:
|Workspace
|machine-exec (default `chePlugin`)
|128 MiB
|128 MiB
|32 MiB

|Workspace
|vscode-typescript (`chePlugin`)
|512 MiB
|512 MiB

|Workspace
|frontend (`kubernetes`)
|nodejs (`dockerimage`)
|1 GiB
|512 MiB

Expand All @@ -66,14 +50,18 @@ This table provides the memory requirements for each workspace component:

2+>s|Total
>s|2.25 GiB
>s|1.75 GiB
>s|1.38 GiB
|===

pass:[<!-- vale Vale.Spelling = YES -->]

pass:[<!-- vale Vale.Terms = YES -->]

* The `theia-ide` and `machine-exec` components are implicitly added to the workspace, even when not included in the devfile.
* The resources required by `machine-exec` are the default for `chePlugin`.
* The resources for `theia-ide` are specifically set in the `cheEditor` `meta.yaml` to *512 MiB* as `memoryLimit`.
* The Typescript VS Code extension has also overridden the default memory limits. In its `meta.yaml` file, the limits are explicitly specified to *512 MiB*.
* {prod-short} is applying the defaults for the `kubernetes` component type: a memory limit of *1 GiB* and a memory request of *512 MiB*. This is because the `kubernetes` component references a `Deployment` manifest that has a container specification with no resource limits or requests.
* {prod-short} is applying the defaults for the dockerimage component type: a memory limit of *1 GiB* and a memory request of *512 MiB*.
* The JWT container requires *128 MiB* of memory.

Adding all together results in *1.75 GiB* of memory requests with a *2.25 GiB* limit.
Adding all together results in *1.38 GiB* of memory requests with a *2.25 GiB* limit.

0 comments on commit c1b625b

Please sign in to comment.