-
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
Add enhancements for working with files not added as projects #1580
Comments
We have an improving set of documentation on how to build a Dockerfile that can be used as a recipe when creating a new workspace. We document that in the Recipes page. We discuss the various trade offs of extending one of Che's base images or starting with your own. The basic model is that the projects (source folders) are separated from the runtimes, and then married together. The sequence is that Che creates a workspace, and then launches the workspace runtimes. While the runtimes can have files pre-configured inside of them, the files from a runtime are usually the files needed to support the stack. So you might have npm libraries pre-loaded into the workspace runtime, but not necessarily your project file stack. The project files reside outside the workspace and then mounted into the worksapce after its runtimes are started. This can be from a subversion clone, git clone, or a zip mount. These projects are then located in /projects, which makes them available when you directly access the workspace runtime or from the IDE. Now, you can have packages added for your workspace either from within the image that powers the runtime, or after the runtime is started. The basic difference is that if there are many shared packages, it's silly to have each user download those packages repeatedly, so include them in the runtime image. If there are packages that are user-specific or frequently changing, then maybe better to have the user download and install them when they get into the workspace. Essentially, Che is setting up the scenario you describe - where you have a set of images and then the folders are mounted in to work. We just eliminate the need for the user to figure out how to do the mount and setup of files. On Monday we will be at Red Hat's conference previewing multi-container support in a workspace using Docker Compose syntax. This will help with modularity. And also, as the year goes on, we will be working to remove Che's requirements from Docker images, so that any Docker image can be pulled and then we inject Che's requirements into the Docker image. This way you will not have to maintain custom Dockerfiles. |
@wernight can you perhaps elaborate on a particular project that won't run? Also, I wonder what is building a Dockerfile for Che means in your case. Eager to get additional info :) |
Commenting on what you suggest:
Can you detail how that might work? I want to explore more about Docker-in-Docker / Docker-socket I think should be supported and would support the points above without much trouble. It'd be a great base image. At the moment I'm more stuck on #1560 . @elvantsov For example I may need ElasticSearch, or MySQL or whatever weird thing. There are many projects. Even if they worked out of the box, it'd be in a very different environment from the deployed one, so I'd really rather have Docker-in-Docker / Docker-socket access than environments that work out of the box. So I'd prefer to provide the Having simple way to start them for me and allow me to invite others to either directly use it or do the same on their "Eclipse Che" with minimal pain sounds really cool! Mostly for open source, but not only. |
@wernight Docker-in-docker is possible with privileged outer docker container and volume mounting /var/run/docker.sock. The volume mounting is the tricky part right now as che conf file only allows for one volume to be mounted. If all you need is /var/run/docker.sock in your workspace/container you are set. When you create another container inside your workspace you can choose nor to include the docker.sock but maybe do the following The following is typical command to do docker in docker You can get docker in docker to work without privileged too but you need two mounts with something like the following. http://stackoverflow.com/questions/29612463/can-i-run-docker-in-docker-without-using-the-privileged-flag Look at issue #1338 for additional information on mounting volumes additional volumes. |
Thanks. I know how to do docker-in-docker, but how do you or affect the docker flags the Che uses when it creates a Che workspace/runtime? |
@wernight che.properties file is the only way to do this currently that I know of. You do not have access to all flags through che.properties. Are you requesting/asking for access to create custom docker flags? |
Yes it'd be extremely useful. As I said, if from the Che runtime I could build and run Docker images, it'd allow real development. A "safer" way may be by providing a
The advantage of have access to docker from within the runtime is that some projects have a build phase which is more than compiling The risk is that the Che user must be trusted with root access on the Che server (this isn't too much an issue and Docker-in-docker should actually not require that level of confidence). The second is the user must trust the code their's running on their Che as it has root access. It's similar to currently running Docker but it's more risky because a browser click may at the moment trigger running a lot of commands which is a lot easier to exploit and equivalent in power to asking the user to run an unknown shell script on their machine. That means that a warning should be shown with an easy way to see the code that will be executed. |
@wernight The only thing I have had trouble with not being able to use without custom docker flags is volumes cannot be used in dockerfiles. One work around right now for che single volume access is to mount Example below can be modified to work with che but shows the concept.
NTS:
docker in docker in docker volume mount results in directory of docker.sock. So docker-in-docker-in-docker does not work with docker.sock... |
@wernight Sorry had to make a couple of edits to above. A really easy way to do docker in docker with che is just |
@wernight @james10174 another way to use Docker from within a container is to run host Docker in tcp mode and export DOCKER_HOST in the container so that this variable has the following value If you run Che in a cloud, you may use an internal IP rather than a public one. |
@elvantsov Exposing the TCP socket should be the same (but often more complex) as exposing Linux socket Yes
|
Another useful thing that can be done more easily by supporting having Docker from Che: One can setup a Che runtime for developing which includes for example your own |
@wernight - FYI, we have a couple things that are getting worked on this quarter that adds to some of the items that you are thinking about. First, basic docker compose support will ship soon - it has just a couple sprints left of development. Second, we also now have a design and vision on how to support docker images that are not based upon Codenvy templates. We will break out our various required capabilities into "agents" that users can add / remove from the dashboard. We will then install, register and start any necessary agents when the workspace is started. The available agents will be "dev", "ssh", and "terminal". |
@TylerJewell Having a runtime to build and run stuff is good and it's the most important. I was wondering also if you could think of ways to customize the Terminal. Like there are settings for Che/Codenvy there one could have a custom I'll be glad to try it out once you're ready. |
I think that right now the best we can offer around terminal customizations is that you can create different base images for users into different stacks, and then with each stack you can define terminal properly within the .bashrc file of the image. |
@wernight what should I do with this issue? The conversation ended up in a number of suggestions on how to improve Che - all of them captured as GitHub issues. |
@wernight I am not sure what I need to do with this particular issue - it started as |
At the moment I cannot use Che for my projects (except may be one or two, the rest can only use Che as a text editor), it's blocked on the issues I cited. Once that is fixed, the documentation could be updated to explain how to use Che for many more projects with practical examples. For context, I've almost no real maintained Java project, so I'd rather skip that. Point is, it's not really usable for me. I'd have to create a new fat Docker image just for Che, for each project, and that image may well not reflect what's happening in production, and would require more maintenance time. Ideally I'd run locally Kubernetes via Minicube or such and mount volumes to edit files in "real time". Practically for now, during development, I run the same container images locally via docker-compose with the same network as on Kubernetes. It's almost always like a LAMP: Nginx + Python/PHP/... + Redis/MySQL/... |
@wernight - I am going to close this issue. There are tracking issues for the other items, and the ones that are being taken into the roadmap have been linked to the roadmap for tracking. |
Ok, I'll probably write an article about Che which would kind of solve this issue. |
That would be appreciated. Our roadmap is robust, so we are working through the backlog as best we can. |
I am going to close this issue. Feel free to reopen if you have particular problems/suggestions for Che. |
Having a, Docker by default, sharable runtime is a cool concept. However could you explain a bit how practically it's expected to work. I've many projects using Python/PHP/... and none of them would run out of the box on one of the preset runtime.
However most websites (I'm focusing here mostly on websites here) builds generate a few Docker images. Those images can get deployed or run locally with local folder mounted to develop. So how is it supposed to work?
Both are fine, I was mostly wondering if you'd mind explaining a bit some practical usage examples and especially detail how to build a Dockerfile for Che. When I tried I had an error but no details (using Codenvy), so I can only guess I'm missing some app that is expected on it.
The text was updated successfully, but these errors were encountered: