diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index af40cc5a78..9a2d3df0b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ Repository | Component | Description | Devfile | Contributing.md ---| [wsmaster](https://github.com/eclipse/che/tree/master/wsmaster) | orchestrates the Che workspaces with devfiles on Kubernetes | [devfile ](https://github.com/eclipse/che/blob/master/devfile.yaml) | [doc](https://github.com/eclipse/che/blob/master/CONTRIBUTING.md#che-server-aka-ws-master) --- | [dockerfiles](https://github.com/eclipse/che/tree/master/dockerfiles) | source code, dockerfiles to build our main docker images. Note that Che-theia related dockerfiles are located in che-theia repo. | | --- | [e2e](https://github.com/eclipse/che/tree/master/e2e) | source code of our integration tests. | | -[workspace-loader](https://github.com/eclipse/che-workspace-loader) | | | [devfile](https://github.com/eclipse/che-workspace-loader/blob/master/devfile.yaml) | [doc](https://github.com/eclipse/che/blob/master/CONTRIBUTING.md#workspace-loader) +[workspace-loader](https://github.com/eclipse/che-workspace-loader) | | | [devfile](https://github.com/eclipse/che-workspace-loader/blob/master/devfile.yaml) | [doc](https://github.com/eclipse/che-workspace-loader/blob/master/CONTRIBUTING.md) [dashboard](https://github.com/eclipse/che-dashboard) | | UI to manage workspaces, devfiles, etc. | [devfile](https://github.com/eclipse/che-dashboard/blob/master/devfile.yaml) | [doc](https://github.com/eclipse/che/blob/master/CONTRIBUTING.md#dashboard) [chectl](https://github.com/che-incubator/chectl) | | The CLI to install Che, create and start workspaces and devfiles | [devfile](https://github.com/che-incubator/chectl/blob/master/devfile.yaml) | [doc](https://github.com/che-incubator/chectl/blob/master/CONTRIBUTING.md) [che-theia](https://github.com/eclipse/che-theia) | | Theia IDE integrated in Che. | [devfile](https://github.com/eclipse/che-theia/blob/master/devfiles/che-theia-all.devfile.yaml) | [doc](https://github.com/eclipse/che-theia/blob/master/CONTRIBUTING.md) @@ -125,114 +125,6 @@ You can use the Che command `dashboard_dev_server` (command pallette > Run task $ node_modules/.bin/gulp serve --server= ``` -### Workspace Loader - -Workspace loader source code is located in [https://github.com/eclipse/che-workspace-loader](https://github.com/eclipse/che-workspace-loader) repository. -Here is the developer workflow if you want to contribute to it: - -#### Devfile for workspace loader development - -The devfile: [https://github.com/eclipse/che-workspace-loader/blob/master/devfile.yaml](https://github.com/eclipse/che-workspace-loader/blob/master/devfile.yaml) - -This section shows you how to setup a Che environment to work on the Che Workspace Loader, and how to use it. -For the whole workflows, we will need a workspace with Workspace Loader Dev container (a.k.a ws-loader-dev). Dev container is all in one container for running commands such as build, test or start the workspace loader server. - -Developer workflow: - -#### Step 1: Start the workspace with the workspace-loader devfile - -In this section we are going to start a new workspace to work on workspace loader. The new workspace will clone the `Eclipse Che` project. Containers and commands could be found in the `My workspace` view. We will use these commands in the next steps. - -The workspace could be created and started from a devfile using `chectl`: - -```bash -$ chectl workspace:start --devfile=https://raw.githubusercontent.com/eclipse/che-workspace-loader/master/devfile.yaml -``` - -or as a factory `https:///f?url=https://raw.githubusercontent.com/eclipse/che-workspace-loader/master/devfile.yaml - -#### Step 2: Install workspace-loader dependencies - -Use the command `[workspace loader] install dependencies` - -or - -```bash -# [ws-loader-dev] -$ yarn -``` - -#### Step 3: Code workspace-loader - -Now you can make changes in Workspace Loader - -#### Step 4: Build workspace-loader - -Use the command `[workspace loader] run build` - -or - -```bash -# [ws-loader-dev] -$ yarn build -``` - -#### Step 5: Run workspace-loader unit tests (optional) - -Use the command `[workspace loader] run tests` - -or - -```bash -# [ws-loader-dev] -$ yarn test -``` - -#### Step 6: Start workspace loader server - -Use the command `[workspace loader] start dev server` - -or - -```bash -# [ws-loader-dev] -$ yarn start --disable-host-check --public=$(echo ${server.dev-server} | sed -e s/https:\\/\\/// -e s/http:\\/\\/// -e s/\\///) --host="0.0.0.0" --env.target=${CHE_API_EXTERNAL%????} -``` - -#### Step 7: Testing new workspace loader - -When workspace loader server is run, one probably need to test introduced changes. - -To safely test the changes it is better to create a separate workspace which will be used by new loader. -But by default, Che doesn't allow to run more than one workspace simultaneously. -To change this behaviour one need to set `che.limits.user.workspaces.run.count` Che property to value greater than `1`. -In development environment that could be reached by adding `CHE_LIMITS_USER_WORKSPACES_RUN_COUNT` environment variable for Che server deployment. -Please note, after changing deployment config one need to apply changes by rolling out (or rescaling) the corresponding pod -(in case of Openshift just add the environment variable via Openshift dashboard in the `Environment` tab of the Che server deployment and the pod will be rolled out automatically). - -To be able to point new workspace loader to the test workspace it is required to add the the test workspace id to the path of workspace loader route. -So, first, we need to retrieve the test workspace id. -This could be done using swagger (please note, it might be disabled on production environment). -To open swagger just open Che dashboard and replace the path with `swagger`. -Then navigate to `workspace` section `GET /workspace` method. -It will return all user workspaces. -Find the test workspace id. -Second, to modify the path of the workspace loader server uri, retrieve the route of the server. -To do it, find workspace loader dev workspace id from the query in swagger above and use it as a key in `GET /workspace/{key}` method. -From the response get the workspace loader server url -(if using the given defile for workspace loader development it should be under `runtime.machines.ws-loader-dev.serevrs.dev-server.url` key). - -The uri of workspace loader pointed to the test workspace should look like: `/`. -For example: `http://server60zomi2d-dev-server-3000.192.168.99.100.nip.io/workspaceztcx9u432labmvxi` or `http://routeu5efcg53-che.apps-crc.testing/workspaceztcx9u432labmvxi` (depending on the infrastructure on which Che is run). - -In most cases multiuser Che is deployed. -To permit all the required connections one need to edit Keycloak settings. -Open keycloak dashboard (the route could be obtained via Kubernetes or Openshift dashboard) and navigate to `Clients`, select `che-public` and `Settings` tab. -Then add the route with `/*` suffix into `Valid Redirect URIs` section and the original route without trailing slash into `Web Origins` section. -Save changes. - -After this opening the obtained uri will open new workspace loader which will start (if not started yet) and open the test workspace. - ### Che server a.k.a WS master There is a [devfile](https://github.com/eclipse/che/blob/master/devfile.yaml) for development of Che server in Che. To build Che one may run a predefined build task from the devfile.