-
Notifications
You must be signed in to change notification settings - Fork 0
5.1.1 Centos Docker Guide
Docker can be thought of as lightweight virtualization without a hypervisor. It is built on top of linux containers and allows applications to run in a sandboxed environment. Each container has its own IP address which allows us to test communications functionality of a distributed system.
Centos Docker Installation Guide
Either selinux should be disabled in /etc/sysconfig/selinux or via cmdline or add:
other_args="--selinux-enabled=true"
to /etc/sysconfig/docker
Add EPEL repo to yum: EPEL Installation
sudo yum install docker-io
sudo service docker start
sudo chkconfig docker on
sudo yum install docker
If sitting behind a proxy, it may be necessary to configure docker to provide it with the proxy settings. See this Docker article on Controlling and configuring Docker using Systemd for details.
Alternatively, on older distributions that don't support Systemd, it may be necessary to start the docker daemon as follows:
sudo HTTP_PROXY=<proxy> docker -d &
Images are built from a Dockerfile. An example Dockerfile for building orcm from git within a centos container can be found here. More example will be available in the future. To build an image:
git clone https://github.com/benmcclelland/orcm-centos.git
cd orcm-centos
docker build -t orcm .
or pull the pre-built image, but this one isn't guaranteed to be up to date with the latest orcm repo at all times.
docker pull benmcclelland/orcm-centos
A convenience script is available here for launching an orcm container cluster. Here is the general idea:
/usr/bin/docker run -d --name db -h db intel/orcm sudo -u postgres /usr/pgsql-9.3/bin/postmaster -p 5432 -D /var/lib/pgsql/9.3/data
/usr/bin/docker run -d --name master -h master --link db:db intel/orcm /opt/open-rcm/bin/orcmsched
/usr/bin/docker run -d --name agg01 -h agg01 --link db:db --link master:master intel/orcm /opt/open-rcm/bin/orcmd --omca db_odbc_dsn orcmdb_psql --omca db_odbc_user orcmuser:orcmpassword --omca db_odbc_table data_sample --omca sensor heartbeat,sigar
/usr/bin/docker run -d --name node001 -h node001 --link agg01:agg01 intel/orcm /opt/open-rcm/bin/orcmd --omca sensor heartbeat,sigar
/usr/bin/docker run -d --name node002 -h node002 --link agg01:agg01 --link node001:node001 intel/orcm /opt/open-rcm/bin/orcmd --omca sensor heartbeat,sigar
...
/usr/bin/docker run -it --rm --link master:master --link db:db intel/orcm /bin/bash
The -v
options allows us to bind mount a directory or file into the container from the host. So if you would like to test a new orcm configuration file, you can add the option:
-v /path/to/orcm-site.xml:/opt/open-rcm/etc/orcm-site.xml
to the above docker commands. If you want a shared home directory across the virtual cluster, you could add:
-v /home:/home
to the shell and compute nodes and they would all share the common home directory.
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
Home -> 5 Testing -> 5.1 Docker