Skip to content
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

Support mountSources for non-plugin tools in devfile #12554

Closed
2 tasks done
metlos opened this issue Jan 30, 2019 · 4 comments
Closed
2 tasks done

Support mountSources for non-plugin tools in devfile #12554

metlos opened this issue Jan 30, 2019 · 4 comments
Assignees
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.

Comments

@metlos
Copy link
Contributor

metlos commented Jan 30, 2019

The che plugins can now specify whether or not they want to have the root of source directories mounted
to their containers using the mountSources attribute (which causes the volume with sources to be mounted into the container on location specified by the CHE_PROJECTS_ROOT env variable available to the container).

We should also add this functionality to devfile to support the same mechanism for tools that are not implemented using a che plugin.

@skabashnyuk skabashnyuk added kind/task Internal things, technical debt, and to-do tasks to be performed. team/platform labels Jan 30, 2019
@sleshchenko
Copy link
Member

It is already implemented for dockerimage tool in the following PR #12649

@skabashnyuk skabashnyuk added the severity/P1 Has a major impact to usage or development of the system. label Mar 6, 2019
@sleshchenko
Copy link
Member

The issue with mountSources for k8s/os components is the following:
Currently mountSources is a boolean and may be specified for dockerimage component only.
For k8s/os component, true/false mountSources would mean that it is/isn't needed to mount sources to all containers of component (there can be multiple pods, with multiple containers inside).
And a user may need more flexibility and it would be nice to provide an ability to specify containers where projects sources are needed. For example, this Devfile[1] contains k8s component that has two containers - mongo and nodejs-app, and only nodejs-app needs projects sources.
The solution here might be introducing a format that is similar to entrypoints:

  - type: kubernetes
    alias: employee-manager
    reference: deploy_k8s.yaml
    sourcesMounts:
    - parentName: podName
      parentSelector:
        labelKey: labelValue
      containerName: nodejs-app

The issue with such format - it is not clear how to specify sourceMounts for all containers of a component.

The possible resolutions of this issue that I see:

  1. Implement mountSources: true/false for k8s/os component and mount projects PVC into all containers of k8s/os component. It's easy to implement and use solution but it may slow down some workspaces since undeeded volumes may be used.
  2. Investigate more about a possible format that would give an ability to mount projects sources to all containers or specified ones (I assume with parentName, parentSelector, containerName fields).

@skabashnyuk @metlos @mshaposhnik @l0rd WDYT?

[1] https://github.com/sleshchenko/NodeJS-Sample-App/blob/master/devfile.yaml

@l0rd
Copy link
Contributor

l0rd commented May 23, 2019

@sleshchenko I would not change that now. Your issue makes sense but the solution you propose is still complicated. And I don't consider it urgent because multi-pod workspaces are still not supported currently and for multi-container components we can just continue mounting sources on all containers (or splitted the multi-container component in multiple components with a single container).

@rhopp rhopp mentioned this issue May 28, 2019
25 tasks
@l0rd
Copy link
Contributor

l0rd commented May 28, 2019

@sleshchenko @skabashnyuk @metlos I figure out that my comment above may be misleading. What I wanted to say is:

  • It's important that we support mounting sources for any component type
  • In multi-container components we should mount sources on every container
  • We can ignore multi-pod workspaces scenarios for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

5 participants