Skip to content
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 default ephemeral mode value #15713

Conversation

sleshchenko
Copy link
Member

@sleshchenko sleshchenko commented Jan 16, 2020

What does this PR do?

🚧 It's suspended in favor of #15775
In the scope of issue about configurable Dashboard #15462, the default value of ephemeral mode should be configurable as well.
But Che Server already contains hard-coded behavior for persistVolumes (it's true), that can be overridden with the corresponding attribute on workspace level.
It makes more sense to make Dashboard consume Che Server default instead of configuring a separate default for it.
So, this PR makes Che Server propagating default ephemeral mode value.

Open question: to avoid reconfiguring existing workspaces, Dashboard must set default value explicitly (even if the user does not click on the toggle at all)

What issues does this PR fix or reference?

#15462

@centos-ci
Copy link

Can one of the admins verify this patch?

@che-bot che-bot added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/task Internal things, technical debt, and to-do tasks to be performed. labels Jan 16, 2020
@sparkoo
Copy link
Member

sparkoo commented Jan 16, 2020

To comment your question, I definitely vote for setting the value explicitly from the dashboard. If user does not click on the toggle, there is still some value set, so we can't get into some undefined state here. And as you said, we avoid some hidden unexpected behavior and possible inconsistencies between dashboard and server.

@che-bot
Copy link
Contributor

che-bot commented Jan 16, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@che-bot
Copy link
Contributor

che-bot commented Jan 16, 2020

E2E tests of Eclipse Che Multiuser on OCP has failed:

@skabashnyuk
Copy link
Contributor

vote for setting the value explicitly

skabashnyuk
skabashnyuk previously approved these changes Jan 16, 2020
@sleshchenko sleshchenko changed the title Propagate default ephemeral mode value WIP Propagate default ephemeral mode value Jan 16, 2020
@sleshchenko sleshchenko changed the title WIP Propagate default ephemeral mode value [WIP] Propagate default ephemeral mode value Jan 16, 2020
@sleshchenko sleshchenko requested a review from ibuziuk as a code owner January 21, 2020 13:18
@sleshchenko sleshchenko force-pushed the propagateDefaultPersistVolumeBehaviour branch from 956d17c to 03e6439 Compare January 21, 2020 13:19
@che-bot
Copy link
Contributor

che-bot commented Jan 21, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@che-bot
Copy link
Contributor

che-bot commented Jan 21, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@che-bot
Copy link
Contributor

che-bot commented Jan 21, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@che-bot
Copy link
Contributor

che-bot commented Jan 21, 2020

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@sleshchenko sleshchenko changed the title [WIP] Propagate default ephemeral mode value Propagate default ephemeral mode value Jan 21, 2020
public boolean isEphemeral(Map<String, String> workspaceAttributes) {
String persistVolumes = workspaceAttributes.get(PERSIST_VOLUMES_ATTRIBUTE);
if (persistVolumes == null) {
return !defaultPersistVolumes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the logic we want to go with -- I'd propose

  • If persistVolumes is not present, assumed default value is true.
  • Only use ephemeral mode when persistVolumes is explicitly false.

This avoids the need to set it explicitly in all devfiles, and avoids breaking existing workspaces by disconnecting them from existing PVCs.

On the workspace creation side (e.g. in the dashboard), this would be handled by explicitly setting persistVolumes: false if necessary, and leaving it out of the devfile otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put another way: if

  • che.workspace.persist_volumes.default=false, any workspaces created will additionally have persistVolumes: false in their devfiles upon creation.
  • che.workspace.persist_volumes.default=true, workspaces don't get an added persistVolumes field.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to give an ability for Che Admin to configure default behavior of persisting volumes...
AFAIU you propose to keep the current Che Server logic where explicit value is used or volumes are persisted by default and only propagate default value to be consumed by clients like Dashboard.
I agree that it's safer in the perspective of existing workspaces without explicit values, where users do not expect changing behavior.
On another hand, Che Admin configured value won't be set to all workspaces by default, even new if workspaces are created with another client but not Dashboard - like chectl, or factory(if the value is not set explicitly in devfile).
I'm OK with the proposed alternative way since it's a lighter way that does not change the current Che Server behavior and at the same time allows us to configure Dashboard behavior via Che Server configuration.

@sleshchenko sleshchenko changed the title Propagate default ephemeral mode value 🚧 Propagate default ephemeral mode value Jan 22, 2020
@skabashnyuk skabashnyuk dismissed their stale review January 22, 2020 09:00

I believe we need to reevaluate this pr.

@metlos
Copy link
Contributor

metlos commented Jan 23, 2020

Being late to the discussion as usual - I think the che server admin should have the ability to force all the workspaces to be ephemeral. Consider a "playground" che installation where really nothing should ever be stored because it is just for "fooling around".

But maybe that would better be done differently than providing a default value for an ephemeral mode. Maybe we could have a permission to create (non-)ephemeral workspaces that admin could grant to users?

@amisevsk
Copy link
Contributor

amisevsk commented Jan 23, 2020

@metlos I think #15775 supersedes this PR. On the topic of allowing an admin to force ephemeral mode, I think it creates too many edge cases to be something we want to support:

  • If an admin turns the feature on, all data in existing workspaces is lost
  • If the admin turns the feature off, workspace configs change in an unpredictable way and may cause issues that are very hard to diagnose
  • If the default setting is decided by an property and not devfiles, we potentially leak data in persistent volumes if they aren't properly cleaned.
  • Forcing the option makes it impossible to debug some issues unless you have admin access, since you would only be able to create ephemeral workspaces.

The difference between ephemeral and non-ephemeral is significant enough that I think it should be stored explicitly in devfiles.

@sleshchenko
Copy link
Member Author

The alternative solution is already merged in #15775

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants