[Gate-users] vGATE in Docker
Dávid Völgyes
david.volgyes at gmail.com
Tue Jul 1 18:40:34 CEST 2014
Hi,
There is no dockerfile for vgate3_vanilia because i did not find a way to
solve it with dockerfile. The recipe is this:
- fire up a virtualbox VM
- attach the vgate.vdi from the opengatecollaboration
- boot from a recovery cd, like R.I.P. or anything similar
- mount the vgate
(optional:
- chroot to vgate, and clean the apt cache with: apt-get clean)
- create a tar.gz from the vgate root
-export the tar.gz from the VM (shared directory, scp, anyhow)
- create a docker image from the tar.gz (see docker import)
- tag the docker image and upload it
After that you have a trustable base image, and you can modify it like i
did.
On long term OpengateCollaboration could publish official images, and that
way you don't have to choose between trustable source and convenience.
Another option to build Gate inside docker. This is definitely possible,
and yields much smaller final image (e.g. you do not need the whole ubuntu
desktop), but I did not do this because of two main reasons:
- I was lazy
- That way you have the exact same binaries like you would have in the
virtualbox. (you can directly compare speed, bugs should be the same, more
people test it, etc)
(If you want to check the vanilia edition, you can compare the md5 hashes
of the files.)
Anyway, I am really happy that somebody tried it and it works. Now I am on
holiday for a month, so I will not be able to do any sophisticated test or
benchmark but it would be nice to see how it works in practice.
So, if anybody has good or bad experience, then please share it.
Best,
David
On Jul 1, 2014 3:38 PM, "Mathieu Dupont" <mdupont at cppm.in2p3.fr> wrote:
> Hi
>
>
>
> I tried your dvolgyes/vgate3 and everything looks fine. I'm running docker
> on Archlinux. Nice job!
>
>
>
> I have a question for you. I didn't find the dockerfile or recipe for
> dvolgyes/vgate3_vanilia. How docker does kwnow what to download in order to
> build vgate3_vanilia container ? The page
> https://registry.hub.docker.com/u/dvolgyes/vgate3_vanilia/ doesn't help
> me.
>
>
>
>
>
> Thanks,
>
> Mathieu
>
>
>
>
>
> Le dimanche 29 juin 2014, 12:14:25 Dávid Völgyes a écrit :
>
> > Dear Gate users,
>
> >
>
> > A few days ago I announced the "vGATE inside docker" option.
>
> > But it looks like there was a problem with the image registration at
>
> > the Docker registry, and the images were unavailable time to time. I
>
> > am sorry for this inconvenience.
>
> > Now everything should be fixed, and the images are published.
>
> >
>
> > So If anybody tried to use my vGATE images but faced with problems,
>
> > then please, try it again, it should work now with the same workflow I
>
> > mentioned in my previous announcement.
>
> >
>
> > I hope this time everything will go smoothly.
>
> >
>
> > Best,
>
> > David
>
> >
>
> > On Thu, Jun 26, 2014 at 4:19 PM, Dávid Völgyes <david.volgyes at gmail.com>
> wrote:
>
> > > Dear Gate users,
>
> > >
>
> > > vGATE is nice, it really makes the first steps easier, but it runs in
>
> > > a virtualbox which is resource hungry compared to a native solution.
>
> > > However, it the last year another virtualization solution appeared,
>
> > > this is the "docker".
>
> > > Docker is an operating system level virtualization, therefore it does
>
> > > not emulate CPU instructions, and in a lot of way, it's much lighter
>
> > > than a classic virtual machine, and also much faster. An application
>
> > > inside docker runs almost with native speed, the kernel only checks
>
> > > the rights (e.g. file access, etc.)
>
> > > (
>
> > >
> http://en.wikipedia.org/wiki/Operating_system%E2%80%93level_virtualizatio
>
> > > n )
>
> > >
>
> > > So if you use 64bit Linux with kernel 3.8 or fresher, then you can use
>
> > > docker. Windows machines, 32bit distributions, etc. are not supported,
>
> > > or not in a way you think. (On windows docker starts a linux kernel
>
> > > inside a virtual machine, so you lose the "lightweight" part.)
>
> > >
>
> > > Docker is not an ultimate solution, but it is another option. Almost
>
> > > like a virtual machine from management point of view with almost
>
> > > native speed. Still, the native compiled GATE and the vGATE virtual
>
> > > environment will have their roll, and docker is somewhere between
>
> > > these two. There is another big deal with docker: portability. You can
>
> > > move/copy your docker images inside your cluster and even the largest
>
> > > cloud providers directly support docker images. (E.g. Google Cloud
>
> > > Engine)
>
> > >
>
> > > Of course, you should read the docker documentation:
>
> > > http://docs.docker.com/
>
> > >
>
> > > Well, how can you access the docker image?
>
> > > First of all, you can create yours if you do not trust in my version.
>
> > > Copy the content of the vGATE image into a tar.gz file, import it from
>
> > > Docker, and run it with "su gate -l " option which will simulate a
>
> > > login.
>
> > >
>
> > > But I already made this, and a bit more. Docker has a hub (
>
> > > https://registry.hub.docker.com/ ) where image files can be shared.
>
> > > I published two vGATE image there: dvolgyes/vgate3 and
>
> > > dvolgyes/vgate3_vanilia.
>
> > >
>
> > > The vanilia version means that it's unmodified (except I deleted the
>
> > > apt cache to reduce the size.) It is nothing more than an imported
>
> > > filesystem from the official vGATE image.
>
> > > The dvolgyes/vgate3 image is a bit modified. First of all, if you run
>
> > > it without parameters, then it will start a shell as "gate" user, and
>
> > > everything has been set. But you can also run Gate directly (or other
>
> > > scripts) in a non-interactive mode. For this I had to set some
>
> > > environmental variables, and I had to modifiy the bash config files. I
>
> > > also added "sudo" rights to the "gate" user. This image is better than
>
> > > the vanilia, but I also wanted an unmodified version, because it can
>
> > > be a good start for other customizations.
>
> > >
>
> > > So the easiest way to try it:
>
> > >
>
> > > docker run -t -i dvolgyes/vgate3 [COMMAND]
>
> > >
>
> > > Where command can be anything, e.g. your simulation script, or just
>
> > > "Gate", or anything else.
>
> > > If you do not give any command, then a shell will start.
>
> > >
>
> > > You can share directories between the host and the container, with
>
> > > this: -v /HOSTDIR:/GUESTDIR
>
> > > E.g.
>
> > > docker run -v /opt/my_latest_simulation/:/opt/sim/ -t -i
>
> > > dvolgyes/vgate3 /opt/sim/simulation.sh
>
> > >
>
> > > The "run" command generates a new container every time from the image.
>
> > > (Image is a read-only thing, container is an execution environment.
>
> > > The relationship is like the class and object have in C++) When you
>
> > > left the executed container, next time you probably want to start this
>
> > > container with the "start" command.
>
> > > You really should check the docker documentation at this point, at
>
> > > least to understand the "run", "start" and the other command line
>
> > > options in the above examples.
>
> > >
>
> > > Docker images are generated from "Dockerfile" which is a kind of
>
> > > recipe to build the image. I published mine at github, if you want to
>
> > > check it, modify it, etc. Of course, it would be possible to recompile
>
> > > GATE inside a docker container, but I wanted to stay as close as
>
> > > possible to the vGATE version, so I use the exact same binaries. This
>
> > > way you can easily compare the performance of the virtualbox and the
>
> > > docker version.
>
> > >
>
> > > So the github repository: https://github.com/dvolgyes/dockerfiles
>
> > > (Check the GATE directory.)
>
> > >
>
> > > I encourage everybody to try and use docker in general, because it's
>
> > > cool. E.g. you can have several GATE/ROOT/Geant environments on the
>
> > > same machine, and they are separated and still fast. You can use
>
> > > cutting edge git version and change back to any previous version in a
>
> > > few seconds. And so on.
>
> > >
>
> > > Well, that's it. I hope it will be useful.
>
> > > If you have any problem related to the docker images, please let me
> know.
>
> > > But please, do not ask about GATE, read the GATE manual instead. The
>
> > > same is true for vGATE and for docker (commands, install, etc.)
>
> > >
>
> > >
>
> > > Best regards,
>
> > >
>
> > > David
>
> > >
>
> > > u.i.: I know that I did not finish the README file on github. I will
>
> > > do it sometime.
>
> >
>
> > _______________________________________________
>
> > Gate-users mailing list
>
> > Gate-users at lists.opengatecollaboration.org
>
> > http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>
> --
>
> Mathieu Dupont
>
> Docteur au Centre de Physique des Particules de Marseille
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20140701/9ad3c8ed/attachment-0001.html>
More information about the Gate-users
mailing list