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

Ways to mount folder inside host machine to auxiliary machine? #499

Closed
soanni opened this issue Aug 1, 2016 · 29 comments
Closed

Ways to mount folder inside host machine to auxiliary machine? #499

soanni opened this issue Aug 1, 2016 · 29 comments

Comments

@soanni
Copy link

soanni commented Aug 1, 2016

Hello, Codenvy Team.

Is there any possible way to share the /projects folder inside workspace machine to auxiliary machine?
The picture is like that:

  1. I have a workspace with a project source code. It is mounted from host to workspace /projects/<name_of_project> folder.
  2. There is a ready docker image with all configured services (for example TomCat)
  3. I can create in current workspace additional "treatment" machine form that image
  4. I made some development on the code base. Then i built it and had new .war file as a result.
  5. I need a way to inject this file to the "treatment" machine's TomCat webapps folder in order to check how my app behaves after my development.
  6. I am a regular user of the system and i don't have access to SSH codenvy host.

As far as i understand workspace machine is run like that

docker run - v /projects ...

How can i run the additional treatment machine the same way?

Thank you.

@TylerJewell
Copy link
Contributor

TylerJewell commented Aug 1, 2016

Yes - there is a way. But you need to have a small sense of adventure.

Your workspace dev machine has sshd running inside of it. It is possible to use sshfs from within the auxiliary machine to connect to the workspace machine and then mount a specific /projects folder within the auxiliary machine. We have a form of this sophistication built into an experimental CLI for Che that we have, though it is more complicated than what you need because it also uses the unison framework, which you will not need.

You'd then need to make sure that the public / private key-pair between the dev & auxiliary machine is properly configured so that sshfs can work directly.

If you need some specific code on how sshfs works between the containers, I will need some time to get that uploaded. It's currently in an unmarked branch for experimentation, though it seems to work very reliably.

@ghost
Copy link

ghost commented Aug 2, 2016

@soanni another option is to use rsync

@ghost ghost added the kind/question label Aug 2, 2016
@ghost
Copy link

ghost commented Aug 3, 2016

@soanni let me know if you need help with this - I have a few ready to use commands that you can try right away.

@soanni
Copy link
Author

soanni commented Aug 3, 2016

@eivantsov thank you. i'm interested in everything new regarding Codenvy so i'm ready to try your commands.

@MuhamadSherif
Copy link

@eivantsov would you please provide these commands you have as I am now facing issue with this, I need to mount my container with a NAS server.

@ghost
Copy link

ghost commented Aug 12, 2016

@MuhamadSherif I do not think rsync commands will solve mounting problem. Perhaps, if you elaborate on the use case, I can be more explicit.

@TylerJewell
Copy link
Contributor

@eivantsov @JamesDrummond - we are getting this question quite a bit, so its maybe time for us to start to prepare a list of ways to mount external folders into a workspace. This is my starting list. This may not be accurate or complete.

1: Install your own Codenvy Enterprise. Within CE, we give admins the ability to mount additional host directories into users workspaces. So this would be a situation where you have a closed environment and host mounting is allowed.

2: You can sshfs mount a workspace directory in /projects into another system using sshfs. We use this in the che mount facility today. Can link on how this is possible. This then requires the person who performs the mount to then do a copy / move / rsync exercise. This is a scenario where the external system is reaching into the workspace.

3: You can setup a unison command, which does a recurring synchronization between a workspace and another external drive. This also requires ssh access to the workspace. This is a scenario where the external system is reaching into the workspace.

4: In scenarios where the workspace wants to push out - then the full range of FTP / SFTP / rsynch / SSH commands from one system to another is available.

@tolusha
Copy link
Contributor

tolusha commented Aug 26, 2016

@TylerJewell If we allow admin to mount extra volumes It will have effect per installation. Each user will have the same mounted directories.

@tolusha
Copy link
Contributor

tolusha commented Aug 26, 2016

IMHO it make sense for CHE only.

@TylerJewell
Copy link
Contributor

Yeah - we understand the risk and limits of this. There are some advantages temporarily though.

@tolusha
Copy link
Contributor

tolusha commented Aug 26, 2016

So, user story will be:
As a admin I should able to mount the same volumes for all machines for all users.

@TylerJewell
Copy link
Contributor

Yes.

@bmicklea
Copy link
Contributor

I'm still not clear on why volumes_from is critical here.

From what I have read, volumes_from is just a way to allow a container to use a set of volumes already defined in another container. It seems like a shortcut to having to re-define volumes in each container of a compose environment. But I thought that in M1 we weren't going to be able to do the volume mount at all - is that wrong?

What I'm trying to understand is that if we give 5.0.0-M1 to a customer can they try it and expect to be able to mount volumes in Codenvy?

@tolusha
Copy link
Contributor

tolusha commented Sep 13, 2016

Postponed to 5.0.0-M3

@bmicklea bmicklea modified the milestones: 5.0.0-M2, 5.0.0-M1 Sep 13, 2016
@bmicklea
Copy link
Contributor

bmicklea commented Sep 13, 2016

@tolusha - the che issue (eclipse-che/che#2366) may get pushed to M3 (Alex is working on it now), but so far it's not clear to me that the Che issue is the full solution to this issue. I need more information or explanation.

@JamesDrummond
Copy link

#728 Extra volume mounting.

@tolusha
Copy link
Contributor

tolusha commented Sep 13, 2016

machine.server.extra.volume has been introduces. It is a way to mount extra volumes into docker container.

For instance:

machine.server.extra.volume=/home/user/folder1:/mnt/folder1:ro,Z;/home/user/folder2:/mnt/folder2:ro,Z

@tolusha tolusha closed this as completed Sep 13, 2016
@bmicklea
Copy link
Contributor

@tolusha I believe we still need the fix for eclipse-che/che#2366 before we can close this. Your PR alone doesn't really let us do the second use case smoothly.

@bmicklea bmicklea reopened this Sep 13, 2016
@tolusha
Copy link
Contributor

tolusha commented Sep 13, 2016

They are two separated issues.

@bmicklea
Copy link
Contributor

I understand that your PR and the Che issue are separate and cover different use cases but this issue is about the two use cases outlined here: #499 (comment)

So I don't want to close this issue until both are complete and smooth.

@JamesDrummond JamesDrummond modified the milestones: 5.0.0-M2, 5.0.0-M1 Sep 19, 2016
@riuvshin riuvshin modified the milestones: 5.0.0-M3, 5.0.0-M2 Sep 20, 2016
@bmicklea bmicklea modified the milestones: 5.0.0-M4, 5.0.0-M3 Sep 20, 2016
@bmicklea
Copy link
Contributor

Adjusted milestone to match the release where VOLUMES_FROM will be fixed.

@bmicklea
Copy link
Contributor

Closing issue as eclipse-che/che#2366 has been closed in M4 as well.

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

No branches or pull requests

10 participants