LXC support in Rancher

406 views
Skip to first unread message

Syed Mushtaq

unread,
Feb 10, 2015, 5:04:17 PM2/10/15
to ranc...@googlegroups.com
Hi, 

For my project, I am trying to add LXC support in Rancher. The Idea is to use LXC as the base container mechanism instead of Docker. I've been trying to read the code but am kind of lost. Can someone give me a starting point which I can work off of? 

Thanks,
-Syed

Shannon Williams

unread,
Feb 13, 2015, 1:59:50 PM2/13/15
to ranc...@googlegroups.com
Hi Syed,

Thanks for your interest, sorry for the delayed response.  Would you be open to having a call to discuss this with one of our architects?  Darren Shepherd is probably the best person.  I can connect you to him.

Darren S

unread,
Feb 16, 2015, 10:38:52 AM2/16/15
to ranc...@googlegroups.com
Syed,

Do you want to use plain LXC or Docker with the LXC driver?  As far as I know Docker with LXC should mostly work.  We haven't really tested it as it's not that common of a configuration.  If you're looking to use plain LXC then you would need to modify the python-agent.  https://github.com/rancherio/python-agent  This is where the majority of the current Docker code is.

Since Rancher is composed of a lot of different modules the packaging and build can be complex.  The easiest way to run a custom build environment is to use this container that we build that runs Rancher off of git master.  There are instructions at https://github.com/cloudnautique/cattle-repo-docker#simple-workflow on how to use it.  The first launch takes a long time as it download a lot of code, but after than it's pretty efficient.

Let me know how it goes.  If you are looking to run pure LXC, I would be curious to know why you would choose that over Docker with the LXC driver.

Darren

Syed Mushtaq

unread,
Feb 16, 2015, 11:13:51 AM2/16/15
to Darren S, ranc...@googlegroups.com
Hi Darren,

I plan to run pure LXC. For my research, I envision containers as a
complete VM where it is upto the user to decide how they want to use
it. Docker AFAIK limits to running only application per container.
There are workarounds like using supervisor to run child processes but
that is frowned upon. My ultimate goal is to design a workload
placement/migration algorithm which works across multiple clouds. I
choose containers as the isolation abstraction because of its
lightweight architecture and speed.

At this point, I am able to run the master of Cattle as a debug build
in eclipse on my laptop and using a VM as my Docker host. I am
currently trying to understand the code by adding breakpoints. Do you
have any pointers where I should start?
> --
> You received this message because you are subscribed to the Google Groups
> "Rancher" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rancherio+...@googlegroups.com.
> To post to this group, send email to ranc...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rancherio/9e8a649b-0ba3-440a-adf3-90cfa4f3be9c%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Darren S

unread,
Feb 16, 2015, 12:01:39 PM2/16/15
to ranc...@googlegroups.com, darren.s...@gmail.com
Cattle is pretty daunting code base.  The best place to start would be https://github.com/rancherio/rancher/wiki.  I might encourage you to try Docker and not pure LXC.  Docker does encourage running a single application per container, but that is just a philosophy and not a technical limitation.  Anything you can accomplish with LXC you can accomplish with Docker (especially if you use the LXC driver).  You should check out Dan Walsh's article about running systemd in Docker: http://developerblog.redhat.com/2014/05/05/running-systemd-within-docker-container/.  You can run (with a bit of tweaking) a full systemd to get you a VM like experience.

The thing is the technical issues you are going to face are basically the same between LXC and Docker, but you will just have to roll more of your own code with pure LXC.  With Docker 1.5 you have practically full control of namespaces too with --net=host, --ipc=host, and --pid=host.

Darren



On Monday, February 16, 2015 at 9:13:51 AM UTC-7, Syed Mushtaq wrote:
Hi Darren,

I plan to run pure LXC. For my research, I envision containers as a
complete VM where it is upto the user to decide how they want to use
it. Docker AFAIK limits to running only application per container.
There are workarounds like using supervisor to run child processes but
that is frowned upon. My ultimate goal is to design a workload
placement/migration algorithm which works across multiple clouds. I
choose containers as the isolation abstraction because of its
lightweight architecture and speed.

At this point, I am able to run the master of Cattle as a debug build
in eclipse on my laptop and using a VM as my Docker host. I am
currently trying to understand the code by adding breakpoints. Do you
have any pointers where I should start?

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages