che icon indicating copy to clipboard operation
che copied to clipboard

Make devfile feature to be overridden

Open svkr2k opened this issue 7 years ago • 10 comments

Usage Scenario

Please consider the following usage scenario for eclipse/che: 1.Every user will need one workspace - it would be created when the user logs in and gets destroyed when the user logs-out/inactive. 2.If there are 50 users logged in, there would be 50 workspaces (one per user). All these workspaces shall be created using the same devfile (i.e., editor/tools are same) 3.but projects that the individual users see would be different - the projects shall come from database based on user login. 4.Guest users can also open the ide without logging in (and login later after opening the ide)

The solution I'd like

I shall set CHE_LIMITS_USER_WORKSPACES_RUN_COUNT to '1' and this would allow having only one running workspace per user => This, I believe, would result in an error (saying that only one workspace can be opened per user).

In order to achieve the above behavior, the https://github.com/eclipse/che/tree/master/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/devfile needs to be modified. But, I believe that the above devfile feature is not meant to be overridden.

Alternatives

None. I would prefer it to be overridden instead of forking the entire codebase and modify the behavior.

Additional context

Thank you, @ibuziuk for advise.

svkr2k avatar Aug 05 '19 08:08 svkr2k

@skabashnyuk @ibuziuk are you missing some details on this issue ?

benoitf avatar Aug 05 '19 08:08 benoitf

  1. but projects that the individual users see would be different - the projects shall come from database based on user login.

I personally do not understand the last part of the flow:

  • if devfiles are the same why the projects need to be different?
  • why it is required to store projects in db instead of cvs?
  • how "projects that the individual users see would be different" is planned to be achieved? is there some mapping between user and project ?

In general, the use-case is really specific and I personally do not see it as part of the upstream.

Every user will need one workspace - it would be created when the user logs in and gets destroyed when the user logs-out/inactive. If there are 50 users logged in, there would be 50 workspaces (one per user). All these workspaces shall be created using the same devfile (i.e., editor/tools are same)

Similar functionality can be achieved by using the combination of:

  • CHE_LIMITS_USER_WORKSPACES_RUN_COUNT - 1 running workspace per user
  • CHE_WORKSPACE_AGENT_DEV_INACTIVE__STOP__TIMEOUT__MS - workspace will be shutdown after some inactivity period

ibuziuk avatar Aug 05 '19 08:08 ibuziuk

@svkr2k can you take a look https://github.com/eclipse/che/issues/13617 it will allow to override project location. Will it work for you?

skabashnyuk avatar Aug 05 '19 08:08 skabashnyuk

@ibuziuk , @skabashnyuk . Thank you for suggestions. I shall try my best to clarify :-)

if devfiles are the same why the projects need to be different?

i'm thinking of a system, using which, several users can:

Login->Create or Work on created projects (using custom editor & toolset)->Save their projects->Logout->Come back later and ... (cycle repeats)

None of the users share the projects projects that they had created and they all develop independently. So, each user would have a set of projects that he/she created (needs mapping between user and projects he/she created). When an user logs in, the user can open & work on one of the projects that he/she created during previous login.

I'm open to suggestions on where/how the user project(s) can be stored...

Also, unlike che dashboard that supports multiple devfiles, the system that i'm thinking of would support only one devfile (with editor & tools fixed) and a workspace would be created using this devfile automatically when user logs in. (so, the user would not see any devfile being involved).

svkr2k avatar Aug 05 '19 10:08 svkr2k

@svkr2k did you tried to play with CHE_LIMITS_USER_WORKSPACES_RUN_COUNT variable?

skabashnyuk avatar Aug 05 '19 11:08 skabashnyuk

@svkr2k did you tried to play with CHE_LIMITS_USER_WORKSPACES_RUN_COUNT variable?

@skabashnyuk, I havent tried this yet. i shall try this soon.

svkr2k avatar Aug 05 '19 11:08 svkr2k

Updated usage scenario (added no.4) to the original comment.

svkr2k avatar Aug 06 '19 03:08 svkr2k

@svkr2k Usecase 1-3 should be possible to do at this moment. 4. unlikely would happen

skabashnyuk avatar Aug 07 '19 11:08 skabashnyuk

Usecase 1-3 should be possible to do at this moment.

Thank you @skabashnyuk, Are usecases 1-3 already supported in 7.4.0 ?

svkr2k avatar Nov 14 '19 07:11 svkr2k

  1. It can be stopped by timeout not deleted by logout.
  2. Default configuration option 1 workspace per user.
  3. Projects will come from the git server. Github for example.

skabashnyuk avatar Nov 14 '19 07:11 skabashnyuk