-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Persisting workspaces on Dockerized Che #2741
Comments
Please be explicit by showing every command you issued. The syntax for running Che CLI vs. Che Launcher vs. Che Docker Container are different. The variables are different and the behaviors are different. If you are trying to run codenvy/che-server, the syntax for persisting workspaces and projects is different than the CLI. |
I can only approximate as I'm using Kubernetes but the equivalent should be:
(I need to check the lib mounting) Would you know which folder normally contains the info that a workspace should exist? |
This is way different from the syntax that we support. You will have to explain how the dind container and the linked container running Che are associated. The syntax for running codenvy/che-server is documented here: https://eclipse-che.readme.io/v5.0/docs/usage-docker-server
|
In that example you're mounting |
Sure it works - you cannot mount the same exact folder twice, but Docker treats sub-folders differently. You can volume mount sub-folders for /home/user/che as many times as you want. |
I tryed to mount and store the entire |
Take a look at the source code of github.com/eclipse/Che-dockerfiles/Che-launcher. This is the docker container which launches the Che server and you can see the syntax it uses to manage all of the configuration. |
@wernight When set, the value of
Also, in your example, you expect storage to be in If you want to run On the host, crate
In your run syntax:
|
I looked at default
So I see no reason to use my custom I'm not persisting workspaces and storage I'm persisting. Stacks seems to be built-in and I'm not persisting. workspaces contains only one directory per workspace which is even empty initially. storage contains only a So I see no place that contains for example the workspace memory or its kind. For example I'd expect it stored somewhere the equivalent of the JSON when exporting a workspace as file from Che. I even ran a grep on the entire file system looking at the workspace name but only found logs matching. I tried persisting the entire So here are my steps:
|
@wernight when in a che-server container, can you see jsons in |
At step 2 above I notice that:
|
@wernight jsons are created after server is correctly shut down. This isn't the case anymore since we use in memory database. What Che version do you use? Currently, Che stores database files in |
Oh.. may be there is an issue in the shutdown then. I'm sending a TERM signal and waiting for 30 sec before possibly sending a KILL signal. I'll try calling |
Take a look at how the che-launcher container stops the che-server container here: |
Fixed! Awesome! |
It'd however be simpler if this was done on sign TERM. |
Sorry re-opening just to clarify: Does it also periodically does the same as |
In the 4.7.2 release train, we had a persistence model where the persistence was updated periodically. However, starting in the 5.0 release train, we rewrote the persistence model, and now persistence items are updated immediatly when an in-memory object is changed. So, this should prevent any data loss. The only risk for data loss in the 5.0 version is if you have modified non-project files in a workspace and have not snapshot it. There is a workaround for that, too - because evne if you are using a database, you could just volume mount that database in a special volume in Che, so that would be automatically persisted. |
I don't remember the DB being mounted by default using Docker. Doesn't sound too bad though at the moment (in the sense it's still important but less than other issues). Cool, then 5.0 would be a lot safer. |
With 5.0 - the db is disk-based derby database that runs within the JVM. There is a new directory that it is mounted to, and the tables are stored as files in the /storage folder. In Codenvy, the database is postgres - but it uses a similar JPA driver. And coming soon, we'll make Codenvy deployable as a set of docker compose services - where the postgres container will be a separate container with its contents mounted using a volumes-from reference. |
Sounds good, as long as it's not expecting files to exist at that location initially. Should work with an empty directory (saying that because with volumes-from it's possible to point to an image which has already default data). |
Hi, I've been following this thread and another about how to work with volume mounts for bringing in external sourcecode into the che environment and and for some reason i'm having some problems... I was able to set the CHE_DATA_FOLDER to a local directory (using the docker launcher), and I see a storage and a workspaces directory. I would expect the workspaces to contain my workspaces, however, although I do see a workspace directory with the same name as a workspace I launched in che, the directory is empty... the "storage" directory contains some json files and an "images" directory - I assume this is the DB and other stuff... Am I understanding it wrong? Should the workspace directroy be empty? Is the docker launcher the prefered way to use che? I thought it would be but then there are some more recent suggestions to use CLI? Can someone maybe share a compose file they are working with that shows Che as well as a volume mount on a filecontainer, for example? I'm a bit loss at the exerpts of docker-compose that were shared. thanks! |
Yes, when you set that folder and then create a workspace with a project, the files of the project should be there. The database storage is only for internal Che configuration. Please see the PR below with some instructions on a much simplified approach to managing user data in Che. It was a weekend project that works to make sure certain needs are self handled in the new Che server container to more easily support configurations like yours. It has not been merged yet but it shows the general direction. The current Che launcher should always work for you however so if you are setting that and projects are not written into it then something is wrong. |
Thats strange then @TylerJewell... the storage directory is there, and so is the workspaces... And adding a workspace definitely added a directory in the workspaces directory, however that directory is empty... I tried adding a second project manually, and still its empty... I'll take a look at the PR you linked and wait a bit longer to try again... I'm almost ready to "need che" :) We are basically done putting all our dev environment on docker, with different containers for local-development vs "production"/in container files, and soon I'd like to start working on exposing che as a "development server" for our programmers... I'll keep an eye out for this and will do more testing in the coming weeks. |
There are some quirks in the current che-server configuration where if you are running che inside of a VM, like with docker for mac, that we have additional variables that must be set. If you are calling hte che-server directly, you have to set these values. But the che-launcher is designed to handle all of these situations automatically by detecting where it is, and then setting values. So if the che-launcher is not catching that then it's a head scratcher and could be a rare bug given your OS / VM combination. |
Hi @TylerJewell is there anything I can generate in the form of logs or more verbose output that can help diagnose? This is running on a Ubuntu machine with docker 0.12 I believe... Its a baremetal server on scaleway, so its not a VM or vagrant environment... if there is anything I can get from the server or run for diagnose let me know... edit: correcting, the docker v is 1.12.1 not 0.12.1...apologies, that wouldnt make much sense :) thks! |
This is a closed thread - so I think @RVN-BR - you shoudl open a new thread, provide a complete diagnostic and any errors in the OS + in che info, and then someone can respond over time. Engineers will not be monitoring the closed threads. |
Spot on @TylerJewell I handt even realized this was closed off... I'll try to setup a new environment and reproduce the situation soon...Then I'll open an issue in the correct format if I still cant get past the empty workspaces directories. best! |
Remember that for me the main issue was that I had to call "che.sh stop" to Le mer. 19 oct. 2016 à 15:34, Roy notifications@github.com a écrit :
|
Using Docker to run che-server and persisting
/home/user/che/workspaces
and/home/user/che/storage
. However even though those directories have something, after restarting Che it seems that it lost my workspaces (and associated projects).(Note: I used
CHE_WORKSPACE_STORAGE
to change location of the workspaces)The text was updated successfully, but these errors were encountered: