Creating a new workspace from the dashboard
This procedure describes how to create and edit a new Che 7 devfile using the Dashboard.
-
A running instance of Eclipse Che. To install an instance of Eclipse Che, see Che 'quick-starts'.
To edit the devfile:
-
In the Workspaces window, click the Add Workspace button.
-
In the SELECT STACK list, select one of the default stacks.
-
Click the Create & Proceed Editing button. The Workspaces → Configs page is shown.
-
Change the workspace name and click the Devfile tab.
-
Delete all the components and commands in the devfile to get an empty devfile.
Adding projects to your workspace
-
A running instance of Eclipse Che. To install an instance of Eclipse Che, see Che 'quick-starts'.
-
An existing workspace defined on this instance of Eclipse Che Creating a workspace from user dashboard.
To add a project to your workspace:
-
Click the Projects tab, and then click the Add Project button.
-
Select the type of the project. Choose from: Samples, Blank, Git, GitHub, or Zip.
-
Fill in the required details for the project type that you selected, and click the Add button.
-
To add another project to the workspace, click the Add Project button.
-
After configuring the project for the workspace, check the change in the devfile, which is the configuration file of the workspace, by opening the Devfile tab.
Configuring the workspace and adding tooling
Adding plug-ins
Che 7 plug-ins replace Che 6 installers. The following table lists the Che 7 plug-ins that have replaced Che 6 installers.
| Che 6 installer | Che 7 plug-in |
|---|---|
org.eclipse.che.ws-agent |
Deprecated and not necessary |
org.eclipse.che.terminal |
Deprecated and not necessary anymore- |
org.eclipse.che.exec |
Che machine-exec Service |
org.eclipse.che.ls.java |
Language Support for Java |
-
A running instance of Eclipse Che. To install an instance of Eclipse Che, see Che 'quick-starts'.
-
An existing workspace defined on this instance of Eclipse Che Creating a workspace from user dashboard.
To add plug-ins to your workspace:
Defining the workspace editor
-
A running instance of Eclipse Che. To install an instance of Eclipse Che, see Che 'quick-starts'.
-
An existing workspace defined on this instance of Eclipse Che Creating a workspace from user dashboard.
To define the editor to use with the workspace:
Defining specific container images
To add a new container image:
-
Copy the following section from the devfile into components:
- mountSources: true command: - sleep args: - infinity memoryLimit: 1Gi alias: maven3-jdk11 type: dockerimage endpoints: - name: 8080/tcp port: 8080 volumes: - name: projects containerPath: /projects image: 'maven:3.6.0-jdk-11' -
When using
type: kubernetesortype: openshift, you must:-
Use seperate recipe files.
To use separate recipe files, the paths can be relative or absolute. For example:
... type: kubernetes reference: deploy_k8s.yaml ...... type: openshift reference: deploy_openshift.yaml ... -
Alternatively, add the content as
referenceContent(thereferenceContentfield replaces the Che 6 recipe content).
-
-
Add a Che 6 recipe content to the Che 7 devfile as
referenceContent:-
Click the Containers tab (Workspace → Details → Containers).
-
Copy the Che 6 recipe, and paste it into the separate Che 7 component as a referenceContent.
-
Set the type from the original Che 6 configuration. The following is an example of the resulting file:
type: kubernetes referenceContent: | apiVersion: v1 kind: Pod metadata: name: ws spec: containers: - image: 'rhche/centos_jdk8:latest' name: dev resources: limits: memory: 512Mi
-
-
Copy the required fields from the old workspace (
image,volumes,endpoints). For example:
Table 2. Сhe 6 and Сhe 7 equivalence table Che 6 workspace configuration Che 7 workspace devfile environments['defaultEnv'].machines['target'].serverscomponents[n].endpointsenvironments['defaultEnv'].machines['machineName'].volumescomponents[n].volumesenvironments['defaultEnv'].recipe.typecomponents[n].typeenvironments['defaultEnv'].recipe.contentcomponents[n].image -
Change the
memoryLimitandaliasvariables, if needed. Here, the fieldaliasis used to set a name for the component. It is generated automatically from theimagefield, if not set.image: 'maven:3.6.0-jdk-11' alias: maven3-jdk11 -
Change the
memoryLimitfield to specify theRAMrequired for the component.alias: maven3-jdk11 memoryLimit: 256M -
Open the Devfile tab to see the changes.
-
Repeat the steps to add additional container images.
Adding commands to your workspace
The following is a comparison between workspace configuration commands in Che 6 (Figure 1) and Che 7 (Figure 2):
| Che 6 workspace configuration | Che 7 workspace devfile |
|---|---|
|
|
|
|
To define commands to your workspace, edit the workspace devfile:
-
Add (or replace) the
commandssection with the first command. Change thenameand thecommandfields from the original workspace configuration (see the preceding equivalence table).commands: - name: build actions: - type: exec command: mvn clean install -
Copy the following YAML code into the
commandssection to add a new command. Change thenameand thecommandfields from the original workspace configuration (see the preceding equivalence table).- name: build and run actions: - type: exec command: mvn clean install && java -jar -
Optionally, add the
componentfield intoactions. This indicates the component alias where the command will be performed. -
Repeat step 2 to add more commands to the devfile.
-
Click the Devfile tab to view the changes.
-
Save changes and start the new Che 7 workspace.









