eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

HOME environment variable points to `/opt/app-root/src` in python sample #23068

Open vitaliy-guliy opened 4 months ago

vitaliy-guliy commented 4 months ago

Describe the bug

I noticed that on the developer sandbox and on the godfooding instance HOME environment variable is set to /opt/app-root/src.

It brings some problems. First, that /opt/app-root/.... is not persisted and all the stored data are lost on workspace restart. Seconds, it is not right ideologically, home directory should be located in /home, not in /opt.

Che version

7.88

Steps to reproduce

Expected behavior

HOME should be set to /home/user

Screenshots

Screenshot from 2024-08-01 11-49-42

Environment

Dev Sandbox (workspaces.openshift.com)

AObuchow commented 4 months ago

@vitaliy-guliy can you please share the devfile you used that encountered this error? I'm under the impression this is affecting tooling images other than the UDI, as I didn't reproduce the issue in the following devfile (UDI sample):

schemaVersion: 2.2.0
metadata:
  name: udi
  namespace: aobuchow-che-1cac83
  displayName: Universal Developer Image
  description: Universal Developer Image provides various programming languages tools and runtimes for instant coding
  icon: https://raw.githubusercontent.com/devfile/devfile-web/main/apps/landing-page/public/pwa-192x192.png
  tags:
    - Java
    - Maven
    - Scala
    - PHP
    - .NET
    - Node.js
    - Go
    - Python
    - Pip
    - ubi8
  projectType: universal
  language: Polyglot
  version: 1.0.0
components:
  - name: tools
    container:
      image: quay.io/devfile/universal-developer-image:ubi8-latest
      memoryLimit: 6G
      memoryRequest: 512Mi
      cpuRequest: 1000m
      cpuLimit: 4000m
      mountSources: true
vitaliy-guliy commented 4 months ago

@vitaliy-guliy can you please share the devfile you used that encountered this error?

It is a python sample from Create Workspace page. I think it comes from this devfile https://github.com/devfile/registry/blob/main/stacks/python/2.2.0/devfile.yaml where tools container is registry.access.redhat.com/ubi9/python-39

Btw, on the developer sandbox persistence for /home/user directory is not configured.

AObuchow commented 4 months ago

I don't believe we actually maintain that image https://catalog.redhat.com/software/containers/ubi9/python-39/61a61032bfd4a5234d59629e?container-tabs=overview

Maybe once the short term plan for https://issues.redhat.com/browse/CRW-6577?focusedId=25106725&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-25106725 is resolved, we can create a minimal python image based on our UBI that has home persistence & $HOME set correctly?

vitaliy-guliy commented 3 months ago

It is reproducible as well for go, dotnet, angular, and I believe for some other samples.