Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
wiki:oar-docker [2014/09/04 10:25] – [Logs] neyronwiki:oar-docker [2015/05/06 18:08] – [Installation] neyron
Line 1: Line 1:
 ======  Build your own OAR cluster with docker  ====== ======  Build your own OAR cluster with docker  ======
  
-OAR-docker is a set of docker images especially configured for deploying your own OAR cluster. The main idea is to have a mini development cluster with a frontend, a server and some nodes that launch in just a few seconds on a simple laptop.+oar-docker is a set of docker images especially configured for deploying your own OAR cluster. The main idea is to have a mini development cluster with a frontend, a server and some nodes that launch in just a few seconds on a simple laptop. 
 + 
 +OAR-docker's repository is hosted on github: https://github.com/oar-team/oar-docker. 
 +It's currently in active development, but feel free to clone it and give it a try !
  
 ======  Why use OAR-docker ?  ====== ======  Why use OAR-docker ?  ======
Line 12: Line 15:
   * Synced volume : allowing you to continue working on your host machine, but use the resources in the guest machine to compile or run your project.   * Synced volume : allowing you to continue working on your host machine, but use the resources in the guest machine to compile or run your project.
  
-======  Demo  ======+======  Installation  ======
  
 +Requirements:
  
 +  * python 2.7
 +  * docker >= 1.3
  
-[[https://asciinema.org/a/8353|{{ :wiki:docker-oarcluster-screenshot.png?nolink&600 |}}]]+You can install, upgrade, uninstall oar-docker with these commands:
  
 +<code console>
 +$ pip install oar-docker
 +$ pip install --upgrade oar-docker
 +$ pip uninstall oar-docker
 +</code>
  
-====== Download =====+Or from git (last development version):
  
-OAR-docker's repository is hosted on github: https://github.com/oar-team/oar-docker. +<code console> 
-It's currently an alpha-release, but feel free to clone it and give it a try !+$ pip install git+https://github.com/oar-team/oar-docker.git 
 +</code>
  
-<code bash+Or if you already pulled the sources: 
-git clone https://github.com/oar-team/oar-docker.git+ 
 +<code console
 +pip install path/to/sources
 </code> </code>
  
-Please send us any feedback to oar-devel@lists.gforge.inria.fr or via github. OAR-docker is in active development.+Or if you want to install in the python user context (in your home directory), add the '--user' option to all pip commands: 
 +<code> 
 +pip install --user oar-docker 
 +</code>
  
-======  Logs  ======+Or if you don't have pip:
  
-  * A minimal Ubuntu base image modified for Docker-friendliness_ +<code console> 
-  * Got a Minute? Spin up a Spark cluster on your laptop with Docker_+$ easy_install oar-docker 
 +</code> 
 +====== Usage =====
  
 +  Usage: oardocker [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
  
- --- //[[salem.harrache@imag.fr|Salem Harrache]] 2014/05/22 10:05//+    Manage a small OAR developpement cluster with docker. 
 +   
 +  Options: 
 +    --workdir DIRECTORY   Changes the folder to operate on. 
 +    --docker-host TEXT    The docker socket [default:unix://var/run/docker.sock] 
 +    --cgroup-path TEXT    The cgroup file system path [default: /sys/fs/cgroup] 
 +    --docker-binary TEXT  The docker client binary [default: docker] 
 +    --version             Show the version and exit. 
 +    -h, --help            Show this message and exit. 
 +   
 +  Commands: 
 +    build       Build base images 
 +    clean       Remove all stopped containers and untagged... 
 +    connect     Connect to a node. 
 +    destroy     Stop containers and remove all images 
 +    init        Initialize a new environment. 
 +    install     Install and configure OAR from src 
 +    logs        Fetch the logs of all containers. 
 +    ssh         Connect to machine via SSH [deprecated] 
 +    ssh-config  Output OpenSSH valid ssh config [deprecated] 
 +    start       Create and start the containers 
 +    status      Output status of the cluster 
 +    stop        Stop and remove all containers
  
-docker-oarcluster now takes a OAR tarball as parameter. You can use either the URL to the last tarball, e.g.+======  Getting started  ====== 
-<code bash+ 
-docker-oarcluster./build.sh http://oar-ftp.imag.fr/oar/2.5/sources/stable/oar-2.5.3.tar.gz +To get started with oar-dockerthe first thing to do is to initialize a project: 
-...+ 
 +<code console
 +oardocker init
 </code> </code>
-Or a freshly generated tarball, from your GIT clone of OAR's repository, e.g. (assuming you have both clone of OAR and docker-oarcluster stored in a same directory)+ 
-<code bash+If you already have OAR sources, the best is to initialize directly the oardocker project in the OAR sources directory: 
-oarmake tarball + 
-./misc/make_tarball +<code console
-Using the Git repository '/home/neyron/scm/OAR/oar+cd path/to/oar/src 
-Using the Git tree-ish   '2.5' +oardocker init
-../tarballs/oar-2.5.3+149.g529ff05.tar.gz +
-oarcd ../docker-oarcluster +
-docker-oarcluster$ ./build.sh ../tarballs/oar-2.5.3+149.g529ff05.tar.gz +
-...+
 </code> </code>
 +
 +You have to do this only once. It allows you to import the Dockerfiles and other configuration files. We then launch the base image build:
 +
 +<code console>
 +$ oardocker build
 +</code>
 +
 +Now, we have to install OAR. To do this, several options are available. If you already have the OAR sources:
 +
 +<code console>
 +$ oardocker install .   ## ou . est le chemin vers les sources de OAR
 +</code>
 +
 +Or if you want to install from tarball:
 +
 +<code console>
 +$ oardocker install http://oar-ftp.imag.fr/oar/2.5/sources/testing/oar-2.5.4+rc4.tar.gz
 +</code>
 +
 +You can also launch the installation from a git repository:
 +
 +<code console>
 +$ oardocker install git+https://github.com/oar-team/oar.git
 +</code>
 +
 +We start a OAR cluster with 5 nodes:
 +
 +<code console>
 +$ oardocker start -n 5
 +</code>
 +
 +It is possible to share directories between host machines and all containers with the ''-v'' option:
 +
 +<code console>
 +$ oardocker start -v $PWD:/oar_src -v /my/custom/lib:/usr/local/ma_lib
 +</code>
 +
 +To manage the cluster:
 +
 +<code console>
 +$ oardocker connect frontend|server|nodeXX
 +$ oardocker logs [frontend|server|nodeXX]
 +</code>
 +
 +To clean:
 +
 +<code console>
 +$ oardocker stop  ## stops and removes all containers
 +$ oardocker clean  ## removes all stopped containers (failed) and the untagged images <none:none>
 +$ oardocker destroy  ## removes all images and containers
 +</code>
 +
 +With oar-docker, it is possible to chain all commands to go faster:
 +
 +<code console>
 +$ oardocker init -f build install oar-2.5.4+rc4.tar.gz start -n 4 connect -l root frontend
 +</code>
 +
 +For instance, to develop on OAR, we often need to install OAR, start the cluster and connect to it:
 +
 +<code console>
 +$ oardocker install $PWD start -n 10 -v $PWD:/home/docker/oar_src connect frontend
 +</code>
 +
 +One last thing to know. The ''stop'' command is automatically launched before every ''start'', ''install'' and ''build'' ... If we launch multiple times the last command, we will always obtain the same result. It can be useful to experiment and develop (even) faster.
 +
 +
 +======  Security  ======
 +
 +oar-docker is a development project and a testing one. It is in no way secure.
 +Besides, the private ssh key used is also insecured since it is public (you can
 +find it in the sources).
 +
 +======  Logs  ======
 +
 +
  --- //[[pierre.neyron@imag.fr|Pierre Neyron]] 2014/07/22 20:57//  --- //[[pierre.neyron@imag.fr|Pierre Neyron]] 2014/07/22 20:57//
  
wiki/oar-docker.txt · Last modified: 2020/03/31 15:43 by neyron
Recent changes RSS feed GNU Free Documentation License 1.3 Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki