-
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
CHE-1489: rework workspaces folder usage to fix Che on some configs #1733
Conversation
Signed-off-by: Alexander Garagatyi <[email protected]>
@eivantsov @TylerJewell @evoevodin @sleshchenko @mmorhun Please review |
@garagatyi - please document the property name & how it can be configured. |
@eivantsov - FYI, I am unable to build a docker image for this on a windows box right now. There seems to be some problems with docker for windows and CRLF for newlines. Can you build an image that has this change and put it on docker hub for testing? |
…nfigs Signed-off-by: Alexander Garagatyi <[email protected]>
+1 |
@TylerJewell here's how you may try the fix:
In the current directory, create che.properties file with |
final Path cheHome = WindowsHostUtils.ensureCheHomeExist(createFolders); | ||
final Path vfs = cheHome.resolve("vfs"); | ||
if (createFolders) { | ||
if (!vfs.toFile().mkdir()) { |
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.
There is no need to use nested if
statement
LGTM |
…some configs Signed-off-by: Alexander Garagatyi <[email protected]>
@TylerJewell Are you OK with that PR? Can I merge it? |
|
che.user.workspaces.storage.create_folders |
…Che on some configs Signed-off-by: Alexander Garagatyi <[email protected]>
Renamed |
@garagatyi @eivantsov - it failed for me. Server was unable to boot and gave an error message in the console below.
|
Please send me privately your external conf file |
@garagatyi @eivantsov - Ok, got things to work after some reconfiguration. We will have to make it really clear for users that they may have to reset their docker for windows credentials to gain access otherwise they may get exception failures. Can we please change the default che.properties file that ships to have the following comment modified.
Can we also rename these two properties to:
The run syntax that finally worked:
|
@TylerJewell here is current comment
Do you want to have next comment instead?
|
If we rename property che.user.workspaces.storage then users with configured external property files will miss the projects after upgrade. Are you OK with that? |
|
@garagatyi - yes, ok with the breaking change. Is there anyway we can quietly support the old configuration in our code? So that there are two properties for the same value? We will only document and show the new one but quietly honor the old? |
Yes, it is possible |
@garagatyi - ok, after changes of comments and property names, +1 from me - ok to merge. |
@TylerJewell What then do if both old and new properties are set? |
@garagatyi - accept new one, I think. |
Looks like we will have to accept the old one because it will be the case when user overrided old property and then upgraded Che. |
…to fix Che on some configs Signed-off-by: Alexander Garagatyi <[email protected]>
checkProps(workspacesMountPoint, hostProjectsFolder); | ||
this.isWindows = SystemInfo.isWindows(); | ||
String allowFoldersCreationEnvVar = System.getenv(ALLOW_FOLDERS_CREATION_ENV_VARIABLE); | ||
if (allowFoldersCreationEnvVar != null) { |
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.
You can remove this check. Or merge with next by &&
I prefer first variant
LGTM |
@garagatyi - did this improvement remove the need for the volume mount? If so, once eugene creates a new image, I can test. Otherwise LGTM. |
… usage to fix Che on some configs Signed-off-by: Alexander Garagatyi <[email protected]>
Yes. You don't have to mount workspaces folder into Che container if folders creation is disabled (e.g. in your case). |
@garagatyi - can we add an environment variable for Also, to start the process of more consistency - I updated the name of the properties and the environment variables that match. Sorry for moving this around. I had to write some docs on this and get a feel before I could settle in on a standard.
|
Documentation update: |
Build # 1227 - FAILED Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1227/ to view the results. |
… folder usage to fix Che on some configs Signed-off-by: Alexander Garagatyi <[email protected]>
Build # 1228 - FAILED Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/1228/ to view the results. |
Now mounting /workspaces folder into Che container is not needed. storage path can be set with env variable |
What does this PR do?
Fixes storing FS of workspaces between Che runs in case Che runs in the container.
Removes unneeded provider.
What issues does this PR fix or reference?
Fixes #1711
Previous Behavior
Che tried to create folders of projects roots of workspace on start of new workspace.
So path of projects root of workspace has to match in Che container and on docker host.
New Behavior
It is possible to define property or environment variable to disable creation of workspace folder by Che.
In that case docker will create folders mounted to workspace container on host. This folder will have root permissions.
Tests written?
Old tests were fixed. No new tests are added yet.
Docs requirements?
Include the content for all the docs changes required.
New instructions on how to run Che in container would be useful.