Commit Graph

445 Commits (da3eefe2378e878de1801ac5912c031ae172dfef)

Author SHA1 Message Date
Sergii Leshchenko 4eccec6385 Move warnings messages and codes to special final class in K8s/OS infrastructures 2018-11-27 09:19:28 +02:00
Sergii Leshchenko 20020afba4 Make InternalRuntimes propagate warnings from environment 2018-11-27 09:19:28 +02:00
Sergii Leshchenko 66c0d8d7e6 Add publishing commands from plugins 2018-11-27 09:19:28 +02:00
Sergii Leshchenko 4edd9190bf Make k8s/OS internal runtime return commands 2018-11-27 09:19:28 +02:00
Sergii Leshchenko b612c300dd Make Docker internal runtime return environment commands 2018-11-27 09:19:28 +02:00
Sergii Leshchenko 25f76803db Add commands to InternalEnvironment and Runtime 2018-11-27 09:19:28 +02:00
Ilya Buziuk b9997df05b rh-che #1075: Adding 'ImpersonatorInterceptor' during creation of KubernetesClient
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
2018-11-23 09:59:10 +01:00
Lukas Krejci 9109cf37c5 Workspace tracing (#11924)
* Adding support for @Traced annotation to enable whole method tracing
* Trace the creation and removal of workspace
* Trace the start of async start of the workspace
Note that this does not actually trace the async operations but merely
the "kick off" of those. For tracing the async operations, we need to
introduce support for propagating the span ids over the thread boundaries
using opentracing-concurrent.
* Enable tracing across the thread boundaries by augmenting the
WorkspaceSharedPool threadpool with tracing support.
Note that this does not add any new traces, merely enables the async
tracing.
* Add support for adding tags to @Traced methods.
The interceptor also reports the actual invoked class and method
(cleansed of Guice subclass name garbage)
* Trace the startup of pods during workspace startup.
* Trace stop of a workspace
* Introduce utility methods for tracing parts of methods.
* Trace provisioning of k8s objects (in both Kubernetes and Openshift
infrastructures).
* Create a common set of tags and enable strongly typed tags
* Apply the standard tags instead of hardcoded strings.
* Adding @Beta annotations for the tracing-related classes.
This needs to stabilize first.
* Replacing the "Traces" machinery with just annotated package private methods.
This way the code is easier to ready while we also keep all the flexibility
needed for the tag definitions.
* Rename CheTags to more descriptive TracingTags.
* Evaluate the tag values lazily.
This will reduce the load when tracing is switched off.
* Simplify the machine startup tracing logic and distinguish between
true error and mere cancellation due to prior errors.
* Trivial - applying formatting.
* Use getContext().getEnvironment().getMachines().size() to get the precise
number of machines that will be starting up.
* Trivial - change the name of the machine creation tag
* Use a formatted message instead of string concat.
* Update to the latest parent so that che-core-commons-tracing is correctly
incorporated into the full build.
* Fix tracing of the asynchronous stop of a workspace.
* Don't fall over when tracing is not available.
2018-11-22 21:51:12 +02:00
Oleksandr Garagatyi aaa8f424cd
Make a workspace run without any user env (#11890)
Allows running Che 7 workspace without any user environment but with Che 7 tooling set.
Workspace without environment has an empty list of environments and null value in `defaultEnv` field.
Field `activeEnv` is supposed to be `null` too.
What is changed:
- Migration of DB
- make defaultEnv nullable
- remove env_name from runtimes primary key
- make env_name in runtimes nullable
- Make code respect the fact that there are workspaces with no env
- settings API that returns the list of supported environment types returns no-environment type that - indicates that infrastructure support workspace with no environment at all.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-11-21 16:39:54 +02:00
Sergii Leshchenko c4ac0603fa
Remove unneeded listening of PluginBrokers Pod events (#11940) 2018-11-19 10:51:12 +02:00
Sergii Leshchenko a4f8410e6e Make PVC Strategies wait until PVCs are bound during preparing 2018-11-15 14:43:51 +02:00
Roman Iuvshyn 99afaef87f
RELEASE: Set next development version (#11930) 2018-11-14 12:29:03 +02:00
Angel Misevski 58c83a07d8 fixup: improve KubernetesBrokerInitContainerApplier
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2018-11-12 16:22:18 -05:00
Angel Misevski 10ad928ef4 Add tests for applying broker as init container + minor PR fixes
- Add tests for SideCarToolingProvisioner,
KubernetesBrokerInitContainerApplier, and EphemeralWorkspaceAdapter
- Refactor static methods in EphemeralWorkspaceAdapter to their own
utility class
- Minor bugfixes

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2018-11-12 16:22:18 -05:00
Angel Misevski c0443e4060 Ensure plugin broker works with ephemeral workspaces
Changes necessary to ensure that plugin broker can work with ephemeral
workspaces, which, since they use emptyDir volumes, cannot share storage
between pods (as in the separate pod that runs plugin broker). This is
done by adding the plugin broker as an init container on ephemeral
workspaces.

Details:
- Change EphemeralWorkspaceAdapter to make check methods static, add
method to "make" a workspace ephemeral (to ensure how we check for
ephemeral workspaces is done in one place)
- Make PVC strategies include init containers in assigning volumes, to
ensure broker's volumes are correctly set when running as an init
container
- Add KubernetesBrokerInitContainerApplier, which modifies the workspace
env to include the broker as an init container.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2018-11-12 16:22:18 -05:00
Sergii Leshchenko 7b6cd44e36 CHE-11349 Make Kubernetes Infrastructure create workspace service account (PR #11834) 2018-11-08 08:36:42 +02:00
Sergii Leshchenko 88bcf79c27 Set null value for mountPropagation for volume of Plugin Broker and JwtProxy Pods
Kubernetes doesn't allow to create a Pod with volume where empty string
is specified as mountPropagation.
2018-11-07 11:35:27 +02:00
Angel Misevski 091f7d4221 Add selector to created Deployment spec
Seems that it is necessary with the move the kubernetes-client 4.1

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2018-11-07 11:33:13 +02:00
Angel Misevski ff88c136e5 Change use of deployments from extensions to apps API group
Deployments have been deprecated from the extensions API group, and are
now in the app API group instead.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2018-11-07 11:33:13 +02:00
Sergii Kabashniuk 58ca7c5690 Upgrade fabric8-kubernetes-client version to v.4.1.0 2018-11-07 11:33:13 +02:00
David Festal b5da3f821f
The PVC cleaning on workspace deletion is done in the wrong condition (#11840)
This is a fix for issue
https://github.com/redhat-developer/rh-che/issues/1026 (PVC is not
cleaned when workspace is deleted)

Signed-off-by: David Festal <dfestal@redhat.com>
2018-11-06 10:06:20 +01:00
Max Shaposhnik d7f18c7ac3
Add debug output for workspace startup (#11787) 2018-11-02 14:14:55 +02:00
Angel Misevski a6a7bff849 Share volumes between containers for ephemeral workspaces
Reuse emptyDir volumes for containers within the same pod, based on
machine volumes (e.g. workspace_logs mount same Volume for all
containers).

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
2018-10-30 23:04:49 -04:00
Roman Iuvshyn 365d25f275
RELEASE: Set next development version (#11710) 2018-10-24 16:38:03 +03:00
Sergii Leshchenko 057a418ca7 Add tracking of STARTING/STOPPING recovered k8s/OS runtimes (PR #11570) 2018-10-17 00:11:58 +03:00
Sergii Leshchenko 72749a00c6 Introduced RuntimeAbnormalStopping and RuntimeAbnormalStopped events (PR #11570) 2018-10-17 00:11:58 +03:00
Sergii Leshchenko 1862dd97c3 Fix propagating TimeoutException (PR #11570)
Since timeout exception has no message in this particular case
user saw `Workspace failed to start. Cause: null` when timeout exception
occured. Now TimeoutException is wrapped in InfrastructureException with
meaningful message and it is much clear what happened
2018-10-17 00:11:58 +03:00
Sergii Leshchenko 89a51b9e43 Move start timeout to StartSynchronizer (PR #11570)
It allows considering ingress wait timeout as part of start timeout
instead of considering them as non-related timeouts
2018-10-17 00:11:58 +03:00
Oleksandr Garagatyi a093e4ce54
Merge pull request #11596 from garagatyi/theiaBroker2
Adds an ability to run multiple plugin brokers on plugins provisioning phase. They all be part of a single pod.
Use bare pod instead of deployment for plugin brokering to avoid unwanted restarts of brokers.
Adds Theia plugin broker (which is not merged yet, but should be merged soon).
Allow ChePlugin and plugin brokers (by changing ChePlugins) to provide env vars that are provisioned in all the containers of the workspace. This enables brokers/plugins to share info with each other.
2018-10-15 13:15:16 +03:00
Sergii Kabashniuk 3e72212e8b
Add an ability to disable discover-ability of a plugin endpoint (#11617)
Add an ability to disable discover-ability of a plugin endpoint (#11617)
2018-10-15 13:08:09 +03:00
Oleksandr Garagatyi 851c3a8be7 fixup! fixup! fixup! fixup! Add workspaceEnv to plugin, populate it on sidecar resolving 2018-10-14 14:13:16 +03:00
Oleksandr Garagatyi 44a47a7bc1 fixup! fixup! fixup! Add workspaceEnv to plugin, populate it on sidecar resolving 2018-10-14 14:01:16 +03:00
Oleksandr Garagatyi 4919b1b361 fixup! fixup! Add workspaceEnv to plugin, populate it on sidecar resolving 2018-10-12 11:07:41 +03:00
Oleksandr Garagatyi 23eef0a7af fixup! Add workspaceEnv to plugin, populate it on sidecar resolving 2018-10-11 18:52:47 +03:00
Oleksandr Garagatyi caa36ae58c Add workspaceEnv to plugin, populate it on sidecar resolving
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-10-11 15:01:58 +03:00
Oleksandr Garagatyi 8eaad8543b Ensure correct memory request/limit are set
Ensure that all containers have memory request is set and not
bigger than memory limit.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-10-10 17:57:18 +03:00
Oleksandr Garagatyi aeb99f99f8 Set Memory request for JWT sidecar
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-10-10 17:57:18 +03:00
Sergii Kabashniuk 65bd65e23b Upgrade to new dependency mockito-testng (#10647) 2018-10-10 13:58:33 +03:00
Max Shaposhnik 127c433d8a
Define image pulling strategy for sidecars via configuration 2018-10-09 14:20:06 +03:00
Max Shaposhnik 251e5e261b
Sidecar container naming using plugin_name + che_container_name 2018-10-05 15:12:19 +03:00
Sergii Leshchenko 1e78fa4d6e Make Che Server listen to broker log and republish it as runtime log 2018-10-04 21:12:36 +03:00
Sergii Leshchenko a222971865 Replace MachineLogEvent with more abstract RuntimeLogEvent 2018-10-04 21:12:36 +03:00
Sergii Leshchenko 6abb78a189 Add RuntimeId to plugin broker events instead of workspace id field 2018-10-04 21:12:36 +03:00
Roman Iuvshyn 63b389c2fe
RELEASE: Set next development version (#11434)
* RELEASE: Set next development version
2018-10-04 18:25:39 +03:00
Oleksandr Garagatyi 46c74a92e7 Set k8s memory request wherever we set limit
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-10-03 09:14:20 +03:00
Oleksandr Garagatyi eb6b28d0e6
Merge pull request #11410 from garagatyi/secureWSNEXT
Make Theia sidecar/stack secure, add an ability to use new JWT auth on a per-workspace basis
2018-10-03 09:08:15 +03:00
Oleksandr Garagatyi b698aec6e6 Change error code cause it is occupied
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-10-03 09:07:31 +03:00
Oleksandr Garagatyi 1ddaeba154 Set JWT server exposer attribute to environment if auth is enabled
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-10-03 09:07:31 +03:00
Oleksandr Garagatyi 80923a2c48 Fix missing constants
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-10-03 09:07:31 +03:00
Oleksandr Garagatyi b157c63729 Add an ability to enable JWT security exposer from WS config attribute
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-10-03 09:07:31 +03:00