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

VS Code extensions installed at runtime lost after session pod expires. #83

Open
NickLagogiannis opened this issue Nov 29, 2024 · 3 comments

Comments

@NickLagogiannis
Copy link

Greetings to everyone,

We followed the https://main--theia-cloud.netlify.app/documentation/setuptheiacloud/ to install theia cloud through helm and it's working. Even though, we have modified the values.yaml at theia-cloud helm chart to have persisted storage (set ephemeral storage to false ), this option is applied only to the "home/project/persisted" folder inside the container.

When we try to install a vs code extension from the marketplace, the extension is installed until the session ends, after we login again, a new pod is created, so every installation is lost.

Is there any option to keep the installed vs code extensions persisted after the new session pod?
Can I edit values.yaml file to achieve that and what do I need to configure?

@jfaltermeier
Copy link
Contributor

Hi,

This is up by the application developer. You can specify where the persisted workspace storage is attached for each application using mountPath in your AppDefinition:
https://theia-cloud.io/documentation/addapplication/#add-an-app-definition
You need to ensure that extensions are included in the workspace. This can be done, for example, by mounting the workspace directly as the home directory or by configuring your application/Theia instance to use a different directory to store the extensions.

@NickLagogiannis
Copy link
Author

Hello,

I changed the mountPath from "/home/project/persisted" to "/home" in my AppDefinition using the command: kubectl edit appDefinition theia-cloud-demo

Screenshot_5

At first, I didn't notice any change, so I checked the deployment file of my session pod and it hasn't changed yet.

Screenshot_6
Screenshot_7

Later, when the session had expired, I tried to log in using my credentials, I clicked on Launch Theia Blueprint and it was stuck in the launching message. I checked the deployment file to see if anything had changed (now the mountPath has also changed in the deployment) and then the pod at my session pod Status was "Error" ( a little later changed to "CrashLoopBackOff" ).

Screenshot_10
Screenshot_9

Screenshot_8
Screenshot_11

The logfile also has the following message:

Error: Cannot find module '/home/theia/applications/browser/lib/backend/main.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Screenshot_12

It seems that when the mountPath affects the deployment file, I lose some internal files and the pod is crashing.
Any idea why this is happening and how to proceed in order to work?

@jfaltermeier
Copy link
Contributor

In Kubernetes, the volume mounted at the mount path will override any data in the image/container with the contents of the persistent volume.
If you mount at /home, you need to make sure that your application is not overridden accidentally. For example, you could copy it to a different location, such as /opt/your-application, when building your application image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants