Since in Che6 we move to multicontainer/sidecar way it become more important to be able to describe "interesting for workspace" persistence storage as a part of workspace configuration.
Currently, there are two ways to describe in a case of attaching (mounting, syncing etc) volumes (folders) with persisted data:
It is proposed to add "volumes" section into workspace->environment->machine config, like:
volumes:
<name>:
path:</path/to/machine's/folder>
properties:{} - do we need that as option?
@garagatyi @sleshchenko @skabashnyuk
Would be useful to persist .m2 and other development data
how the "path" attribute is working in the case of a PVC ?
I think path field will be used for definition of mountPath in case of PVC https://docs.openshift.com/enterprise/3.1/dev_guide/persistent_volumes.html#claims-as-volumes-in-pods
@sleshchenko the persistence volume name used to do the mount will be inside properties attributes ? because I read
"properties:{} - do we need that as option?"
properties might do mounting behavior not consistent across different infrastructure implementations. So, we should think whether we should add them
As far as I understand, the mapping in this case can be:
volumes:
<name>: - PVC name
path:</path/to/machine's/folder> - mountPath
@gazarenkov ok name was not documented so I was thinking it was not acting as the 'source' name
name doesn't have to be exactly PVC name, we just need an ability to match specific PVC to a volume from our model. Technical solutions can be different.
Technical solutions can be different.
For example, we can put the corresponding label with Che Volume name into PVC metadata.
And where can we specify subpath
like for example
new VolumeMountBuilder()
.withMountPath(cheWorkspaceProjectsStorage)
.withName(workspacesPersistentVolumeClaim)
.withSubPath(subPath)
https://docs.openshift.com/container-platform/3.4/dev_guide/volumes.html#volumes-specifying-a-subpath
I do not think we should (and can) cover all the infrastructure features.
I think we need some policies for "known" cases (such as /projects folder) to be able:
I agree that we can't cover all infrastructure features, but using a specific folder from a volume looks like a basic features. (It's also a feature used in OpenShiftConnector in 5.x)
@benoitf can you elaborate on how do you see it work for both openshift and docker infrastructures for some recipe supported by both, e.g. compose (not supported now, though)
Most helpful comment
Would be useful to persist
.m2and other development data