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

Pre-create common tooling config directories for installed tools in UDI image #22029

Closed
amisevsk opened this issue Mar 2, 2023 · 6 comments · Fixed by devfile/developer-images#135
Assignees
Labels
area/getting-started Issues related to the getting started samples https://www.eclipse.org/che/getting-started/cloud/ area/udi Issues and PRs related to the universal developer image https://github.com/devfile/developer-images area/ux Issues related to User Experience Design 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.

Comments

@amisevsk
Copy link
Contributor

amisevsk commented Mar 2, 2023

Is your enhancement related to a problem? Please describe

Che includes functionality for mounting files into DevWorkspaces for common configuration tasks, e.g. sharing a common maven settings.xml across different Java-based workspaces (automounting configmaps/secrets). However, since the UDI image does not come with a /home/user/.m2 folder pre-created, users can run into confusion:

  • If their devfile mounts a volume to /home/user/.m2 (as it does in our samples), everything works as expected
  • If their devfile does not include a m2 volume, Kubernetes/OpenShift will create the directory in order to store the settings.xml file when the pod is started

In the latter case, the directory will be created with 755 permissions and root ownership, meaning the workspace will not be able to write to the directory. In the case of maven workspaces on OpenShift, this causes builds to fail as /.m2/repository cannot be created.

Describe the solution you'd like

The UDI image should come with empty directories and appropriate permissions for common folders that are required by tools (e.g. .m2, .gradle, etc.)

Describe alternatives you've considered

Document issue as a potential caveat with auto-mounted volumes

Additional context

This behaviour underlies https://issues.redhat.com/browse/CRW-4082

@amisevsk amisevsk added kind/enhancement A feature request - must adhere to the feature request template. area/udi Issues and PRs related to the universal developer image https://github.com/devfile/developer-images labels Mar 2, 2023
@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 Mar 2, 2023
@l0rd
Copy link
Contributor

l0rd commented Mar 3, 2023

@amisevsk to be more precise this is about pre-creating local dependencies folders rather than config folders right? I am asking because it kind of match for maven but I am not sure that it does for every language. And that's about dependency management tools rather than "any" tool. We have hundreds tools in UDI and we may want to restrict this only to dm tools, specifically:

  • maven
  • gradle
  • sbt
  • npm
  • yarn
  • go
  • dotnet
  • pip
  • cargo

@l0rd
Copy link
Contributor

l0rd commented Mar 3, 2023

Added to #20799

@amisevsk
Copy link
Contributor Author

amisevsk commented Mar 3, 2023

I left it vague semi-intentionally -- we should have pre-created paths to any location a user might want to auto-mount a config (e.g. settings.xml goes in $HOME/.m2/, so $HOME/.m2/ should exist). Technically, the same applies to npm, but npm reads from $HOME/.npmrc, and $HOME already exists.

Looking at sbt, global config goes in $HOME/.sbt/1.0/, so the UDI image should mkdir -p $HOME/.sbt/1.0/ to ensure that if a config file is mounted, the directory still has appropriate permissions. Cargo uses $HOME/.cargo/config.toml --> pre-create $HOME/.cargo, etc.

@amisevsk amisevsk added severity/P2 Has a minor but important impact to the 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 Mar 3, 2023
@che-bot
Copy link
Contributor

che-bot commented Aug 30, 2023

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 30, 2023
@l0rd
Copy link
Contributor

l0rd commented Aug 30, 2023

/remove-lifecycle stale

@che-bot che-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 30, 2023
@AObuchow AObuchow assigned amisevsk and AObuchow and unassigned amisevsk Oct 25, 2023
@amisevsk amisevsk added severity/P1 Has a major impact to usage or development of the system. area/getting-started Issues related to the getting started samples https://www.eclipse.org/che/getting-started/cloud/ area/ux Issues related to User Experience Design and removed severity/P2 Has a minor but important impact to the usage or development of the system. labels Oct 25, 2023
@amisevsk
Copy link
Contributor Author

Bumped the priority on this one to match the priority of duplicate issue #22620

AObuchow added a commit to AObuchow/developer-images that referenced this issue Oct 27, 2023
Fix eclipse-che/che#22029

Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
AObuchow added a commit to AObuchow/developer-images that referenced this issue Oct 27, 2023
Fix eclipse-che/che#22029

Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
AObuchow added a commit to AObuchow/developer-images that referenced this issue Nov 1, 2023
Fix eclipse-che/che#22029

Pre-creates the following config directories:

- ~/.m2 (Maven)
- ~/.gradle (Gradle)
- ~/.config/pip (Pip)
- ~/.sbt/1.0 (SBT)
- ~/.cargo (Rust)
- ~/certs (SSL)
- ~/.composer (PHP)
- ~/.nuget (.NET)

Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
AObuchow added a commit to AObuchow/developer-images that referenced this issue Nov 1, 2023
Fix eclipse-che/che#22029

Pre-creates the following config directories:

- ~/.m2 (Maven)
- ~/.gradle (Gradle)
- ~/.config/pip (Pip)
- ~/.sbt/1.0 (SBT)
- ~/.cargo (Rust)
- ~/certs (SSL)
- ~/.composer (PHP)
- ~/.nuget (.NET)

Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
AObuchow added a commit to devfile/developer-images that referenced this issue Nov 6, 2023
Fix eclipse-che/che#22029

Pre-creates the following config directories:

- ~/.m2 (Maven)
- ~/.gradle (Gradle)
- ~/.config/pip (Pip)
- ~/.sbt/1.0 (SBT)
- ~/.cargo (Rust)
- ~/certs (SSL)
- ~/.composer (PHP)
- ~/.nuget (.NET)

Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/getting-started Issues related to the getting started samples https://www.eclipse.org/che/getting-started/cloud/ area/udi Issues and PRs related to the universal developer image https://github.com/devfile/developer-images area/ux Issues related to User Experience Design 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

Successfully merging a pull request may close this issue.

4 participants