Commit Graph

57 Commits (8e03d56bfbb62168072c38a0a0ce3ba8a26322d4)

Author SHA1 Message Date
Roman Iuvshyn 8e03d56bfb RELEASE: Set next development version (#6345) 2017-09-19 14:52:53 +03:00
Ilya Buziuk 0bd960605e openshift.io-798 Checking only first 20 chars of tag in 'getImageStreamTagFromRepo' for long tags
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
2017-09-13 14:06:18 +02:00
Roman Iuvshyn 2850a74a11 RELEASE: Set next development version (#6067) 2017-08-23 11:11:34 +03:00
Roman Nikitenko 0343393028 CHE-5829. Fix non-exhaustive switch statements
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
2017-08-22 18:16:33 +03:00
Sergii Kabashniuk 5b373e6cf5 Used Google Java Codestyle (#5851) 2017-08-18 17:00:58 +03:00
Ilya Buziuk ee09e10b84 Reverting #6019: Workaround for ImageStreamTags issue on OpenShift 3.6
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
2017-08-17 16:09:47 +02:00
Angel Misevski 6792b2ba9b Workaround for ImageStreamTags issue on OpenShift 3.6
Minor adjustment to how image name is set when creating a
workspace on OpenShift.

On OpenShift 3.6, it seems that using an ImageStreamTag
in a Deployment spec causes the deployment to have null status,
which causes kubernetes-client to throw an NPE.

We still need to decide if this is to be a longer term solution,
and if removing ImageStreamTags completely is a good option

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2017-08-17 08:16:24 +02:00
Ilya Buziuk 5a2adf139d Changing deletion order during deployment cleaup (routes & services are going to be deleted first)
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
2017-08-16 20:09:38 +02:00
Ilya Buziuk 52b878e953 Do not scale down deployment before resource deletion. Removing watch pod logic (seems to be also broken after 3.6 osio update)
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
2017-08-16 16:07:05 +02:00
Angel Misevski 2cd0ab0b09 Fix OpenShiftConnector.inspectImage() to resolve issue in OS 3.6+
OpenShiftConnector.inspectImage() uses pods to figure out a workspaces
docker image. Previously, this was not a problem as it would match
the imagestream tag we create earlier. However, in OpenShift 3.6 and
higher, it seems like pods created by deployments use the sha256 of
the image as an identifier, and so this fails. This means that
workspaces fail to start due to imagestream not found.

To resolve this issue, we instead get the image name through the
deployment, which does have the correct value.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2017-08-16 13:14:03 +02:00
Roman Iuvshyn c2eb3188c1 RELEASE: Set next development version (#5949) 2017-08-09 11:17:20 +03:00
Florent BENOIT 5bbbf9c337 Create routes in openshift with the same pattern than the urls provided by naming strategy (#5879)
* Create routes in openshift with the same pattern than the urls provided by the naming strategy.
Also it will be able to handle service name described through labels on Docker image.

It means that for one image 8080 port can be tomcat, but for another image it can be named "vertx" or default value if not specified

Change-Id: Ie8e0a09d0be8f6d042f542a76c146e2bbe266fc7
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-08-03 08:52:46 +02:00
Ilya Buziuk 7bc8a5e7f1 CHE-249: Setting workspace Pod terminationGracePeriodSeconds to zero
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
2017-07-24 19:00:15 +02:00
Ilya Buziuk 849456b802 CHE-220: Improving 'removeContainer' API. Refactoring
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
2017-07-24 18:59:33 +02:00
Roman Iuvshyn 185273f8b9 RELEASE: Set next development version (#5734)
* RELEASE: Set next development version
2017-07-19 12:45:32 +03:00
Florent BENOIT 4e872e0ed4 Adds a /workspace-logs folder linked to the persistent volume
Each pod has a dedicated folder matching the workspace id

for the project's source, it is currently using :

/projects ---> <PV>/<workspace-name>

and for the logs it's now using as well
/workspace-logs ---> <PR>/<workspace-name>-logs/

example : /workspace-logs/dev-machine-ws-agent/logs/catalina.log  for the log of the dev-machine workspace agent.

Change-Id: I2b9d533ba3df2cf55857d8c30d2de5df463a5902
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-07-18 15:23:49 +02:00
Florent BENOIT 8c25c2ac7d Sort imports
Change-Id: Ia8e2b2facb565458a972f0bd42da6cc4a1d525c1
Signed-off-by: Florent BENOIT <fbenoit@redhat.com>
2017-07-07 14:10:32 +02:00
Vitalii Parfonov c22466c269 Move binding ServerIdleDetctor to the assembly module (#5541)
Signed-off-by: Vitalii Parfonov <vparfonov@redhat.com>
2017-07-05 18:24:14 +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
Roman Iuvshin eab04ddd6b RELEASE: Set next development version 2017-06-29 07:59:05 +00:00
Roman Iuvshin 513aa19ebd RELEASE: Set next development version 2017-06-21 13:04:16 +00:00
Roman Iuvshin eb2fa0eeed RELEASE: Set next development version 2017-06-14 07:13:04 +00:00
Roman Iuvshin 9fbf173eb9 RELEASE: Set next development version 2017-05-24 07:30:41 +00:00
Mykola Morhun 064fdcb449 CHE-4197: Apply CHE_DOCKER_ALWAYS__PULL__IMAGE to container creation (#5112) 2017-05-18 13:05:08 +03:00
Roman Iuvshin b3ae33acf5 RELEASE: Set next development version 2017-05-10 10:54:42 +00:00
Roman Iuvshin 6d88cf8c73 [maven-release-plugin] prepare for next development iteration 2017-04-25 18:19:17 +00:00
Roman Iuvshin d7f023fd89 [maven-release-plugin] prepare release 5.9.0 2017-04-25 18:19:10 +00:00
Roman Iuvshin 7805c146e6 [maven-release-plugin] prepare for next development iteration 2017-04-13 11:07:13 +00:00
Roman Iuvshin e8107fd96c [maven-release-plugin] prepare release 5.8.0 2017-04-13 11:07:06 +00:00
Roman Iuvshin 840ae853f8 Revert "RELEASE: set minor change version"
This reverts commit e23b9257a3.
2017-04-11 20:55:24 +03:00
Roman Iuvshin e23b9257a3 RELEASE: set minor change version 2017-04-11 18:10:45 +03:00
Roman Iuvshin 08d4d0f25c [maven-release-plugin] prepare for next development iteration 2017-04-06 14:28:39 +00:00
Roman Iuvshin 53a0325213 [maven-release-plugin] prepare release 5.7.0 2017-04-06 14:28:33 +00:00
Roman Iuvshin 342f103654 [maven-release-plugin] prepare for next development iteration 2017-03-30 12:25:35 +00:00
Roman Iuvshin e6e4a652cc [maven-release-plugin] prepare release 5.6.0 2017-03-30 12:25:28 +00:00
Alexander Garagatyi 798ca081b4 CHE-4098: separate terminal and exec agents (#4486)
Refactor golang terminal code.
Add ping frames into terminal websocket connection.
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
2017-03-27 12:27:27 +03:00
Roman Iuvshin e7588aa2b3 [maven-release-plugin] prepare for next development iteration 2017-03-15 14:59:35 +00:00
Roman Iuvshin 69cf9f5528 [maven-release-plugin] prepare release 5.5.0 2017-03-15 14:59:28 +00:00
Roman Iuvshin ceff3938ff [maven-release-plugin] prepare for next development iteration 2017-03-02 18:33:12 +00:00
Roman Iuvshin 8ed6e10476 [maven-release-plugin] prepare release 5.4.0 2017-03-02 18:33:06 +00:00
Angel Misevski 1d9c426e2d Ensure OpenShift pod is terminated before returning from removeContainer (#4230)
Prevents issue where it is possible to start workspace while
pod is terminating. When this occurs, Che creates a new pod but
workspace start fails. This pod must be removed manually before
that workspace can be launched again.

This is done by a) waiting for pod to terminate before returning
from removeContainer, and b) removing created deployment and
service when an exception occurs during createContainer.

Additionally, increases maximum wait time for retreiving
OpenShift image stream metadata

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2017-03-01 00:56:32 -05:00
Mario Loriedo c8145259e5 Implement getEvents method in OpenShiftConnector
Signed-off-by: Mario Loriedo <mloriedo@redhat.com>
2017-02-28 17:38:11 +01:00
Angel Misevski 54e60a52b4 Add OpenShift implementation of getNetworks()
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2017-02-24 15:58:44 +01:00
rawlingsj 2fc5373524 kubernetes-client will autodetect auth details both inside and outside openshift so no need to use config
for more information including the order configuration is decided see https://github.com/fabric8io/kubernetes-client#configuring-the-client

fixes https://issues.jboss.org/browse/CHE-117

Signed-off-by: rawlingsj <rawlingsj80@gmail.com>
2017-02-22 22:38:23 +01:00
Roman Iuvshin e71c7b5671 [maven-release-plugin] prepare for next development iteration 2017-02-17 11:04:07 +00:00
Roman Iuvshin c071c65aa2 [maven-release-plugin] prepare release 5.3.0 2017-02-17 11:03:59 +00:00
Angel Misevski ad318b0fa1 Refactor inspectContainer() and add commit(), removeImage() (#4085)
Adds commit() and removeImage() implementations to
OpenShiftConnector. This requires some refactoring of existing
methods (mostly refactoring repeated processes into their own
methods -- e.g. creating an ImageStreamTag and getting image
info from a tag).

Additionally, refactors inspectContainer() method to remove
a call to DockerConnector, instead obtaining the same information
from what's available through the OpenShift API. This fixes an
issue where the IP address of a workspace was unavailable from
the ContainerInfo returned by DockerConnector.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2017-02-11 01:10:29 +01:00
Mario Loriedo bbb2bc9bf2 OpenShiftConnector OAuth token support (#4049)
Signed-off-by: Mario Loriedo <mloriedo@redhat.com>
2017-02-10 10:50:59 +01:00
Angel Misevski b6a056fa22 Implement OpenShift pull, tag, and inspectImage
Implement OpenShiftConnector pull, tag, and inspectImage through
ImageStreams. Makes changes to how containers are created.

Currently snapshots do not work, as commit and push methods are not
implemented. Additionally, pulling a stack from a private repository
is not supported.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2017-02-09 01:26:57 +01:00
Snjeza 65c38ed507 Fixing failed tests (#4065)
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
2017-02-08 21:33:45 +02:00