Closed AObuchow closed 1 year ago
I wonder if we could just move all configuration in the UDI to point to /home/tooling/
instead of /home/user/
?
Edit: I tested this approach, and it seems to work so far, though there might be some issues I haven't seen yet. I made quay.io/aobuchow/universal-developer-image:tooling-dir
if anyone wants to try it out, though I forgot to set $HOME back to /home/user/
in that image.
So far, my proposed solution for this issue is as follows:
/home/user/*
to /home/tooling/
.
$HOME
to /home/tooling/
during the installation of packages, .bashrc modifications, etc and then setting $HOME
back to /home/user/
afterwards, so that $HOME
remains unchanged when the container is in use. stow
to create symlinks for everything in /home/tooling/
(located in the pod's ephemeral storage) to point to /home/user/
(which is located on the PVC). Symbolic links should work better than directly copying between /home/tooling/
and /home/user/
, as it will allow for easily swapping out the contents of /home/tooling/
when the UDI is updated. If we were to copy, we'd have deleted the outdated contents on the PVC first before re-copying the update UDI contents (and face other complications)Implementing 2. requires a post-start event on the workspace pod to invoke stow
after the PVC has been mounted (otherwise any symbolic links created by stow
will be overwritten by the PVC's /home/user/
directory).
I don't think it makes sense to have DWO insert this specific post-start event, as the post-start event relies on the existence of /home/tooling
and stow
being installed on the workspace container image. Overall, the issue at hand (and my proposed solution) is more specific to Che and the UDI rather than DWO itself.
Thus, the User Dashboard could potentially insert this post-start event into devworkspaces.
Alternatively, DWO + Che-Operator could insert this post start event in a more generic way:
config.workspace.events.default.postStart
Any thoughts on the overall proposed solution, and whether we should take a User Dashboard or Che-Operator + DWO approach? @amisevsk @l0rd @ibuziuk
It might make sense to include the stow step in the entrypoint.sh of the UDI image, if we're taking this approach.
It might make sense to include the stow step in the entrypoint.sh of the UDI image, if we're taking this approach.
This would be the nicest solution, however I couldn't get it to work.
Adding the stow step to the entrypoint worked when running the UDI with docker as a container in isolation, but it didn't seem to work in a che-code workspace (which is weird, because we moved the Che-Code entrypoint logic to a post-start command, and kubedock depends the entrypoint already).
I might have made a mistake somewhere in my attempt, though.
It might make sense to include the stow step in the entrypoint.sh of the UDI image, if we're taking this approach.
This would be the nicest solution, however I couldn't get it to work.
Adding the stow step to the entrypoint worked when running the UDI with docker as a container in isolation, but it didn't seem to work in a che-code workspace (which is weird, because we moved the Che-Code entrypoint logic to a post-start command, and kubedock depends the entrypoint already).
I might have made a mistake somewhere in my attempt, though.
:facepalm: My devfile had was overwriting the entrypoint of the container. @amisevsk's suggested solution of using the UDI's entrypoint to run the stow step works as expected.
would it be feasible to copy /home/user content from udi image to the mounted volume when the workspace starts the first time ?
would it be feasible to copy /home/user content from udi image to the mounted volume when the workspace starts the first time ?
It's potentially feasible, but the current UDI container stores quite a bit of data in /home/user
. Copying this data into the persistent volume might cause other issues (increasing time before workspace is ready, consuming ~2 GB of data in the PV needlessly).
what is the resolution on this for users that use their own custom image instead of the udi?
Describe the bug
https://github.com/eclipse/che/issues/22102 added support for automatically mounting the
/home/user/
directory to a PVC. However, in the UDI, the/home/user/
directory has configurations and tools that are overwritten whenspec.devEnvironments.persistUserHome.enabled: true
is set in the Che Cluster CR. This is caused by the PVC's/home/user/
directory being mounted overwriting the UDI's/home/user/
directory.Many environment variables in the UDI point to
/home/user/
, bash completions are stored in/home/user/.bashrc
. This also affects $PATH, which references/home/user/
.For example, grepping /home/user/ in the UDI dockerfile:
Grepping /home/user/ in $PATH:
Che version
7.72@latest
Steps to reproduce
spec.devEnvironments.persistUserHome.enabled: true
in the CheCluster CRmvn
command, it will show that it could not be found as it is no longer in the expected location on $PATHExpected behavior
All environment variables and commands that were configured to use
/home/user/
should work as expected whenspec.devEnvironments.persistUserHome.enabled: true
in the CheCluster CRRuntime
OpenShift
Screenshots
No response
Installation method
OperatorHub
Environment
Linux
Eclipse Che Logs
No response
Additional context
No response