This section describes how to manually convert an old Che 6 workspace configuration to a Che 7 devfile. The following are the benefits of using a Che 7 devfile:
-
Using a portable file that works with any installation of Che; nothing needs to be changed on the server to start a workspace.
-
Configuration can be stored in project repository and automatically used by Che to start a workspace. To start a workspace, specify a devfile using the following format:
<che-instance-domain>/f?url=path, for example:
https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/vertx/devfile.yaml
This creates and starts a new workspace based on the devfile defined in the URL attribute. * A human-readable YAML format for all content.
Below, there is a comparison of a Che 6 workspace configuration and a Che 7 devfile. Both are Java Vert.x stacks with a default project and default settings:
{
"defaultEnv": "default",
"environments": {
"default": {
"machines": {
"dev-machine": {
"attributes": {
"memoryLimitBytes": "2147483648"
},
"servers": {
"8080/tcp": {
"attributes": {},
"port": "8080",
"protocol": "http"
}
},
"volumes": {},
"installers": [
"com.redhat.oc-login",
"com.redhat.bayesian.lsp",
"org.eclipse.che.ls.java",
"org.eclipse.che.ws-agent",
"org.eclipse.che.exec",
"org.eclipse.che.terminal"
],
"env": {}
}
},
"recipe": {
"type": "dockerimage",
"content": "quay.io/openshiftio/che-vertx"
}
}
},
"projects": [
{
"links": [],
"name": "vertx-http-booster",
"attributes": {
"language": [
"java"
]
},
"type": "maven",
"source": {
"location": "https://github.com/openshiftio-vertx-boosters/vertx-http-booster",
"type": "git",
"parameters": {}
},
"path": "/vertx-http-booster",
"description": "HTTP Vert.x Booster",
"problems": [],
"mixins": []
}
],
"name": "wksp-jhwp",
"commands": [
{
"commandLine": "scl enable rh-maven33 'mvn compile vertx:debug -f ${current.project.path} -Dvertx.disableDnsResolver=true'",
"name": "debug",
"attributes": {
"goal": "Debug",
"previewUrl": "${server.8080/tcp}"
},
"type": "custom"
},
{
"commandLine": "scl enable rh-maven33 'mvn compile vertx:run -f ${current.project.path} -Dvertx.disableDnsResolver=true'",
"name": "run",
"attributes": {
"goal": "Run",
"previewUrl": "${server.8080/tcp}"
},
"type": "custom"
},
{
"commandLine": "scl enable rh-maven33 'mvn clean install -f ${current.project.path}'",
"name": "build",
"attributes": {
"goal": "Build",
"previewUrl": ""
},
"type": "mvn"
},
{
"commandLine": "mvn -Duser.home=${HOME} -f ${CHE_PROJECTS_ROOT}/vertx-http-booster clean package",
"name": "vertx-http-booster:build",
"attributes": {
"goal": "Build",
"previewUrl": ""
},
"type": "mvn"
},
{
"commandLine": "mvn -Duser.home=${HOME} -f ${CHE_PROJECTS_ROOT}/vertx-http-booster vertx:run",
"name": "vertx-http-booster:run",
"attributes": {
"goal": "Run",
"previewUrl": "${server.8080/tcp}"
},
"type": "mvn"
}
],
"links": []
}
metadata:
name: testing-workspace
projects:
- name: java-web-vertx
source:
location: 'https://github.com/che-samples/web-java-vertx'
type: git
components:
- id: redhat/java/latest
type: chePlugin
- mountSources: true
endpoints:
- name: 8080/tcp
port: 8080
memoryLimit: 512Mi
type: dockerimage
volumes:
- name: m2
containerPath: /home/user/.m2
alias: maven
image: 'quay.io/eclipse/che-java8-maven:nightly'
apiVersion: 1.0.0
commands:
- name: maven build
actions:
- workdir: '${CHE_PROJECTS_ROOT}/java-web-vertx'
type: exec
command: 'mvn -Duser.home=${HOME} clean install'
component: maven
- name: run app
actions:
- workdir: '${CHE_PROJECTS_ROOT}/java-web-vertx'
type: exec
command: >
JDBC_URL=jdbc:h2:/tmp/db \
java -jar -Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \
./target/*fat.jar
component: maven
- name: Debug remote java application
actions:
- referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach) - Remote",
"request": "attach",
"hostName": "localhost",
"port": 5005
}]
}
type: vscode-launch
Converting a Che 6 workspace to a basic Che 7 devfile
This section describes how to convert a Che 6 workspace to a Che 7 devfile. The result is a basic Che 7 devfile that can be used for further workspace creation.
-
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 convert a Che 6 workspace to a Che 7 devfile:
-
Open an old Che 6 configuration file to identify which Che 6 stack is used in the workspace. Below, there is a detailed guide for Accessing a Che 6 workspace configuration.
-
Create a new workspace from the Che 7 devfile that corresponds to the Che 6 stack.
Table 1. Che 7 devfile corresponding to the respective Che 6 stacks. Che 6 stacks Che 7 devfile Apache Camel based projects,
Apache Camel based projects on Che 7Apache Camel based on Spring Boot
.NET,
.NET Core with Theia IDE.NET Core
Go,
CentOS Go,
Go with Theia IDEGo
Java Gradle
Java Gradle
Blank,
Java,
Java-MySQL,
Eclipse Che,
Java CentOSJava Maven
Node,
CentOS nodejsNodeJS Express Web Application
Python,
Python with Theia IDEPython
Eclipse Vert.x
Java Vert.x
PHP
PHP Simple
Spring Boot
Java Spring Boot
-
By default, the example project is added to the workspace. To remove the default project, click the Remove button:
-
To import a custom project that was used in Che 6 workspace, click the Add or Import Project and select Git or GitHub option:
-
Various commands can be added to devfiles of imported projects, for example,
run,build, andtest. The commands are then accessible from the IDE when a workspace is started. Custom commands and other devfile components can be added in the Devfile configuration. -
Click the Create & Proceed Editing button.
Select the Devfile tab to update the configuration. Machine servers in Che 6 workspaces can be specified as components endpoints in a Devfile and Che 6 installers as components of type chePlugin. See the Devfile specification for the detailed information about the supported properties and attributes.
-
Once the Devfile configuration is completed, click the Open button to start a newly created Che 7 workspace.
-
Accessing a Che 6 workspace configuration
Che 6 workspace configuration is not supported in Che 7 but can be accessed for further conversion to a devfile.
-
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 access the Che 6 workspace configuration:
-
In the Dashboard, click the Workspaces menu to open the workspaces list and locate the workspace to migrate to Che 7.
-
In the Actions column, click the Configure workspace icon. The raw workspace configuration is available under the Config tab.



