Public Repository

Last pushed: 2 years ago
Short Description
Repository with pre-build opensaf versions. Contains also compile ready development environments.
Full Description

OpenSAF - Open Source High Availability Middleware


This repository contains pre-build OpenSAF middleware.
OpenSAF is Open Source High Availability Middleware based on SA Forum Specifications.

See:
https://sourceforge.net/projects/opensaf

Supplied image tags and respective Dockerfile links

  • 4.6-ubuntu-15 is pre-build OpenSAF 4.6 on ubuntu 15.04 (Dockerfile)
  • 4.6-ubuntu-14 is pre-build OpenSAF 4.6 on ubuntu 14.04 (Dockerfile)
  • 4.6-debian-8.0 is pre-build OpenSAF 4.6 on debian 8.0 (Dockerfile)
  • 4.6.FC-fedora-21 is pre-build OpenSAF 4.6.FC on fedora 21 (Dockerfile).
  • imm-aas-4.6-debian-7.6 is pre-build stand alone IMM Service.
  • imm-app-4.6-debian-7.6 is pre-build image that can use IMM in isolation.
  • 4.x-ubuntu-14-dev is build ready environment for OpenSAF 4.x on ubuntu 14.04 (Dockerfile)
  • tipc-kernel-3.19.0.rc4 is pre-build Linux kernel with TIPC module with namespace support.

Latest updates

  • [2015-05-29] Changed debian 7.6 to debian 8.0
  • [2015-01-21] Added dockerfiles and scripts in github (adrian77/docker).
  • [2015-01-18] Added tipc-kernel-3.19.0.rc4 image with compiled linux kernel.
  • [2015-01-18] TIPC configuration support added in the 4.6-ubuntu-14 image. (Requires linux kernel with TIPC module with namespace support. Minimum 3.19.0.rc4+ && CONFIG_TIPC=m)
  • [2015-01-18] Updated 4.x-ubuntu-14-dev image with enabling all opensaf services to be compiled and packaged as rpms.
  • [2014-10-08] Example of stand alone IMM service made as a service.
  • [2014-10-08] Vanilla debian image imm-app including PaaS catalogue under /opt/osaf-paas-repository with few libraries and imm commands showing how an isolated application can work with IMM

Note. When creating imm-aas and imm-app the containers must share /var/lib/opensaf. The imm-app container instances shall have this volume mounted as :ro.

Note. The opensaf code is changed to achieve this.

Next

  • Remove the need of --privileged. Currently it used for some realtime threads.
  • Cluster management container of opensaf cluster. The container will manage docker daemon from inside container.
  • Configuration of network so containers can communicate without being collocated on same host.

Pre-build OpenSAF content and configuration

The builds contains by default the following services:

  • OpenSAF Availability Service
  • OpenSAF Cluster Membership Service
  • OpenSAF Checkpoint Service
  • OpenSAF Information Model Management Service
  • OpenSAF LOG Service
  • OpenSAF Notification Service
  • OpenSAF Software Management Framework Service

Default internal cluster communication is TCP.
If you want to use TIPC; just pass --env TIPC=yes when creating the container.

IMM is configured with PBE (Persistent BackEnd).
When using two controllers shared fs is simply achieved by passing -v /home/adrian/sharedfs:/etc/opensaf/sharedfs when starting the container. The /home/opensaf/setup-opensaf-node script will detect this and generate the IMM configuration into this directory and configure the /etc/immnd.conf accordingly.

By default processes are running as opensaf user.

Starting container

I recommend for simplicity using the SC-1, SC-2, PL-3, PL-4...PL-N notion.
The setup-opensaf-node script relies on this notion.
The default IMM configuration contain availability model for 2 controllers and 8 payloads.
Started containers will automatically be configured into the same cluster.

Starting up first controller:

NODE=SC-1 && sudo docker run --privileged -t --env TIPC=no --name $NODE -h $NODE -v $HOME/sharedfs:/etc/opensaf/sharedfs -i adrianszwej/opensaf:4.6-ubuntu-14 /bin/bash

$ /etc/init.d/opensafd start

That should print:

  Starting OpenSAF Services:                                 [  OK  ]

Starting up second controller and one payload:

NODE=SC-2 && sudo docker run --privileged -t --env TIPC=no --name $NODE -h $NODE -v $HOME/sharedfs:/etc/opensaf/sharedfs -i adrianszwej/opensaf:4.6-ubuntu-14 /bin/bash

$ /etc/init.d/opensafd start

NODE=PL-3 && sudo docker run --privileged -t --env TIPC=no --name $NODE -h $NODE -v $HOME/sharedfs:/etc/opensaf/sharedfs -i adrianszwej/opensaf:4.6-ubuntu-14 /bin/bash

$ /etc/init.d/opensafd start

Running following command confirm the nodes are in operational state.

$ amf-state node oper | grep B1 ENABLED

safAmfNode=SC-1,safAmfCluster=myAmfCluster
    saAmfNodeOperState=ENABLED
safAmfNode=SC-2,safAmfCluster=myAmfCluster
    saAmfNodeOperState=ENABLED
