Skip to content

Add tutorial to setup a development environment only using docker #2081

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

Merged
merged 6 commits into from
Apr 26, 2020

Conversation

ramboldio
Copy link
Contributor

I was updating my ubuntu system which broke my dev environment completely. With this PR, I want to prevent future generations from going through the same pain as I did by providing a handy guide that let's you work on hyrise without touching the host system.

@ramboldio
Copy link
Contributor Author

(currently this guid uses rsync to have the same files in the docker container as in the CLion projects, since this is the default and gives CLion control over what is happening. It is probably preffered to use docker volume mounting instead. Wdyt?)

@ramboldio
Copy link
Contributor Author

Do you think, it's a good idea to put together a dedicated Dockerfile for development? That might save some steps from the tutorial.

@ramboldio
Copy link
Contributor Author

@mrks What do you think?

@mrks
Copy link
Member

mrks commented Apr 15, 2020

I'm currently a bit swamped trying to get the CI server running again. Will look at this soon.

@mrks mrks requested a review from julianmenzler April 15, 2020 11:08
@Bouncner
Copy link
Collaborator

I have no idea about Docker and what that means for the compiling/execution performance of Hyrise, but since a lot of students appear to use CLion, it sounds like a good idea to put that guide down. Maybe not in the README to keep it concise, but linked in the Wiki?

@mrks
Copy link
Member

mrks commented Apr 17, 2020

We discussed this in the Fortnightly before you joined. @julianmenzler will test the tutorial just to make sure, after which we can dicuss the best location.

@ramboldio
Copy link
Contributor Author

Nice. Would really love to see getting this merged and supported. It'll be a tremendous time saver for future DYOD students running Linux systems. And for anybody who has to debug issue that are only reproducible in the CI environment using the familiar CLion debugger.

@ramboldio
Copy link
Contributor Author

ramboldio commented Apr 18, 2020

I have no idea about Docker and what that means for the compiling/execution performance of Hyrise, but since a lot of students appear to use CLion, it sounds like a good idea to put that guide down. Maybe not in the README to keep it concise, but linked in the Wiki?

When the docker host runs Linux, there will be almost no overhead, since the processes in the docker container run directly in the host's kernel. They only use lightweight namespace isolation primitives like cgroups, an isolated file system and isolated networking.

On Windows there will be the overhead of WSL (ie. Linux syscalls are translated to Windows Kernel Syscalls) (only for the latest versions of Docker).
Mac users would pay the full overhead of a Linux VM that Docker for Mac uses under the hood. But I think the project already supports Mac users quite well in its current configuration anyway ;).

@ramboldio
Copy link
Contributor Author

@julianmenzler let me know if you have any questions. ✌️

@Bensk1
Copy link
Member

Bensk1 commented Apr 22, 2020

In the context of the Bachelor's project, we are currently having a discussion whether docker is the right technology for creating development environments. On the plus side: we already have a docker setup for the CI but setting up a development environment in a docker apparently conflicts with a couple of Docker's dogmas. @Bouncner mentioned that we used Vagrant for Hyrise1 which focuses on a simple, lightweight setup for a development environment.

@mrks
Copy link
Member

mrks commented Apr 22, 2020

What would be the advantage of that?

lightweight setup

Doesn't it start a VM?

@Bensk1
Copy link
Member

Bensk1 commented Apr 22, 2020

I don't know. The Docker disciples just said/wrote that using docker containers for development is against Docker's philosophy. Actually, I don't care.

@julianmenzler
Copy link
Member

@mrks
Copy link
Member

mrks commented Apr 22, 2020

Could you try building Hyrise in the container without CLion (i.e., creating your own build folder, running cmake, make)

@ramboldio
Copy link
Contributor Author

ramboldio commented Apr 23, 2020

Compile errors under macOS:
https://gist.github.com/julianmenzler/166b64a3fdf0447ba67d7239a97fa79c

Also had that problem before when trying to get hyrise running on my ubuntu (non docker) dev machine. (I recall fixing it by changing GCC to CLang). Takes some time to figure this out tho. ✌️

But if you cant build it that it should fail in CI also tho, right?

@mrks
Copy link
Member

mrks commented Apr 23, 2020

Very weird.

But if you cant build it that it should fail in CI also tho, right?

That's what I would expect, too. Especially as this runs in a VM and Mac should have no influence.

@julianmenzler
Copy link
Member

julianmenzler commented Apr 23, 2020

Could you try building Hyrise in the container without CLion (i.e., creating your own build folder, running cmake, make)

I tried this today. Same issue.

Also, I made a clean checkout from within the container and started compiling using make -j8. This time no problems with libjemalloc, but other errors occurred.
However, I remembered your suggestion (@mrks) from our meeting:make -j1 did the trick. Problems with macOS and Clion remain though.

As a next step, I'll try out the tutorial in a Linux setting. I already set up a VM with Linux and Clion today. I'll keep you posted.

@mrks
Copy link
Member

mrks commented Apr 24, 2020

Problems with macOS and Clion remain though.

Could you try this: https://youtrack.jetbrains.com/issue/CPP-349#focus=streamItem-27-890460.0-0

@julianmenzler
Copy link
Member

julianmenzler commented Apr 24, 2020

Update

  • Tutorial works for Ubuntu 20.04 and Clion 2020.1
  • I give up on getting this to work under macOS Catalina and Clion 2020.1

Could you try this: https://youtrack.jetbrains.com/issue/CPP-349#focus=streamItem-27-890460.0-0

Clion triggers the following command

/cmake-3.16.0/bin/cmake --build /tmp/tmp.dzpGmw5myc/cmake-build-debug_docker --target hyriseTest -j 1

So -j 1 is not a problem. Something else seems to get messed up when Clion copies over the project files I guess.
(To make sure, I also executed make -j1 manually, same issue with jemalloc)

I suggest we put a disclaimer in front of the tutorial. Something like "Works on Linux systems only."

@julianmenzler
Copy link
Member

Another question to be answered: Shall we make this a separate Wiki-page?

@mrks
Copy link
Member

mrks commented Apr 24, 2020

Shall we make this a separate Wiki-page?

Yes, and link it under "Development" in the menu. Could you make the necessary changes to the text and move it there? I'd also link it in README.md.

@julianmenzler
Copy link
Member

Shall we make this a separate Wiki-page?

Yes, and link it under "Development" in the menu. Could you make the necessary changes to the text and move it there? I'd also link it in README.md.

Ok, I take care of that.

@julianmenzler
Copy link
Member

Ok, I'm done. Here it is: https://github.com/hyrise/hyrise/wiki/Use-Docker-with-CLion

@mrks
Copy link
Member

mrks commented Apr 25, 2020

Great! Thanks to both of you!

Where does ENABLE_JIT_SUPPORT come from? That has been removed a long time ago. We should grep the code and the wiki for it.

If you change this PR to simply link the wiki page, we can merge and close it, too.

@mrks
Copy link
Member

mrks commented Apr 25, 2020

Could you merge the current master, please? Otherwise, this might fail because of that server test.

@julianmenzler
Copy link
Member

Great! Thanks to both of you!

Where does ENABLE_JIT_SUPPORT come from? That has been removed a long time ago. We should grep the code and the wiki for it.

If you change this PR to simply link the wiki page, we can merge and close it, too.

Good to know! I copied that part from my personal config. I removed it.

If you change this PR to simply link the wiki page, we can merge and close it, too.

Done


By the way, is the following paragraph still relevant?

Inside the container, you can then checkout Hyrise and run ./install_dependencies.sh to download the required submodules.

From my view, the Dockerfile already ensures that dependencies get set up. Or is there any difference?

@mrks
Copy link
Member

mrks commented Apr 25, 2020

The submodules are not part of the Docker container. The rest should be there, but as the CI run also runs the script, I'd suggest that people do so, too. That way, we can be reasonably sure that everything that works in CI also works for them.

@julianmenzler
Copy link
Member

Alright, thanks for clarifying. 👍

@julianmenzler julianmenzler added the FullCI Run all CI tests (slow, but required for merge) label Apr 25, 2020
@ramboldio
Copy link
Contributor Author

Why I put the install_dependency section in was because I needed a way of only installing the submodules and not the other dependencies that would be installed in the hosts apt-system.

So maybe just a reminder in the tutorial that the submodules have to be set up to make Docker work could suffice.

@ramboldio
Copy link
Contributor Author

Have you thought about whether we should switch to a volume-mounting approach instead of rsyncing all the files? I guess that volume mounting has a bunch of advantages. Then there is no overhead for copying the files and you wouldn't need to provide the disc space for 2 copies of hyrise.

@julianmenzler
Copy link
Member

julianmenzler commented Apr 26, 2020

So maybe just a reminder in the tutorial that the submodules have to be set up to make Docker work could suffice.

The Dockerfile takes care of fetching all dependencies required for compiling Hyrise. Project files, including the git submodules, have to be cloned by the developer himself.

Have you thought about whether we should switch to a volume-mounting approach instead of rsyncing all the files? I guess that volume mounting has a bunch of advantages. Then there is no overhead for copying the files and you wouldn't need to provide the disc space for 2 copies of hyrise.

Indeed, I thought about this. But it might break CLion's remote workflow and requires further testing. Most people will set up a Hyrise dev environment without Docker anyway. So I guess spending more resources on this guide is not necessary. At least for now.

@julianmenzler julianmenzler merged commit 3e073b7 into hyrise:master Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FullCI Run all CI tests (slow, but required for merge)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants