Che: Add volumes to machine configuration

Created on 26 Oct 2017  路  14Comments  路  Source: eclipse/che

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:

  • /projects folder attached to "ws-agent" machine is a sign to attach identified persistence storage to it
  • everything else (like an arbitrary PVC) described in an infrastructure specific recipe (docker volume mount, PVC etc).

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

kinenhancement statuopen-for-dev targeche6 teaplatform

Most helpful comment

Would be useful to persist .m2 and other development data

All 14 comments

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)

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:

  • to identify this declaration with PVC described in the recipe and make sure workspace conf is consistent
  • to apply some defaults (taking into account infra's configuration) - for ex add declared volume (infra should know how) as a PVC
    All the arbitrary PVC defined in recipe can just work (or not with clear message) as normally.

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)

Was this page helpful?
0 / 5 - 0 ratings