-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate plugin/editor component environment variables #15435
Conversation
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) ℹ️ |
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that having to set the plugin id on components is a difficult situation, I think it might be cleaner to update our model and the plugin broker, as I feel like we'll run into the situation of components without IDs more in the future.
@@ -124,8 +128,16 @@ public void apply( | |||
|
|||
Collection<CommandImpl> pluginRelatedCommands = commandsResolver.resolve(chePlugin); | |||
|
|||
DevfileImpl devfile = k8sEnv.getDevfile(); | |||
Optional<ComponentImpl> pluginRelatedComponentOpt = devfile.getComponents().stream() | |||
.filter(c -> chePlugin.getId().equals(c.getId())).findAny(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about updating the ChePlugin model to include a source
field, where we could set either plugin ID or reference as a unique identifier in the plugin broker (I can implement this side if it helps). If the Che server is going to start downloading plugin metas it may as well do all the work in the broker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does not change a lot but makes a things a bit cleaner. Added the corresponding TODO
@@ -151,6 +153,10 @@ public InternalEnvironment setWarnings(List<Warning> warnings) { | |||
return attributes; | |||
} | |||
|
|||
public DevfileImpl getDevfile() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To solve the issue with env vars propagating we could instead of putting here Devfile introduce two fields: Component editor
, List<Component> plugins
, and then use this as one storage instead of putting workspace config attributes + whole devfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds OK for me at this stage, since devfile contains a lot of info which is unused here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe another solution to the problem solved by explicitly setting the id of editors and components would be if we stored Map<String, Component>
for editors and plugins (or maybe separately, not sure) where the key would be the resolved FQN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried and failed.
Editor/Plugin component now is in workspace module (not k8s specific).
Moving editor/plugin configuration into environment would mean that we need make editor/plugin components do k8s/os infra specific and I'm not sure that it's a good think to do.
We also would be able to introduce editor/plugins in workspace config level BUT now they are in workspace config attributes which are propagated like in many places, and it would mean that we should propagate editor/plugins as a separate arguments to all places where it's needed...
And I'm not sure that we should invest time into such evolution. The more meaningful change would be to get rid of WorkspaceConfig at all, but it requires quite a lot of changes.
It seems that putting while Devfile into WorkspaceConfig and InternalEnvironment is the quickest option.
ec46260
to
42a04ee
Compare
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) ℹ️ |
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) ℹ️ |
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
// TODO it's needed to introduce source field into ChePlugin object with the following structure | ||
// String registryUrl | ||
// String id | ||
// String reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought was to update ChePlugin
to have a field source
that is just a string with either
source: <reference>
or
source: id // or registryUrl/id if applicable
but I agree that this makes sense as a future consideration; it would be easier to implement after the brokers refactor is mergd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source: id // or registryUrl/id if applicable
I believe having single string value would make a component to che-plugin matching harder...
Component has
id
registryUrl //optional - default will be used if omitted
reference
if plugin broker used default plugin registry - should it be included into source?
if yes - Che Server then should do the same defaultPluginRegistry+id, or cut id from source and then compare it.
But Che Server does not know for sure what is value of source field...
not sure if I clearly share my concerns BTW it's good that we agreed that it could be improved as a future consideration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm not sure on the best approach. I'll need to think about it more -- my initial idea was to have source
match the attribute on the WorkspaceConfig
, so that it could just be parsed, but maybe that complicates things.
If adding the whole devfile into workspace config is a working solution, that may just be easier.
...lipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplier.java
Outdated
Show resolved
Hide resolved
@@ -151,6 +153,10 @@ public InternalEnvironment setWarnings(List<Warning> warnings) { | |||
return attributes; | |||
} | |||
|
|||
public DevfileImpl getDevfile() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe another solution to the problem solved by explicitly setting the id of editors and components would be if we stored Map<String, Component>
for editors and plugins (or maybe separately, not sure) where the key would be the resolved FQN.
80dd818
to
822a1b3
Compare
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) |
E2E tests of Eclipse Che Multiuser on OCP has been successful:
|
@sleshchenko : This work is also important for this issue eclipse-che/che-theia#429 . We need to test the pull request in the context of configuring a settings.xml for the project and language server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tested using your image and devfile and it works as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a small improvement in the error messages suggested.
...lipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplier.java
Outdated
Show resolved
Hide resolved
822a1b3
to
b30f16f
Compare
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
b30f16f
to
294cf4e
Compare
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) |
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) |
E2E tests of Eclipse Che Multiuser on OCP has been successful:
|
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1) ℹ️ |
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
What does this PR do?
It introduces a new feature: propagating plugin/editor component environment variables.
This is archived by the following architecture change:
Now we propagate the whole Devfile along with WorkspaceConfig and InternalEnvironment and it makes it possible to access components configuration and apply it on plugin brokering phase.
What can be done better maybe in scope of separate PRs:
EditorComponentToWorkspaceConfigApplier
/PluginComponentToWorkspaceConfigApplier
modifies components that was originally passed. It's needed to make it possible to match component (configured with reference) with ChePlugin provided by plugin broker. As an improvement, we can get rid of it but Plugin Broker should provide additional information where it downloaded ChePlugin configuration. More see Propagate plugin/editor component environment variables #15435 (comment)How to test this PR
sleshchenko/che-server:env-vars
Devfile
What issues does this PR fix or reference?
#14343
Release Notes
N/A
Docs PR
eclipse-che/che-docs#966