-
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
Support entrypoint definition in dockerimage recipe based workspaces on k8s and os #12716
Support entrypoint definition in dockerimage recipe based workspaces on k8s and os #12716
Conversation
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.
Draft LGTM.
Let's move on PR ready to review
It would be nice to see different commits for entrypoint and additional check for dockerimage
environment.
...e-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/config/MachineConfig.java
Outdated
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/docker/environment/dockerimage/EntryPointParser.java
Outdated
Show resolved
Hide resolved
@garagatyi Please take a look too |
b02a910
to
c19e664
Compare
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 be honest I think that this functionality should be implemented with a different approach.
Current solution brings a lot of code that not really needed. What if we just convert Dokerimage environment to K8s environment using existing converter and add entrypoint, command arguments, etc?
This should eliminate a need for all this code.
@sleshchenko @metlos WDYT?
@garagatyi I do not see how your proposal may reduce the amount of code. Can you elaborate more? |
Our dockerimage environment doesn't understand entrypoints, AFAIK, and enhancing docker support when we're about to drop it is IMHO not the way to go. That's why I only added the support for it to k8s env. As @sleshchenko, I don't see where would save a lot of code here though if we went down the route of adding support for entrypoint to dockerimage and added support for the also to the converter. |
In this case, I think it would be counterproductive if we wanted to use 2 different formats for encoding entrypoints in workspace config and in the devfile (which is YAML). If we wanted to have a custom "comma separated list of commands", we'd need a parser (in workspace config) and serializer (in devfile) for that. I the approach I chose, we can use just the |
@sleshchenko If we avoid direct implementation of entrypoint and command support in dockerimage workspace recipe (Che 6 stuff) we would do:
With this approach we would not need anything from this PR at all.
Well, I'm suggesting not to improve dockerimage recipe at all since it brings new attributes, parsing, etc. And this PR adds entrypoint/args case as machine config attribute which would not be needed when we replace workspace config with devfile usage, eventually. |
@metlos I think improving outdated format with additional attributes is not productive. |
ATM devfile "appliers" convert devfile into workspace config. If we were to take a different approach here, we would have to reimplement the whole of devfile conversion, which I think is not practical at this point in time. The amount of code added here is not that huge to justify rewriting everything devfile we have. |
After discussion with @sleshchenko and @metlos we agreed that:
|
...rg/eclipse/che/workspace/infrastructure/docker/environment/dockerimage/EntryPointParser.java
Outdated
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/docker/environment/dockerimage/EntryPointParser.java
Outdated
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/docker/environment/dockerimage/EntryPointParser.java
Outdated
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/docker/environment/dockerimage/EntryPointParser.java
Outdated
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/docker/environment/dockerimage/EntryPointParser.java
Outdated
Show resolved
Hide resolved
...a/org/eclipse/che/workspace/infrastructure/kubernetes/environment/util/EntryPointParser.java
Outdated
Show resolved
Hide resolved
...e-api-model/src/main/java/org/eclipse/che/api/core/model/workspace/config/MachineConfig.java
Show resolved
Hide resolved
...a/org/eclipse/che/workspace/infrastructure/kubernetes/environment/util/EntryPointParser.java
Outdated
Show resolved
Hide resolved
ci-test |
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.
A few comments
...space/infrastructure/kubernetes/environment/convert/DockerImageEnvironmentConverterTest.java
Outdated
Show resolved
Hide resolved
...workspace/infrastructure/kubernetes/environment/convert/DockerImageEnvironmentConverter.java
Outdated
Show resolved
Hide resolved
Results of automated E2E tests of Eclipse Che Multiuser on OCP: |
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
Please take a look my inline comments
...in/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/util/EntryPoint.java
Show resolved
Hide resolved
ci-build |
ci-test |
Results of automated E2E tests of Eclipse Che Multiuser on OCP: |
ci-test |
Results of automated E2E tests of Eclipse Che Multiuser on OCP: |
ci-test, pretty please? |
Results of automated E2E tests of Eclipse Che Multiuser on OCP: |
ci-test |
...in/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/util/EntryPoint.java
Show resolved
Hide resolved
...e/workspace/infrastructure/docker/environment/dockerimage/DockerImageEnvironmentFactory.java
Show resolved
Hide resolved
Results of automated E2E tests of Eclipse Che Multiuser on OCP: |
defined with the dockerimage recipe. Note that this only works in kubernetes and openshift environments. Signed-off-by: Lukas Krejci <[email protected]>
21edf1b
to
b52ee40
Compare
rebased and squashed on top of latest master before merge |
What does this PR do?
$TITLE
.More specifically, this makes sure that at most 1 machine is defined on dockerimage based workspace and if that machine contains
containerCommand
attribute, it is parsed as a YAML list and supplied as the entrypoint command of the container. Additionally ifcontainerArgs
is present, it is also parsed as a YAML list and supplied as custom arguments to the entrypoint command.What issues does this PR fix or reference?
#12668
Release Notes
Docs PR