safAmfNode=PL-3,safAmfCluster=myAmfCluster
    saAmfNodeOperState=ENABLED

Starting container with build environment for OpenSAF

NODE=SC-1 && sudo docker run --privileged -t --name $NODE -h $NODE -v $HOME/sharedfs:/etc/opensaf/sharedfs -i adrianszwej/opensaf:4.x-ubuntu-14-dev /bin/bash

1) Building opensaf

cd /home/opensaf
./download-opensaf
./configure-opensaf-full
./install

2) Configuration

Everything is configured out of the box in /home/opensaf/setup-opensaf-node script.

3) Startup

Start opensaf /home/opensaf/setup-opensaf-node && /etc/init.d/opensafd start

Using TIPC between containers

NOTE! When you add the compiled kernel below docker will no longer show your images and containers for some reason I cannot explain. Reverting back to your old will show your containers. So I suggest your mv out your /var/lib/docker directory before reboot the node.

sudo docker run -d --name tipc-kernel -i adrianszwej/opensaf:tipc-kernel-3.19.0.rc4 /bin/sh
sudo docker cp tipc-kernel:/INBOX /tmp
cd /tmp/INBOX
vi README

And follow the simple instructions how to install the kernel package and load the tipc kernel module.

Fedora systemd + rsyslog + openssh + opensaf

For those that want to get opensaf started using systemd together with rsyslog; use the following dockerfile.

FROM fedora:21
MAINTAINER Adrian Szwej <adrian.szwej@xxx>
# make sure the package repository is up to date
#RUN yum -y update

# Install basic syslog and ssh server
RUN yum -y install systemd rsyslog openssh-server; yum clean all
RUN systemctl enable rsyslog.service

# --- SSH ---
# Install ssh server. NOTE: You should not use ssh; better nsenter
# http://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/
RUN yum -y install openssh-server
# Generate the SSH keys
RUN ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
RUN ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN echo 'root:password' | chpasswd
RUN systemctl enable sshd.service
# --- SSH ---

# Packages for usuability
RUN yum -y install vim

# Packages needed for OpenSAF runtime
RUN yum -y install net-tools sqlite3 libxml2 redhat-lsb-core

# Packages needed for building OpenSAF
RUN yum -y install gcc gcc-c++ libxml2-devel automake m4 autoconf libtool pkg-config make python-devel sqlite-devel

# Packages needed for OpenSAF development
RUN yum -y install mercurial
RUN groupadd opensaf
RUN useradd -r -g opensaf -d /var/run/opensaf -s /sbin/nologin -c "OpenSAF" opensaf
RUN echo 'opensaf ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, /usr/bin/pkill, /usr/bin/killall' >> /etc/sudoers
RUN echo 'Defaults:%opensaf !requiretty' >> /etc/sudoers
RUN echo 'Defaults:opensaf !requiretty' >> /etc/sudoers

RUN mkdir -p /home/opensaf

# Add helper scripts normally executed in the following order
ADD download-opensaf /home/opensaf/download-opensaf
ADD configure-opensaf /home/opensaf/configure-opensaf
ADD install-opensaf /home/opensaf/install-opensaf
ADD setup-opensaf-node /home/opensaf/setup-opensaf-node
ADD start-opensaf /home/opensaf/start-opensaf
ADD doall-opensaf /home/opensaf/doall-opensaf

# Pass configuration for utility scripts
ENV container docker

# Clean up
RUN yum clean all

# Make sure systemd starts
CMD ["/usr/sbin/init"]

After building the image; you need to run the docker container with following command:

NODE=SC-1 && sudo docker run --privileged -d -t --name $NODE -h $NODE -i -v /sys/fs/cgroup:/sys/fs/cgroup -v /home/adrian/sharedfs:/etc/opensaf/sharedfs -p 23:22 <img>

Enter container using ssh:

ssh root@localhost -p 23

Change the /etc/init.d/opensafd adding following line:

. /lib/lsb/init-functions
/home/opensaf/setup-opensaf-node

Enable automatic start of opensaf via systemd next time container is started.

$ systemctl enable opensafd.service

Startup opensafd using systemd.

$ systemctl start opensafd

Upcoming

I am planning to create additional OpenSAF flavors / configurations:

  • Small busybox based container showing strength of OpenSAF being cheap in resources and portable LSB 4.0 MW targeting embedded environments.
  • Container with demo applications
  • OpenSAF cluster container management with OpenStack
  • Provide docker&cluster management scripts that I am using
  • Provide bridge information how to connect networks from different host

Please comment if you have further interesting proposals.

Docker Pull Command
Owner
adrianszwej

Comments (2)
sandey60
8 months ago

What docker version and the host Operating system were these tested. None of these images work on Docker version 1.13.0, build 49bf474 and Centos 7

sandey60
8 months ago

When I try the fedora Docker file on centos 7. I am seeing the following error when starting opensaf.

bash-4.3# /etc/init.d/opensafd start
Starting OpenSAF Services (Using TCP): [FAILED]

So, I tried running the service using service/systemctl and saw the following error.

bash-4.3# systemctl start opensafd.service
Failed to get D-Bus connection: Unknown error -1