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 for Environment Variables in Plugins and Editors #14343

Closed
kameshsampath opened this issue Aug 27, 2019 · 13 comments
Closed

Support for Environment Variables in Plugins and Editors #14343

kameshsampath opened this issue Aug 27, 2019 · 13 comments
Labels
kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@kameshsampath
Copy link
Contributor

As developer I wish to use my internal nexus repository as a maven mirror for all the components of Che. Currently when I configure Che with Java project and I use MAVEN_MIRROR_URL env to do some mirror settings, the vscode java8 language server is still trying to reach to Maven central for the artefacts instead of local maven mirror (if one deployed)

@kameshsampath kameshsampath added the kind/enhancement A feature request - must adhere to the feature request template. label Aug 27, 2019
@kameshsampath
Copy link
Contributor Author

@metlos @l0rd @gorkem ^^

@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 27, 2019
@l0rd l0rd added severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Aug 27, 2019
@tsmaeder
Copy link
Contributor

I don't understand what is being suggested here. The maven repo is controlled by the the maven settings.
Are you suggesting that the images running VS Code-Java are picking up the MAVEN_MIRROR_URL env variable and passing that on as configuration to VS Code Java?

@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 28, 2019
@skabashnyuk
Copy link
Contributor

I think the idea is something like that

---
apiVersion: 1.0.0
metadata:
  generateName: java-maven-
projects:
  -
    name: console-java-simple
    source:
      type: git
      location: "https://github.com/che-samples/console-java-simple.git"
components:
  -
    type: chePlugin
    id: redhat/java/latest
    env:
       - name: MAVEN_MIRROR_URL 
          value: http://mirror.host/
  -
    type: dockerimage
    alias: maven
    image: quay.io/eclipse/che-java11-maven:nightly
    env:
      - name: MAVEN_CONFIG
        value: /home/user/.m2

@tolusha
Copy link
Contributor

tolusha commented Aug 28, 2019

The idea is to support environment variables in chePlugin components.

@l0rd l0rd removed the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 28, 2019
@tsmaeder
Copy link
Contributor

But VSCode-Java would still not use that variable, so what's the point?

@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 28, 2019
@kameshsampath
Copy link
Contributor Author

@tsmaeder - vscode does use the settings from the host which runs the plugin, so my point was to cascade the variable down to the host so that vscode can pick it up. IIUC the host in this case will be another container. correct me if am wrong

@fbricon
Copy link

fbricon commented Aug 28, 2019

The local Maven repo is not configurable directly in m2e. You need to pass a custom Maven settings.xml path instead in java.configuration.maven.userSettings.

@kameshsampath
Copy link
Contributor Author

@fbricon - thats the settings I was looking for, may be we can make that configureable to Che like how we do the kubernetes references, that helps users adding the settings refernece devfile. does that make sense ?

@ibuziuk ibuziuk removed the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 28, 2019
@tolusha
Copy link
Contributor

tolusha commented Aug 29, 2019

@tsmaeder
In my case it can be used by @eclipse-che/theia-remote to set a container name to redirect runInTerminal request to a dev container.

@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 29, 2019
@skabashnyuk skabashnyuk added this to the 7.3.0 milestone Aug 29, 2019
@skabashnyuk skabashnyuk removed the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 29, 2019
@skabashnyuk
Copy link
Contributor

After discussing this task with @l0rd @metlos @sleshchenko we decided to not to make things too complex that is why we want to populate environment variable to all containers that ChePlugin provides.

@l0rd
Copy link
Contributor

l0rd commented Aug 29, 2019

I have created a dedicated issue for maven settings #14391. This current issue is about setting env variables for Che Plugins and is a pre-requisite for #14391.

@l0rd l0rd modified the milestones: 7.3.0, 7.2.0 Aug 29, 2019
@skabashnyuk skabashnyuk added severity/P2 Has a minor but important impact to the usage or development of the system. and removed severity/P1 Has a major impact to usage or development of the system. labels Aug 30, 2019
@l0rd l0rd added the severity/P1 Has a major impact to usage or development of the system. label Sep 2, 2019
@l0rd l0rd removed the severity/P2 Has a minor but important impact to the usage or development of the system. label Sep 2, 2019
@skabashnyuk skabashnyuk modified the milestones: 7.2.0, 7.3.0 Sep 5, 2019
@skabashnyuk skabashnyuk modified the milestones: 7.3.0, 7.4.0 Sep 26, 2019
@skabashnyuk skabashnyuk modified the milestones: 7.4.0, Backlog - Platform Oct 10, 2019
@mmorhun
Copy link
Contributor

mmorhun commented Nov 14, 2019

Also it would be useful to be able to configure env variables for Che editors as well. This way we could easily alter some editor configuration from devfile without requirement to override meta.yaml.

@l0rd l0rd changed the title Support for Environment Variables in Plugins Support for Environment Variables in Plugins and Editors Nov 14, 2019
@skabashnyuk skabashnyuk modified the milestones: Backlog - Platform, 7.6.0 Nov 27, 2019
@sleshchenko
Copy link
Member

@kameshsampath @mmorhun The PR is just merged #15435 and you should be able to use this feature as soon as you got newer Che images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests