Commit Graph

259 Commits (a1dfdfb04ef7f3369c8d313dbcd1992e22f3b244)

Author SHA1 Message Date
Artem Zatsarynnyi a1dfdfb04e Merge branch 'master' into spi 2017-07-05 18:25:50 +03:00
Sun Seng David TAN 8049320348 Openshift connector improvements (#5052)
* CHE-4141 - Use Persistent Volumes Claims when creating workspaces

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>

* Implement getContainerLogs method in OpenShiftConnector

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>

* Implement createExec() and startExec() in OpenShiftConnector

Add implementations of createExec() and startExec(). Since OpenShift
does not separate the create and start steps, a holder class
KubernetesExecHolder is necessary, to pass information between
the call to createExec() (which just saves relevant information)
and startExec().

Additionally, adds KubernetesOutputAdapter, which parses the output
from OpenShift into LogMessages that can be handled by Che's
MessageProcessor<LogMessage> class.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>

* Add implementation of getEvents() to avoid busy wait

Signed-off-by: Angel Misevski <amisevsk@redhat.com>

* Update Dockerfile to avoid permissions issues

Signed-off-by: Mario Loriedo <mloriedo@redhat.com>

* Che server and workpaces exposed on the same single TCP port (#4351)

Signed-off-by: Mario Loriedo <mloriedo@redhat.com>

* Disabling usage of user account service in openshift-connector

Signed-off-by: Sun Seng David Tan <sutan@redhat.com>

* Update Docker Compose tests to fix test failure

Updating to Jackson 2.7.7 causes tests in the docker compose
plugin to fail. This is due to the fact that the tests expect
empty values in dictionaries to be parsed as the empty string,
whereas jackson 2.7.7 parses them as null (as specified by the
yaml spec).

Modifies the affected tests to explicitly use an empty string
(i.e. "") instead of an empty value.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>

* Find an alternative to subPath in volumeMount

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>

* Setting rwx permissions for all on /data/ in case it's not mounted

Signed-off-by: Mario Loriedo <mloriedo@redhat.com>

* Add support for resource limits when running on Openshift

Add resource limits to workspace Pods when running on OpenShift.
The memory limit is normally obtained from the API request to
create the workspace, however it can be overridden via the property
`che.openshift.workspace.memory.override`. The cpu limit used is
determined by the property `che.openshift.workspace.cpu.limit`.

In both cases, the value of the property is passed directly to
OpenShift, so any valid quantity is acceptable (e.g. 150Mi,
1Gi, 1024, etc).

Signed-off-by: Angel Misevski <amisevsk@redhat.com>

* Fix dockerImageConfig is null (since v1.5 of OpenShift API)

Signed-off-by: Sun Seng David Tan <sutan@redhat.com>

* Add Nullable annotation to che.docker.ip.external

The property che.docker.ip.external can be null, but
OpenShiftConnector does not include the annotation. This
prevents Che from initialising if e.g. running on docker
without the property set.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>

* CHE-158 Adding TLS support for Workspace routes

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>

* Adding property to set requests for RAM

Signed-off-by: Mario Loriedo <mloriedo@redhat.com>

* CHE-158 Using '-' instead of '.' for generating OpenShift route Urls

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>

* Fixing tests after changing Url generation logic

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>

* Redirect insecure HTTP requests to TLS endpoint

Signed-off-by: Mario Loriedo <mloriedo@redhat.com>

* CHE-180: Creating and closing OpenShiftClient in every method of OpenshiftConnector

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>

* Update route naming to make it work on OSO

Signed-off-by: Mario Loriedo <mloriedo@redhat.com>

* Rework PVC management on OpenShift

- Change how subdirectories are created in pods to
  use a short, terminating job instead of a full deployment
- Add OpenShiftWorkspaceFilesCleaner class to properly
  notice workspace deleted events
- Add helper class to manage job pods. For creation, some
  effort is made to avoid attempting to create workspaces
  unnecessarily, but only exists in-memory
- Workspace deletions are batched together so that removing
  workspaces directories can be done when server is idled,
  avoiding unnecessary PVC mounts
- Add two new properties: che.openshift.jobs.image and
  che.openshift.jobs.memorylimit, which are used by
  OpenShiftPvcHelper to set up pods

Current issues:
- Since workspace directories are not deleted immediately,
  attempting to re-create a workspace with the same name
  will result in the previous instance's project to already
  be there. This should have a minor impact.
- Memory for which workspace dirs have been created is not
  persisted, resulting in potentially unnecessary jobs
- Openshift workspace files cleaner is included by overwriting
  binding in WsMasterModule instead of using a provider. This
  could be better, but OpenShift integration may be reaching a
  point where a custom module is a better solution.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Sun Seng David Tan <sutan@redhat.com>

* Delete ReplicaSets explicitly when shutting down a workspace

Signed-off-by: Angel Misevski <amisevsk@redhat.com>

* Fix OpenShiftConnectorTest

Signed-off-by: Mario Loriedo <mloriedo@redhat.com>

* Fix route server names if unknown should start with server-.

https://issues.jboss.org/browse/CHE-230

Signed-off-by: Sun Seng David Tan <sutan@redhat.com>

* Add property to control manual workspace dir creation in OpenShift

Add property 'che.openshift.precreate.workspace.dirs'. If property is
true, OpenShiftConnector will run a pod before launching workspaces
to create a subpath in the workspace's persistent volume with correct
permissions. If the property is false, this step is skipped.

This is necessary as in older versions of OpenShift/Kubernetes, subpaths
created as part of a volume mount are created with root permissions, and
so cannot be modified by workspace pods. More recent versions fix this,
creating subpath volumes with correct permissions, making the step above
unnecessary.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>

* CHE-102 - Idle detection of che-server and workspaces

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>

* Add and modify tests for OpenShift helper classes

Add tests for the untested classes in openshift.client.kuberentes,
and update existing tests where necessary.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>

* Recent changes required access to `/` which is impossible under OS 

Signed-off-by: David Festal <dfestal@redhat.com>

* adapt che-server entrypoint.sh to environments without write permissions in '/' (#5344)

* adapt che-server entrypoint.sh to environments without write permissions in '/'

* CHE-280: Adding container's state info to the 'inspectContainer' API

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>

* Factorize code of `ServerEvaluationStrategy` classes, to use the Custom strategy as the basis of other strategies (#5366)

* Pull-up the local docker port management (use exposed ports)

Signed-off-by: David Festal <dfestal@redhat.com>

* Make all the strategies extend `CustomEvaluationStrategy`

Signed-off-by: David Festal <dfestal@redhat.com>

* Add a `workspaceIdWithoutPrefix` macro and use it for `single-port`

This macro is based on the `workspaceId` macro, but without the
`workspace` prefix.

Signed-off-by: David Festal <dfestal@redhat.com>

* Add the `isDevMachine` to allow conditions in the ST template.

This is required to allow the `single-port` strategy to have a different
url according to the type of machine. (see the work done for CHE-175 :
Support multi-container workspaces on OpenShift)

Signed-off-by: David Festal <dfestal@redhat.com>

* Small fixes after comments from @fbenoit

Signed-off-by: David Festal <dfestal@redhat.com>

* Fix unnecessary space pointed out by @sunix

Signed-off-by: David Festal <dfestal@redhat.com>

* Remove unnecessary `else` as suggested by @sunix

Signed-off-by: David Festal <dfestal@redhat.com>

* Keep the method signatures compatible with the `condenvy` strategy

Signed-off-by: David Festal <dfestal@redhat.com>

* Align names of parameters of constructors (requested by @garagatyi)

Signed-off-by: David Festal <dfestal@redhat.com>

* Add a default implementation to avoid breaking the Codenvy build

Signed-off-by: David Festal <dfestal@redhat.com>

* Also rename the attributes

Signed-off-by: David Festal <dfestal@redhat.com>

* Use a constant for the `workspace` prefix string

Signed-off-by: David Festal <dfestal@redhat.com>

* Fix formatting as requested by @sunix

Signed-off-by: David Festal <dfestal@redhat.com>

* Use a constant for the `isDevMachine` macro name

Signed-off-by: David Festal <dfestal@redhat.com>

* Add unit tests for `workspaceIdWithoutPrefixè and `isDevMachine` macros

Signed-off-by: David Festal <dfestal@redhat.com>

* Another requested formatting fix

Signed-off-by: David Festal <dfestal@redhat.com>

* Make new tests clearer

Signed-off-by: David Festal <dfestal@redhat.com>

* yet another formatting request

Signed-off-by: David Festal <dfestal@redhat.com>

* Respect the original order of imports

Signed-off-by: David Festal <dfestal@redhat.com>

* remove unnecessary `toString()`

Signed-off-by: David Festal <dfestal@redhat.com>

* use a lowercase `S` in the `server-` prefix

Signed-off-by: David Festal <dfestal@redhat.com>

* Multi-container workspace Support (#5110)

* Fix 2 NPE that prevented using *non-dev* additional machines

In the context of https://issues.jboss.org/browse/CHE-175

Signed-off-by: David Festal <dfestal@redhat.com>

* Name openshift resources based on the machine name for non-dev machines

This fixes https://issues.jboss.org/browse/CHE-259
and https://issues.jboss.org/browse/CHE-258

Signed-off-by: David Festal <dfestal@redhat.com>

* Fix failing Traeffik tests...

... by:
- adding the new `CHE_IS_DEV_MACHINE` env variable in tests
- pulling up all the `CustomServerEvaluationStrategy` features in an
abstract `BaseServerEvaluationStrategy` (which all other Che strategies
extend) and have the `CustomServerEvaluationStrategy` class simply
extend this `BaseServerEvaluationStrategy`.

Signed-off-by: David Festal <dfestal@redhat.com>

* Fix tests in the LocalDockerEvaluationStrategy...

... by correctly using the boolean attribute to manage the new use-case
introduced by @fbenoit in master.

Signed-off-by: David Festal <dfestal@redhat.com>

* Replace OSIO-specific `single-port` strategy by `docker-local-custom` 

This fixes redhat-developer/rh-che#113

Signed-off-by: David Festal <dfestal@redhat.com>
2017-07-04 18:11:32 +02:00
Artem Zatsarynnyi 7b0fd18f05 Merge branch 'master' into spi 2017-07-03 10:15:20 +03:00
Eugene Ivantsov 832509c5a4 Fix entrypoint to respect CHE_DOCKER_IP (#5507)
* Fix entrypoint to respect CHE_DOCKER_IP

Signed-off-by: Eugene Ivantsov <eivantsov@codenvy.com>

* Fix entrypoint to respect CHE_DOCKER_IP

Signed-off-by: Eugene Ivantsov <eivantsov@codenvy.com>

* Fix entrypoint to respect CHE_DOCKER_IP

Signed-off-by: Eugene Ivantsov <eivantsov@codenvy.com>

* Fix entrypoint to respect CHE_DOCKER_IP

Signed-off-by: Eugene Ivantsov <eivantsov@codenvy.com>
2017-06-30 11:56:01 +03:00
Sergii Leshchenko 0504b313d8 CHE-5413 Rename Agent to Installer 2017-06-29 17:58:09 +03:00
Artem Zatsarynnyi 1ba5f63d8f Merge branch 'master' into spi 2017-06-29 17:45:59 +03:00
Roman Iuvshyn ee1eae88fd RELEASE: Add next tag version in CLI 2017-06-29 15:22:39 +03:00
Artem Zatsarynnyi a9d7011fdb Merge branch 'master' into spi 2017-06-28 11:14:17 +03:00
Roman Iuvshyn 4f52716a98 add notification file (#5441) 2017-06-26 18:05:45 +03:00
Artem Zatsarynnyi ca1d56ab4d Merge branch 'master' into spi 2017-06-23 09:59:52 +03:00
Michail Kuznetsov e393bf4cc6 Added stacks archetype (#5417) 2017-06-22 12:03:43 +00:00
Artem Zatsarynnyi ad2460999e Merge branch 'master' into spi 2017-06-22 08:27:59 +03:00
Roman Iuvshyn d1b3f93497 RELEASE: Add next tag version in CLI 2017-06-21 16:31:10 +03:00
Artem Zatsarynnyi 812338b6b5 Merge branch 'master' into spi 2017-06-20 13:57:48 +03:00
Anton Korneta c34d359921 Change public stacks, recipes loading policy (#5234) 2017-06-20 11:31:00 +03:00
Artem Zatsarynnyi cce79bf469 Merge branch 'master' into spi
# Conflicts:
#	assembly/assembly-wsmaster-war/pom.xml
#	infrastructures/docker/pom.xml
#	plugins/plugin-docker/che-plugin-docker-compose/pom.xml
#	plugins/plugin-github/che-plugin-github-pullrequest/src/main/java/org/eclipse/che/plugin/pullrequest/client/GitHubHostingService.java
#	plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-ide/src/main/java/org/eclipse/che/plugin/testing/junit/ide/action/RunAllTestAction.java
#	plugins/plugin-testing-java/plugin-testing-junit/che-plugin-testing-junit-ide/src/main/java/org/eclipse/che/plugin/testing/junit/ide/action/RunClassTestAction.java
#	plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-ide/src/main/java/org/eclipse/che/plugin/testing/testng/ide/action/RunAllTestAction.java
#	plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-ide/src/main/java/org/eclipse/che/plugin/testing/testng/ide/action/RunClassTestAction.java
#	plugins/plugin-testing-java/plugin-testing-testng/che-plugin-testing-testng-ide/src/main/java/org/eclipse/che/plugin/testing/testng/ide/action/RunTestXMLAction.java
#	pom.xml
#	wsmaster/che-core-api-machine/pom.xml
2017-06-15 10:35:47 +03:00
Roman Iuvshyn 57106827fb enable and fix existing and add some more tests CLI tests. (#5304)
* enable, fix and add more CLI tests.
2017-06-14 12:46:07 +03:00
Roman Iuvshyn a50cf745b5 RELEASE: Add next tag version in CLI 2017-06-14 10:57:53 +03:00
Artem Zatsarynnyi 11abb61488 Merge branch 'master' into spi 2017-06-12 10:48:59 +03:00
Roman Iuvshyn 55e6720114 CLI fix offline save stacks to tars (#5269) 2017-06-02 15:12:10 +03:00
Roman Iuvshyn 5f26c06f14 CHE-5247: fix cmd download and cmd offline (#5263) 2017-06-01 16:58:29 +03:00
Artem Zatsarynnyi 9aab95e107 Merge branch 'master' into spi 2017-05-30 11:27:42 +03:00
Florent BENOIT a246875dde Use of new Traefik version (before : RC1, now RC3) (#5232)
* Use of new Traefik version (before : 1.3RC1, now 1.3RC3)

Change-Id: I8b7097f60dc28bfcf2e4585d4c1e1393d53b8332
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
2017-05-29 17:42:05 +02:00
Roman Iuvshin 77a4211ddf RELEASE: add bugfix version 2017-05-29 16:33:20 +03:00
Artem Zatsarynnyi fa91db1f4e Merge branch 'master' into spi 2017-05-29 11:25:30 +03:00
David Windell dbfb74c232 Fix workspace storage path on Docker Cloud (#4931)
Signed-off-by: David Windell <david@outeredgeuk.com>
2017-05-26 22:56:19 +03:00
Roman Iuvshin d75545d200 fix che-server entrypoint for non CLI usage 2017-05-26 22:04:14 +03:00
Yevhenii Voevodin a16ddd31a7 Use Authorization header instead of session-access-key cookie 2017-05-26 17:42:08 +03:00
Roman Iuvshin b97c4e2e98 RELEASE: add bugfix version 2017-05-26 13:33:57 +03:00
Gennady Azarenkov 8ad21b4638 SPI messaging and code clean 2017-05-25 21:12:12 +03:00
Roman Iuvshin 0e17aff750 copy embedded che.properties to CHE_LOCAL_CONF_DIR if no custom config provided (#5202) 2017-05-25 18:05:06 +03:00
Artem Zatsarynnyi c6822e08da Merge branch 'master' into spi 2017-05-25 10:13:44 +03:00
Roman Iuvshin ef35f95cc1 RELEASE: Add next tag version in CLI 2017-05-24 12:42:36 +03:00
Artem Zatsarynnyi e6cb33117b Merge branch 'master' into spi 2017-05-22 10:03:29 +03:00
Florent BENOIT 63b440af28 Use of version_lt function instead of less than (#5141)
less_than is not working with for example “5.9.1” and “5.10.0”, 5.9.0 being said to be a greater version

bash-4.3# version_lt "5.9.0" "5.10.1"
—> 0

bash-4.3# less_than "5.9.0" "5.10.1"
—> 1

bash-4.3# less_than "5.6" "5.8"
—> 0

Change-Id: I33417f012c193416bfb746df125c19e92a868b4e
note: version_lt is a less and equals method, so we need to exclude the condition : tag == base version
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
2017-05-19 17:18:20 +02:00
Florent BENOIT a13068e140 Enable single port exposure on Che (#5115)
* Toggle Che single port by enabling CHE_SINGLE_PORT in the che.env file. (CHE_SINGLE_PORT=true, default is false)

By enabling single-port, all browser traffic to Che or any workspace will be routed through the value that you have set to CHE_PORT`, or 8080 if not set. Setting this property will transform the launch sequence of Che to launch a Traefik reverse proxy. The reverse proxy will act as the traffic endpoint for all browser communications. When a new workspace is started or stopped, Che will update Traefik's configuration
with rules for how browser traffic should be routed to Che or a workspace.

It’s now using an official Traefik image (before I was using a custom made image)
There is an interceptor with a kill switch. It means interceptor is applied only if plug-in is enabled (not only if plug-in is added at compilation)
It is automatically enabled when CHE_SINGLE_PORT is turned on

docker-compose file is handling if the single_port is turned on or off and then add the traefik container and redirect port only if the property is enabled. (not enabled by default)

using —debug flag when launching che is also turning on the traffic web console to view traefik routes

It is not enabled by default, so it means that without user change, there is no overhead, no useless container started, etc.

Change-Id: I12644d9202dadc0b10104f78bb055425ca6611ac
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
2017-05-18 14:52:41 +02:00
Artem Zatsarynnyi 50ef94bbde Merge branch 'master' into spi 2017-05-17 19:49:53 +03:00
Roman Iuvshin a0b9719caa Add possibility to extend che.env with addon.env if it exist (#5118) 2017-05-17 17:17:26 +03:00
Roman Iuvshin 4813a1a712 fix CHE custom properties usage (#5103) 2017-05-17 10:33:33 +03:00
Gennady Azarenkov 45a0ece9b4 remove old entities 2017-05-16 20:13:57 +03:00
Alexander Garagatyi 21c4589086 Merge branch 'master' into spi
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
2017-05-15 12:27:23 +03:00
Max Shaposhnik aed295c7ba Fix OS check in CLI 2017-05-12 15:34:18 +03:00
Max Shaposhnik d81b517690 Fix CLI startup output for Windows; (#5045) 2017-05-11 12:18:09 +00:00
Roman Iuvshin a26cd0330f RELEASE: Add next tag version in CLI 2017-05-10 17:39:51 +03:00
Roman Iuvshin 91a544817e RELEASE: add bugfix version 5.9.1 2017-04-27 16:27:05 +03:00
Roman Iuvshin cdabad5231 RELEASE: set nightly versions in dockerfiles 2017-04-25 21:53:37 +03:00
Eugene Ivantsov dcdd4c3980 Fix archetypes defaults in CLI (#4905)
Signed-off-by: Eugene Ivantsov <eivantsov@codenvy.com>
2017-04-25 16:00:49 +03:00
Roman Iuvshin b36a74d600 RELEASE: set tag versions in dockerfiles 2017-04-25 15:34:29 +03:00
Roman Iuvshin 0149a81ea1 RELEASE: add bugfix version 5.8.1 2017-04-25 12:52:26 +03:00
Alexander Garagatyi b3ce50f7cf Do not set debug log level when debug flag is used
Unset debug level when --debug is used to not use it as default behavior.
To set debug log level use env variable from CLI help.
2017-04-20 16:59:41 +03:00