Skip to content

Conversation

dkwon17
Copy link
Collaborator

@dkwon17 dkwon17 commented Aug 22, 2025

For https://issues.redhat.com/browse/CRW-8932 and https://issues.redhat.com/browse/CRW-8598.

To test this PR:

Build the base image:

$ cd base/ubi9 && DOCKER_BUILDKIT=1 docker image build --progress=plain -t <BASE_IMAGE> .

Create these 4 empty files:

.
└── some-directory/
    ├── config
    ├── config2
    ├── case1.Dockerfile
    └── case2.Dockerfile
Case 1: Testing CRW-8932

Put the following into case1.Dockerfile:

FROM <BASE_IMAGE>

RUN mkdir -p /home/tooling/.config/test

COPY config2 /home/tooling/.config/test/
COPY config /home/tooling/.config/

USER root
RUN chmod 777 /home/tooling/.config/test/config2 /home/tooling/.config/config

USER 1001

Build the image:

docker build -t quay.io/<your_username>/base-developer-image:case1 -f case1.Dockerfile . && docker push quay.io/<your_username>/base-developer-image:case1

Create a workspace with the new image. My new image is: quay.io/dkwon17/base-developer-image:case1:

<CHE_HOST>#https://github.com/che-samples/bash?image=quay.io/dkwon17/base-developer-image:case1&storageType=per-workspace

Verify that there are symlinks for config and config2:

$ ls -la /home/user/.config
total 0
drwxr-xr-x. 4 user root 50 Aug 22 20:57 .
drwxrwx---. 1 user root 62 Aug 22 20:57 ..
lrwxrwxrwx. 1 user root 28 Aug 22 20:57 config -> /home/tooling/.config/config
drwxr-xr-x. 2 user root 26 Aug 22 20:57 containers
drwxr-xr-x. 2 user root 21 Aug 22 20:57 test

$ ls -la /home/user/.config/test
total 0
drwxr-xr-x. 2 user root 21 Aug 22 20:57 .
drwxr-xr-x. 4 user root 50 Aug 22 20:57 ..
lrwxrwxrwx. 1 user root 34 Aug 22 20:57 config2 -> /home/tooling/.config/test/config2
Case 2: Testing CRW-8598

Put the following into case2.Dockerfile:

FROM <BASE_IMAGE>

RUN mkdir -p /home/tooling/.config/test

COPY config2 /home/tooling/.config/test/
COPY config /home/tooling/.config/

RUN echo ".config/test" >> /home/tooling/.copy-files

USER root

RUN chmod 777 /home/tooling/.config/test/config2

USER 1001

Build the image:

docker build -t quay.io/<your_username>/base-developer-image:case2 -f case2.Dockerfile . && docker push quay.io/<your_username>/base-developer-image:case2

Create a workspace with the new image. My new image is: quay.io/dkwon17/base-developer-image:case2:

<CHE_HOST>#https://github.com/che-samples/bash?image=quay.io/dkwon17/base-developer-image:case2&storageType=per-workspace

Verify that /home/user/.config/test/config2 exists, and is not a symlink:

$ ls -la /home/user/.config/test
total 4
drwxr-xr-x. 2 user root 21 Aug 22 21:28 .
drwxr-xr-x. 4 user root 50 Aug 22 21:27 ..
-rwxr-xr-x. 1 user root 18 Aug 22 21:28 config2

Make a change to the config2 file, and restart the workspace. Once the workpsace is restarted, the config2 file should have the changes you made before restarting the workspace.

@svor
Copy link
Collaborator

svor commented Aug 25, 2025

@dkwon17
I've tried to follow case1 scenario but was not able to start a workspace:

Screenshot 2025-08-25 at 17 31 32

My image is quay.io/vsvydenk/base-developer-image:case1, with your image I was able to start a workspace

@dkwon17
Copy link
Collaborator Author

dkwon17 commented Aug 25, 2025

@svor could you please try building for x86_64 architecture? The quay.io/vsvydenk/base-developer-image:case1 image is built for aarch64:

$ skopeo inspect docker://quay.io/vsvydenk/base-developer-image:case1

...
    "Labels": {
        "architecture": "aarch64",

Copy link
Collaborator

@svor svor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
case 1 validated:
Screenshot 2025-08-25 at 18 29 13
case 2 validated:
Screenshot 2025-08-25 at 18 34 24

after restarting:

Screenshot 2025-08-25 at 18 48 27

@svor
Copy link
Collaborator

svor commented Aug 25, 2025

@dkwon17 I see that PR checks failed, could you check them please

@rohanKanojia
Copy link
Member

I tested it on CRC cluster, I can confirm Case 1 is working as expected. ✔️

However, for case 2 when I restart workspace changes don't persist in config2 file (I had added some content to it before restarting). Sometimes when workspace gets into Failed state on pressing Restart button, I have to click on it again to trigger restart again.
Screenshot_20250825_230555

@dkwon17
Copy link
Collaborator Author

dkwon17 commented Aug 26, 2025

@rohanKanojia could you please share your image?

However, for case 2 when I restart workspace changes don't persist in config2 file (I had added some content to it before restarting). Sometimes when workspace gets into Failed state on pressing Restart button, I have to click on it again to trigger restart again.

Is it always reproducible? Is there anything interesting in the events (oc get events -n <your namespace>)?

Signed-off-by: David Kwon <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm label Aug 26, 2025
Copy link

Pull Request images published ✨

UDI: quay.io/devfile/universal-developer-image:pr-231

@rohanKanojia
Copy link
Member

hello, I tried it again this morning but faced same issue. I think I'm doing something wrong as same steps are working for Valeri.

I've created this short video to showcase steps I followed, could you please check and verify if I did it correctly 🙏 ?

developer-images-pr-231-case2-testing.mp4

@dkwon17
Copy link
Collaborator Author

dkwon17 commented Aug 27, 2025

@rohanKanojia I forgot to mention, yes, that's expected if you don't have spec.devEnvironments.persistUserHome.enabled: true in your CheCluster CR

@rohanKanojia
Copy link
Member

@dkwon17 : Thanks a lot for checking it! You're right this was the issue.

After enabling CheCluster persistUserHome I was able to verify whole scenario successsfully ✔️

Copy link

openshift-ci bot commented Aug 28, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dkwon17, rohanKanojia, svor

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dkwon17 dkwon17 merged commit e05d895 into main Aug 28, 2025
8 checks passed
@dkwon17 dkwon17 deleted the copy-files branch August 28, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants