-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Most public images used in devfile registry do not work as the base for Che 7 workspaces on OpenShift #13454
Copy link
Copy link
Closed
Labels
kind/bugOutline of a bug - must adhere to the bug report template.Outline of a bug - must adhere to the bug report template.severity/blockerCauses system to crash and be non-recoverable or prevents Che developers from working on Che code.Causes system to crash and be non-recoverable or prevents Che developers from working on Che code.status/code-reviewThis issue has a pull request posted for it and is awaiting code review completion by the community.This issue has a pull request posted for it and is awaiting code review completion by the community.status/in-progressThis issue has been taken by an engineer and is under active development.This issue has been taken by an engineer and is under active development.
Milestone
Metadata
Metadata
Assignees
Labels
kind/bugOutline of a bug - must adhere to the bug report template.Outline of a bug - must adhere to the bug report template.severity/blockerCauses system to crash and be non-recoverable or prevents Che developers from working on Che code.Causes system to crash and be non-recoverable or prevents Che developers from working on Che code.status/code-reviewThis issue has a pull request posted for it and is awaiting code review completion by the community.This issue has a pull request posted for it and is awaiting code review completion by the community.status/in-progressThis issue has been taken by an engineer and is under active development.This issue has been taken by an engineer and is under active development.
Description
OpenShift by default starts containers using a random UID for security purposes [1]. Since the UID to be used is not known at container creation time, there is no entry for the running user in
/etc/passwd.This can cause a multitude of problems:
/bin/sh; startingbashresults in the promptI have no name!@workspaceid $/projects.m2repo (see '?' folder is created when building console-java-simple project using java-maven Che 7 stack #13451 and Add -Duser.home parameter to maven opts in java-maven stack #13453)The suggestions in [1] are
rootgroup. This is not a problem for directories mounted as volumes/etc/passwdfile should be writable by the root group. Then, an entrypoint script can execute something likeThe second point above is the issue -- images not created to run on OpenShift do not have a writeable
/etc/passwd; further, since we normally overwrite container commands withsleep infinityortail -f /dev/null, even images with an entrypoint that does what we need won't execute the script by default. Note that this is what's done when starting the default "Che 7" stack, which explains why it works.At this time, I don't see many good potential solutions; when running on OpenShift, the Che server could attempt to rewrite the recipe's container commands with the script above followed by whichever non-terminating command we like, but this would still require using compatible images in the devfile registry. It could also result in confusing errors if we're automatically rewriting entrypoints, and it's difficult to specify a script like above in the yaml list format used for container commands.
I'm currently working with trying to implement the above, but if anyone has better ideas, it'd be great to hear them.
[1]- https://docs.okd.io/3.11/creating_images/guidelines.html#openshift-specific-guidelines
Reproduction Steps
Start a Che 7 workspace other than the default dev image (e.g.
java-maven), open a terminal, and typewhoamiOS and version:
Che 7 on any OpenShift
Diagnostics:
In most images, we have e.g.: