Commit Graph

622 Commits (287c98d9c4df17258c8fc86baa79b78a6d9ea202)

Author SHA1 Message Date
Oleksandr Garagatyi 74bbcde05f CHE-6124: Normalize servers in internal machine
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2017-10-26 12:10:36 +03:00
Oleksandr Garagatyi cd1301d115 CHE-6124: Do not publish exposed ports in Docker machines
Publish port in Docker machines only in case there is a server
in the workspace config that represents the port.
Refactor OpenShift infrastructure code.
Refactor Docker infrastructure code.
Add constant of memory attribute and reuse it everywhere it is
hardcoded.
Add constant for installer environment attribute and reuse it
everywhere it is hardcoded.
Add machine memory attribute validation to workspace validation.
Move provisioning of servers, environment variables from
infrastructure implementations to runtime SPI abstract level.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2017-10-26 12:10:36 +03:00
Florent BENOIT cfc9751733 Make the test Java8/9 compliant
Change-Id: I0052c6dbb8a667ddd7a32706ee088f728f02cc20
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-10-25 11:29:53 +02:00
Florent BENOIT c7d34fb46f Remove unused SystemInfo attributes (cpu, freeMemory, totalMemory) (#6946)
* Remove unused "dead" code on cpu/freeMemory/totalMemory

Change-Id: I41bd108ce4b2af15693d57a5fa0c72caab932289
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-10-25 10:13:04 +02:00
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 Leshchenko bac6efc5e2 Added environment variables configuration to Machine model (#6802)
* CHE-6702 Add env variables to machine config

* CHE-6702 Add setting of env variables into OpenShift machines

* CHE-6702 Add setting of env variables into Docker machines

* CHE-6702 Make env field known for stack validator
2017-10-18 18:11:54 +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
Sergii Leshchenko 52e43115b3 Remove deprecated jpa test classes 2017-10-13 14:45:21 +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
Sergii Leshchenko 541e39530c CHE-6515 Add sending of email notification when changes occur in an organization 2017-10-03 14:16:44 +03:00
Sergii Leshchenko 9971e7503c CHE-6515 Add warning on tomcat start when mail sender is not configured 2017-10-03 14:16:43 +03:00
Sergii Leshchenko 90c7498432 CHE-6515 Add template processor 2017-10-03 14:16:43 +03:00
Artem Zatsarynnyi 8de6dbe5fb Merge branch 'che-multiuser' into spi 2017-10-03 13:04:39 +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 Kabashniuk dbacf98c16 Merge remote-tracking branch 'origin/master' into che-multiuser 2017-10-03 08:54:55 +03:00
Sun Tan a58d418108 Disable scheduling of methods annotated with @ScheduleRate/@ScheduleDelay if period/delay is not positive
Signed-off-by: Sun Tan <sutan@redhat.com>
2017-10-02 16:41:46 +02: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 28c5193252 Merge commit 'da636d181c41a5602dbd5ced28474ad985df49c0' into spi 2017-09-28 12:15:59 +03:00
Sergii Kabashniuk fb48c3d5d6 Merge with master. Fixing problem after merge Update EclipseLink to v2.7.0 2017-09-27 16:12:42 +03:00
Florent BENOIT e527363a26 Update EclipseLink to v2.7.0
note: some dependencies have been updated (avoid eclipselink dependencies as it contains some API of javax.persistence package)
then, when tests are running, Java runtime complains about siganture mismatch between eclipse-link jar and javax-persistence.jar (same package but with two origins)

By using org.eclipse.persistence.core and org.eclipse.persistence.jpa the dependencies are more explicit and we select only required dependencies.

Change-Id: I4752a79e1badb2bf36594a3f7c1928569200d2a5
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-09-27 14:33:11 +02:00
Sergii Kabashniuk 1c9a0fe9a8 Cleanup 2017-09-27 12:19:32 +03:00
Sergii Kabashniuk ca5efaf6f6 Fix spelling 2017-09-27 11:42:31 +03:00
Sergii Kabashniuk 0ca969012b Mailsender (#6374)
Mailsender
2017-09-22 10:34:26 +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
Florent BENOIT ffd21311b1 Some DTO in Che are using "arguments" and this is a reserved keyword so need to adapt the field name
Change-Id: Ieb2f97499b4173a2b58c8c0565871aafef3b9ddc
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-09-19 17:32:09 +02: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 d14dae95c7 CHE-6162: Fix problem project detection procedure (#6264)
* Fix problem project detection

Signed-off-by: Vitalii Parfonov <vparfonov@redhat.com>

* Add problems descriptor to MutableProjectConfig

Signed-off-by: Vitalii Parfonov <vparfonov@redhat.com>

* Avoid call updatePresntation on get

Signed-off-by: Vitalii Parfonov <vparfonov@redhat.com>

* Move class to the shared lib

Signed-off-by: Vitalii Parfonov <vparfonov@redhat.com>
2017-09-14 15:38:03 +03:00