devfile: che plugins (vscode) and che editors should accept volumes
Description
In some case, we would like to share a volume with a che plugin
for instance with this devfile, where we want to share the same volume for the quay-io-quarku component and the java-ls component
but the java-ls does not accept volumes:
specVersion: 0.0.1
name: quarkus-che-demo
projects:
- source:
type: git
location: 'https://github.com/sunix/che-quarkus-demo'
name: che-quarkus-demo
components:
- alias: quay-io-quarkus-cent
type: dockerimage
image: quay.io/quarkus/centos-quarkus-maven
memoryLimit: 512M
mountSources: true
command:
- tail
args:
- '-f'
- /dev/null
volumes:
- name: mavenrepo
containerPath: /root/.m2
- type: chePlugin
alias: java-ls
id: redhat/java/0.43.0
memoryLimit: 2Gi
volumes:
- name: mavenrepo
containerPath: /root/.m2
- type: cheEditor
alias: theia-editor
id: eclipse/che-theia/next
-
alias: git-devtools
type: dockerimage
image: sunix/git-devtools
mountSources: true
memoryLimit: 256M
command:
- tail
args:
- '-f'
- /dev/null
commands:
- name: 'mvn compile quarkus:dev'
actions:
- type: exec
command: "kill -9 $(ps aux | grep 'java' | awk '{print $2}'); mvn compile quarkus:dev"
component: quay-io-quarkus-cent
workdir: /projects/che-quarkus-demo/sunix-quarkus-demo
But:
workspace:start --devfile=quarkus.devfile
✔ Retrieving Che Server URL...http://che-che.192.168.39.14.nip.io
✔ Verify if Che server is running
✖ Create workspace from Devfile quarkus.devfile
→ E_BAD_DEVFILE_FORMAT - Message: Devfile schema validation failed. Error: (/components/1/volumes):The object must not have a property whose name is "volumes".
Error: E_BAD_DEVFILE_FORMAT - Message: Devfile schema validation failed. Error: (/components/1/volumes):The object must not have a property whose name is "volumes".
at CheHelper.<anonymous> (/projects/chectl/src/api/che.ts:230:15)
at Generator.throw (<anonymous>)
at rejected (/projects/chectl/src/api/che.ts:16:65)
/projects/chectl #
OS and version:
Minikube/chectl with helm single user.
CC @l0rd @sleshchenko @metlos I'm not sure about this issue. Should be a ChePlugin busines to provide such volume. WDYT?
I think it makes sense to let users add volumes for plugin as well. There is no need to do that for GA though.
While in general I agree this is a good idea, in this concrete example it seems quite dangerous to me, because local maven repo is not "thread safe" and 2 parallel builds can corrupt it - https://issues.apache.org/jira/browse/MNG-2802. Not sure if we (or the user) can control the access to the repository done by the java plugin.
@metlos What is the difference with a classic use case?
- User runs maven from command line and
- at the same time the classic desktop Eclipse IDE is invoking maven
local maven repo is not "thread safe" and 2 parallel builds can corrupt it -
Yes, but it's no worse than running an Eclipse instance and maven cli in parallel.
I too need this feature of sharing files and folders between cheEditor and chePlugin and possibly other containers. Otherwise, I end up with copying several GB of files to both the containers.
@lord @davidfestal I have a question regarding this feature. Do you think it makes sense to add specific ephemeral attribute into single volume declaration, while we have an global persistVolumes attribute of devfile which affects all PV-s of all components as far as i understood.
It may produce some inconsistence if set all to true but mark some individual as ephemeral, but at the same time it will allow more flexibility to manage PV-s. WDYT?
cc @skabashnyuk @metlos @sleshchenko
@mshaposhnik what would you use such a feature for?
@tsmaeder which one? ephemeral per volume?
yes.
@lord @davidfestal I have a question regarding this feature. Do you think it makes sense to add specific
ephemeralattribute into single volume declaration, while we have an globalpersistVolumesattribute of devfile which affects all PV-s of all components as far as i understood. It may produce some inconsistence if set all totruebut mark some individual asephemeral, but at the same time it will allow more flexibility to manage PV-s. WDYT? cc @skabashnyuk @metlos @sleshchenko
@mshaposhnik I am not sure that we need ephemeral at single plugin level and it would be inconsistent with dockerimage.
Happy using!