question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It is not possible to run more than one Che 7 workspace at a time

See original GitHub issue

Description

If a Che 7 workspace is running and I try to start a new one I get the following error:

Message: services "theia" already exists

image

One possible solution to address this problem would be to suffix the name of services with the workspace id:

  • suffixing services with workspaceid would not be a problem for theia remote plugins as of today because they don’t use the hostname but localhost (since everything run in the same pod)
  • That may be a problem for some plugins anyway that want to contact a given service (e.g. the che hello world plugin)
  • We fix this in 2 steps:
    1. prefixing the name of the services with the workspace id when starting a che 7 workspace: that make it easy to start workspaces
    2. extending the API of the che plugin that @evidolob and IDE 2 are working on to retrieve the real endpoint of a service: that make it easy for plugins developers to consume other plugins APIs

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
garagatyicommented, Jan 25, 2019

A quick win could be:

  • Make Theia and exec not discoverable (the feature is already implemented), so they would not conflict when several workspaces are running. AFAIK nobody accesses them using service discovery now
  • Make Theia and VS Code brokers generate random endpoint names, so they would not conflict either

And here is a wider explanation of options we have and what are the pros and cons:

What we do now:

  • VS Code and Theia brokers:
    • Create endpoint with name port5690
    • Create Env Var to pass info about the plugin to theia container with value ws://port5690:5690
  • Che master creates k8s service with name equal to the endpoint name
  • Che plugin broker (the first one that uses tar.gz)
    • Gets endpoint from the configuration YAML
  • Che master creates k8s service with a name equals to the endpoint name for this broker

What options we have to allow running several workspaces in a single k8s namespace:

  1. Prefix with workspace ID service on wsmaster
  • VS Code and Theia brokers:
    • Create endpoint with name port5690
    • Create Env Var to pass info about the plugin to theia container with value (brokers know that endpoint will have one name but would be discoverable only after prefixing) ws://workspace12345678port5690:5690
  • Che master creates k8s service with a name that consists of workspace ID and endpoint name workspace12345678port5690​
  • Che plugin broker (the first one that uses tar.gz)
    • Gets endpoint from the configuration YAML, e.g. theia
  • Che master creates k8s service with a name that consists of workspace ID and endpoint name workspace12345678theia

Pros:

  • simple to implement Cons:
  • Brokers behavior is not consistent: if discoverability is needed endpoint should have a name that differs from the name used for service discovery
  • if we expose these k8s services over API as Che servers (we don’t at the moment) then server name would be also inconsistent either with the endpoint or k8s service
  • if we want to move brokering process from workspace start to registry than we can’t statically evaluate this since we don’t have workspace ID. We will need to have a placeholder in the env var.
  1. Let brokers prefix endpoint with workspace ID themselves:
  • VS Code and Theia brokers:
    • Create endpoint with name workspace12345678port5690
    • Create Env Var to pass info about the plugin to theia container with value ws://workspace12345678port5690:5690
  • Che master creates k8s service with name equal to the endpoint name
  • Che plugin broker (the first one that uses tar.gz)
    • Gets endpoint from the configuration YAML, e.g. theia
  • Che master creates k8s service with a name that consists of workspace ID and endpoint name workspace12345678theia

Pros:

  • brokers behavior is consistent: if service discovery is needed broker uses the same name for discovery and endpoint
  • if we expose these k8s services over API as Che servers (we don’t at the moment) then server name would be also consistent with endpoint and k8s service Cons:
  • if we want to move brokering process from workspace start to registry than we can’t statically evaluate this since we don’t have workspace ID. We will need to have a placeholder in the env var.
  • If some broker implementation would not prefix endpoint with workspace ID multiple workspaces with the same plugin would not start. We don’t actually have third-party broker implementation and this can be avoidable by reading docs. Doesn’t seem a problem for me now.
  1. Make service discovery depend on env vars instead of predictable service name:
  • Make Theia support a new way of discovering remote plugins runners:
    • Instead of just a link by which remote Theia is accessible use value env:SOME_ENV which means that actual value is written in SOME_ENV
  • VS Code and Theia brokers:
    • Create endpoint with name port5690
    • Create Env Var with value env:CHE_PLUGIN_ENDPOINT_port5690
  • Che master:
    • Creates k8s service with a name that consists of workspace ID and endpoint name workspace12345678port5690
    • Inserts following env var into all workspace containers: CHE_PLUGIN_ENDPOINT_<endpoint name> in our case CHE_PLUGIN_ENDPOINT_port5690 with value <endpoint protocol>😕/<workspace ID><endpoint name>:<endpoint port><endpoint path>
  • Che plugin broker (the first one that uses tar.gz)
    • Gets endpoint from the configuration YAML, e.g. theia
  • Che master creates k8s service with a name that consists of workspace ID and endpoint name workspace12345678theia and inserts env var CHE_PLUGIN_ENDPOINT_theia with value http://workspace12345678theia:3000 so if some plugin wants to connect to it it can read env var with a predictable name

Pros:

  • Consistent look of endpoint and server
  • Allows us to statically evaluate plugins config in the registry instead of on workspace start
  • Doesn’t make broker knows about prefixing which is not broker responsibility
  • Simple changes in brokers Cons:
  • more complex change
  • require the addition of a new way of discovering remote plugin runner in Theia if env var value is env:SOME_ENV then read the value from SOME_ENV

I would go with option 3 and here is how to do it in an iterable way:

  1. Disable discoverability in endpoints that don’t need it at the moment theia, exec sidecar
  2. Make VS Code and Theia brokers generate endpoints with workspace ID OR some random chars
  3. at this stage it would be possible to start several workspaces at the same time
  4. Add support of env:SOME_ENV to Theia
  5. Rework brokers to leverage this feature.

DONE!

1reaction
l0rdcommented, Dec 20, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Eclipse che - volume mount error while launching workspace ...
Try to run Che Workspace in debug mode.
Read more >
Chapter 3. Developer workspaces - Red Hat Customer Portal
By default, it is possible to run only one workspace at a time. To increase the number of concurrent workspaces a user can...
Read more >
Manage the WorkSpace running mode - AWS Documentation
To set the automatic stop time, select the WorkSpace in the Amazon WorkSpaces console, choose Actions, Modify Running Mode Properties, and then set...
Read more >
Introduction to Eclipse Che :: Eclipse Che Documentation
A centralized developer environment running on Kubernetes or OpenShift. · A multi-container workspace for each developer with the ability to replicate with a ......
Read more >
Start developing in the cloud with Eclipse Che IDE
Most of the time, I'm asked open-ended questions that do not have an absolutely ... I run both Code Ready Workspace 1.2 and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found