Commit Graph

212 Commits (f2ee3bf834bab3d4f4e0bd1f6b73aef8063dba34)

Author SHA1 Message Date
Florent BENOIT f2ee3bf834 Allow to use Java9 method to get pid (avoid internal reflection)
Change-Id: I50b05b86d53d21b6b8006a78c8aca722ce2372f2
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-10-24 15:49:02 +02:00
Sergii Kabashniuk 487ad8508c Merge with master 2017-10-21 19:30:48 +03:00
Florent BENOIT 3f262e620e Cleanup some Mockito deprecated usage (che6) (#6864)
* Cleanup some Mockito deprecated usage
org.mockito.Matchers —> org.mockito.ArgumentMatchers
org.mockito.runners.MockitoJUnitRunner —> org.mockito.junit.MockitoJUnitRunner

Change-Id: Icf7351cb58e0f42fa95885c2d2cf6b5e98206c35
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-10-21 09:07:43 +02:00
Florent BENOIT 9bb0aa445f Cleanup some Mockito deprecated usage (#6863)
* Cleanup some Mockito deprecated usage
org.mockito.Matchers —> org.mockito.ArgumentMatchers
org.mockito.runners.MockitoJUnitRunner —> org.mockito.junit.MockitoJUnitRunner

Change-Id: Icc1ee9b4ec16e35cab09842057a275a0133571b4
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-10-21 08:10:33 +02:00
Florent BENOIT 6a95b6d74a Apply google format v1.4 https://github.com/google/google-java-format/releases/tag/google-java-format-1.4
Change-Id: I5df30c23165df1fd39eef4c57893bebd1d681c1d
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-10-19 22:23:04 +02:00
Florent BENOIT c2c1c19e42 Apply google format v1.4 https://github.com/google/google-java-format/releases/tag/google-java-format-1.4
Change-Id: I11c453a67608810638f8e8e9cf4705ec93b2320c
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-10-19 22:07:40 +02:00
David Festal 8871b5b08a Multi-tenant compatibility (#6738)
* Ping the wsagent URL (possibly external), not the *internal URL*.

* Use `getProperties().getInternalUrl()` when `getUrl()` returns `null` 

* Add a new provider for an optional routing suffix for workspaces to be
used in the external URLs of created workspace agents in the
use-cases where a custom server evaluation strategy is used (Openshift,
Traeffik, etc ...).

* Add 2 new macros for the custom server evaluation template which are:
    - `user`: the current environment context user if any,
    - `workspacesRoutingSuffix`: the suffix returned by the available
`WorspacesRoutingSuffixProvider` if any.

Both values can null, in which case they are not added to the ST
variables, so that it is possible to test on their existence in the
template. For example:

```
<if(workspacesRoutingSuffix)><user>-che.<workspacesRoutingSuffix><else><externalAddress><endif>
```

* Add a new provider to get workspace-related Openshift configuration containing:
    - the `io.fabric8.kubernetes.client.Config` object to connect the right
Openshift cluster / namespace in which workspaces will be created
    - The name of the namespace in which workspaces are cteated
    - A boolean that tell if the workspaces will be created in a different
cluster as the che-server.

These data returned by the subclasses of the new provider can of course
depend on the current user (and this will be the case for multi-tenancy)

* Also support the `application/vnd.api+json` content type in responses

* Now use the new providers to connect to the right clutser / namespace

* Allow the Docker connector to return the API endpoint...

The base `DockerConnector` class returns `null` as the endpoint, thus
keeping the previous behavior.

However the `OpenshiftConnector` implementation now returns the API
endpoint without the need for any environment variable:

Indeed in the case of Openshift, the API endpoint is either based on:

    - the internal fully-qualified name of the `che-host` service if
workspaces are to be hosted on the same Openshift cluster,
    - the external URL of the `che` route if workspaces may be hosted on a
distinct Openshift cluster.


* If related properties or env variables are void, use the connector to retrieve
the API endpoint.

* Required changes for multi-tenancy in deployment script

* Allow overriding the agent log directories in a clean way so that we don't need
to replace the `XXXWsMasterModule` class only
to override the `run_command` binding.

* Move some local-docker-related configuration into a separate `dynamodule`.
This avoid the need to override the `WsMasterModule` class and comment
these bindings in derived assemblies that use a distinct implementation
or don't need Traeffik (such as for Openshift deployments). 

* Return `OpenShiftException` when workspaces namespace cannot be reached 

* Add multi-tenancy options to the deploy script

* Add the `CHE_EPHEMERAL` and `CHE_USE_ACME_CERTIFICATE` options

* Fix the name of the used docker image for multi-tenant

Signed-off-by: David Festal <dfestal@redhat.com>
2017-10-19 15:01:56 +02:00
Sergii Kabashniuk f4cc97acce Set next version 6.0.0-M1-SNAPSHOT 2017-10-19 13:53:40 +03:00
Sergii Kabashniuk e321ab00b1 Merge with master 2017-10-15 14:33:47 +03:00
Florent BENOIT 9581a9bbef Move to mockito 2.10
Some changes are required like
 - anyString() --> nullable(String.class) for many tests as in fact we provide null values
 - add class for VerificationMode as there are more than one method now (can't use lambdas)
 - remove cast on ArgumentMatcher (now we can use lambdas as there is generics)
 - remove unecessary stubbing (mockito is now reporting un-needed stubs)

Change-Id: I69c7ccc86bc85a4401d5e33671229ae0ce560dbb
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-10-15 10:34:15 +02:00
Roman Iuvshyn abe3271908 RELEASE: Set next development version (#6692)
* RELEASE: Set next development version
2017-10-14 20:17:04 +03:00
Artem Zatsarynnyi 5041b59e6e Merge branch 'master' into spi 2017-10-12 11:54:46 +03:00
Dmytro Kulieshov 6d71a32449 Heap on master filled with JSON-RPC message Strings (#6676) 2017-10-11 16:31:25 +03:00
Artem Zatsarynnyi 22c21265aa Merge branch 'master' into spi 2017-10-11 10:16:43 +03:00
Valeriy Svydenko e2439d78d9 Send events from server to client about project's changes (#6628) 2017-10-10 15:46:27 +03:00
Yevhen Vydolob 17f374a104 #6251 handle partial WebSocket messages (#6622)
Signed-off-by: Yevhen Vydolob <evidolob@codenvy.com>
2017-10-10 11:46:44 +02:00
Sergii Kabashniuk ee01b2998f Multi-user Eclipse Che (#6441)
Multi-user Eclipse Che (#6441)
#### How to run it.
```docker run -it -e CHE_MULTIUSER=true -e CHE_HOST=<your ip> -e CHE_KEYCLOAK_AUTH-SERVER-URL=http://<your ip>:5050/auth -v /var/run/docker.sock:/var/run/docker.sock -v ~/.che-multiuser:/data eclipse/che:nightly start --skip:pull --skip:nightly```
#### How to manage it
 - Keycloak configured with two realms. ```Master``` and ```che```. Also we have one user admin/admin in both realm. Admin user in master realm is  - super admin. 
-  Eclipse Che configured for che realm
- We enabled user registration in ```Che``` realm
#### Known limitation
 - swagger would not work. We need to upgrade a version. to support openid authentification https://github.com/eclipse/che/issues/6015
- It's working on local docker. We are going to provide scalable version based on OpenShift on next versions.
- Invitation of non-existent users to Eclipse Che organization https://github.com/eclipse/che/issues/6335
#### How to run it when it is in a branch


To run an multiuser Che version, the following steps are required after building the branch:
 - Rebuild init, cli and che images (in the given sequence). To do that, proceed to folder _dockerfiles/<image_name>_ and run _build.sh_
 - Run Che in a  usual way using cli, with additional parameters:  `-e CHE_MULTIUSER=true` and `--skip:pull --skip:nightly`  
   Full command example:
   `docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /home/user/.che:/data -e CHE_MULTIUSER=true eclipse/che-cli:nightly start --skip:pull --skip:nightly`
 - MacOS users may need to edit _che.env_ file in the data folder, changing `CHE_HOST` and `CHE_KEYCLOAK_AUTH__SERVER__URL` values to their specific IP.
 
When start is succeeded, the following docker containers should be created:  
 - che, exposing 8080 port;
 - che_keycloak, exposing 5050 port;  
 - che_postgres, exposing 5432 port;
2017-10-06 17:27:27 +03:00
Artem Zatsarynnyi 4bc18519db Merge branch 'che-multiuser' into spi 2017-10-05 16:30:22 +03:00
Artem Zatsarynnyi 4906a34a3c Remove unused class 2017-10-04 17:48:58 +03:00
Sergii Kabashniuk a3f001723f Merge remote-tracking branch 'origin/master' into che-multiuser 2017-10-04 08:34:59 +03:00
Artem Zatsarynnyi 9276c4f8e5 Clean-up code related to obsolete event bus (#6553) 2017-10-03 16:13:08 +03:00
Vladyslav Zhukovskyi 4eccc7934e Change signature by adding throws section
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
2017-10-03 11:52:08 +03:00
Sergii Leshchenko 108b3d832b Merge remote-tracking branch 'origin/che-multiuser' into spi-multiuser
# Conflicts:
#	assembly/assembly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterModule.java
#	dockerfiles/init/manifests/che.env
#	plugins/plugin-docker/che-plugin-docker-machine/src/test/java/org/eclipse/che/plugin/docker/machine/MachineProviderImplTest.java
#	plugins/plugin-docker/pom.xml
#	plugins/plugin-github/che-plugin-github-pullrequest/src/main/java/org/eclipse/che/plugin/pullrequest/client/GitHubHostingService.java
#	pom.xml
#	wsagent/agent/src/main/java/org/eclipse/che/api/agent/WsAgentLauncher.java
#	wsagent/agent/src/test/java/org/eclipse/che/api/agent/WsAgentLauncherTest.java
#	wsmaster/che-core-api-machine/pom.xml
#	wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/model/impl/EnvironmentImpl.java
2017-09-28 12:33:07 +03:00
Artem Zatsarynnyi 685def4d29 Merge branch 'master' into spi 2017-09-21 09:24:39 +03:00
Sergii Kabashniuk 546ba4e4ea Merge with master 2017-09-20 11:34:18 +03:00
Roman Iuvshyn 8e03d56bfb RELEASE: Set next development version (#6345) 2017-09-19 14:52:53 +03:00
Oleksandr Garagatyi 916cb758a4 Remove unneeded license checking excludes
Also fixed licenses in several files.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2017-09-18 13:10:10 +03:00
Sergii Kabashniuk e7006e5ae4 Merge with master 2017-09-18 08:46:28 +03:00
Oleksandr Garagatyi 9e226361ca Remove unneeded license checking excludes
Also fixed licenses in several files.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2017-09-15 17:43:12 +03:00
Artem Zatsarynnyi acce13f30c Merge branch 'master' into spi 2017-09-15 11:21:33 +03:00
Vitalii Parfonov a27da4951c Inject unsubscribe handlers (#6273)
* Inject unsubscribe handlers

Signed-off-by: Vitalii Parfonov <vparfonov@redhat.com>
2017-09-14 15:36:45 +03:00
Max Shaposhnik d635b25831 Adds permissions into Che multiuser. (#6133) 2017-09-12 11:43:04 +03:00
Artem Zatsarynnyi 3b78c21bbf Merge branch 'master' into spi 2017-09-07 12:25:37 +03:00
Roman Nikitenko 6f589a020a Fix switch statement
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
2017-09-05 11:18:42 +03:00
Yevhen Vydolob 2e798d6fce Add implementation for 'Show message request' LS feature (#5860)
* #1794 implement 'ShowMessageRequest'
2017-09-04 16:12:25 +02:00
Dmytro Kulieshov 1f27537c2b Some JSON RPC requests are not processed by RequestHandlerManage (#5991) 2017-09-04 12:26:45 +03:00
Artem Zatsarynnyi 04be689c69 Merge branch 'master' into spi 2017-09-04 11:51:57 +03:00
Roman Iuvshyn 2850a74a11 RELEASE: Set next development version (#6067) 2017-08-23 11:11:34 +03:00
Sergii Kabashniuk 9c9268c735 Fixed some formatting differences (#6044) 2017-08-18 17:58:45 +03:00
Sergii Kabashniuk d78121d957 Used Google Java Codestyle 2017-08-18 17:45:22 +03:00
Sergii Kabashniuk 6e9825c699 Used Google Java Codestyle 2017-08-18 17:16:54 +03:00
Sergii Kabashniuk 5b373e6cf5 Used Google Java Codestyle (#5851) 2017-08-18 17:00:58 +03:00
Artem Zatsarynnyi 83d25535a9 Fix licenses
Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>
2017-08-17 17:19:12 +03:00
Artem Zatsarynnyi a552e67a76 Merge branch 'master' into spi 2017-08-17 16:40:48 +03:00
Artem Zatsarynnyi 51fed52707 Merge branch 'master' into spi 2017-08-17 15:21:26 +03:00
Mykhailo Kuznietsov 69d5148385 Changed copyright owner to "Red Hat, Inc." in license headers (#5964)
Change license header contributor to Red Hat, Inc.
2017-08-11 10:46:58 +03:00
Roman Iuvshyn c2eb3188c1 RELEASE: Set next development version (#5949) 2017-08-09 11:17:20 +03:00
Anatoliy Bazko 77a34f95fd CHE-2571: Modifiable agent registry (#5876)
* CHE-2571: Modifiable agent registry
2017-08-07 13:10:36 +00:00
Artem Zatsarynnyi 2c2ed557a0 Merge branch 'master' into spi 2017-07-31 15:20:31 +03:00
Dmytro Kulieshov 53c38429b5 Fix for the code validation is not available for language servers (#5827)
* initial commit

Signed-off-by: Dmitry Kuleshov <dkuleshov@codenvy.com>

* quick fix for query params for ws init urls

Signed-off-by: Dmitry Kuleshov <dkuleshov@codenvy.com>
2017-07-31 13:30:01 +03:00