Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Titan in Docker part 1
Titan in Docker part 1 [message #1781606] Fri, 09 February 2018 10:47 Go to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Titan in Docker part I

Dear all,


there have been voices from the crowd requesting a Titan release in Docker.

There are a number of reasons why we don't release Docker images with Titan installed inside:

-these images are quite large (we are talking Gigabytes)
-if we produce such images, these require , besides building, time and resources for testing them
-installing Titan , at least the core , is a matter of a couple of minutes even from source; the pre-compiled binaries only need to be downloaded and unpacked
(or if you have later Ubuntu/Debian versions, Titan can be installed from package ), so distributing it in Docker images
would not be a great time saving

However we understand the advantages of having a Docker image containing Titan so we will try to help you by publishing
Dockerfiles that can be used to produce such images.

The Dockerfiles ( simple text files really, akin to shell scripts ) contain a recipe which is read by Docker and used to cook for you a Docker image.
They can be used "as is" or tailored (using a magic trick known as 'editing' ) to your wishes and environment.
There are a number of variables that can be controlled by editing the Dockerfiles: the Linux distro , the gcc and Titan version etc.

The below Dockerfile for instance will create an Ubuntu 16.04 LTS image with Titan 6.3.0 installed from the published binaries.

## TITAN Dockerfile (Ubuntu 16.04)
FROM ubuntu:16.04
MAINTAINER Gergely Pilisi 
LABEL description="Eclipse Titan Docker Image"

## ENVIRONMENT
ENV TERM=linux
ENV HOSTNAME eclipse-titan

## PREPARE THE SYSTEM
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y git build-essential flex bison expect default-jdk libssl-dev libxml2-dev libncurses5-dev wget

## ADD TITAN USER
RUN useradd --create-home --shell /bin/bash titan
RUN echo "titan:titan" | chpasswd
RUN adduser titan sudo
RUN mkdir -p /home/titan/ttcn3-6.3.pl0

## GET TITAN
WORKDIR /home/titan/ttcn3-6.3.pl0
RUN  wget -O ttcn3-6.3.pl0-linux64-gcc5.4-ubuntu16.04.tgz https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-6.3.pl0-linux64-gcc5.4-ubuntu16.04.tgz\&r=1
RUN tar -xvzf ttcn3-6.3.pl0-linux64-gcc5.4-ubuntu16.04.tgz
RUN rm -f ttcn3-6.3.pl0-linux64-gcc5.4-ubuntu16.04.tgz

## SET ENVIRONMENTAL VARIABLES
ENV TTCN3_DIR=/home/titan/ttcn3-6.3.pl0
ENV PATH=$TTCN3_DIR/bin:$PATH
ENV LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

## CHECK TITAN
RUN compiler -v

CMD ["/bin/bash"]

USER titan
WORKDIR /home/titan
 



Please be aware that the content of this Dockerfile may go stale as, when binaries for the next release will be published ,
6.3.0 binaries may ( and likely will ) become unavailable.



The next example will create a Ubuntu 16.04 LTS image with Titan installed from the latest source available in github:


FROM ubuntu:16.04
MAINTAINER Gergely Pilisi 
LABEL description="Eclipse Titan Docker Image"

## ENVIRONMENT
ENV TERM=linux
ENV HOSTNAME eclipse-titan

## PREPARE THE SYSTEM
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y git build-essential flex bison expect default-jdk libssl-dev libxml2-dev libncurses5-dev

## ADD TITAN USER
RUN useradd --create-home --shell /bin/bash titan
RUN echo "titan:titan" | chpasswd
RUN adduser titan sudo

## CLONE TITAN INTO /home/titan.core
WORKDIR /home/titan
RUN git clone https://github.com/eclipse/titan.core.git

## BUILD TITAN
WORKDIR /home/titan/titan.core
RUN make install

## SET ENVIRONMENTAL VARIABLESS
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH
ENV LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

## CHECK TITAN
RUN compiler -v

CMD ["/bin/bash"]

USER titan
WORKDIR /home/titan
 



Instead of the latest source one may clone a tagged git release;
Tags are listed here:

https://github.com/eclipse/titan.core/releases


The created image will have the below characteristics:


titan@eclipse-titan:~$ uname -a
Linux eclipse-titan 3.13.0-141-generic #190-Ubuntu SMP Fri Jan 19 12:52:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"


titan@eclipse-titan:~$ whoami
titan

titan@eclipse-titan:~$ openssl version 
OpenSSL 1.0.2g  1 Mar 2016

titan@eclipse-titan:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.6' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6) 

titan@eclipse-titan:~$ which compiler
/home/titan/titan.core/Install/bin/compiler

titan@eclipse-titan:~$ compiler -v
TTCN-3 and ASN.1 Compiler for the TTCN-3 Test Executor
Product number: CRL 113 200/6 R3B
Build date: Feb  7 2018 15:23:13
Compiled with: GCC 5.4.0
Using OpenSSL 1.0.2g  1 Mar 2016

Copyright (c) 2000-2017 Ericsson Telecom AB
 






To be continued

Best regards

Elemer








Re: Titan in Docker part 1 [message #1782059 is a reply to message #1781606] Fri, 16 February 2018 15:34 Go to previous messageGo to next message
Harald Welte is currently offline Harald WelteFriend
Messages: 48
Registered: July 2017
Location: Berlin, Germany
Member

Just in case anyone is looking for more real-world examples: At osmocom.org we're heavily using dockerized TITAN together with jenkins as part of our continuous integration setup. We run both the test suite inside a docker container, as well as the IUT. We use the junit logger plugin to generate test result reporting like https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-msc-test/test_results_analyzer/ (click on "expand all")

* Dockerfiles in http://git.osmocom.org/docker-playground/ , e.g. http://git.osmocom.org/docker-playground/tree/ttcn3-msc-test/Dockerfile using http://git.osmocom.org/docker-playground/tree/debian-stretch-titan/Dockerfile as basis
* script executed by jenkins to start docker containers for test suite and IUT: http://git.osmocom.org/docker-playground/tree/ttcn3-msc-test/jenkins.sh
* per-testcase tcpdump/pcap integration (much improved over the example in the TITAN reference manual which has many shortcomings). Those pcap files are then automatically stored as build artefacts in jenkins. Scripts at: http://git.osmocom.org/osmo-ttcn3-hacks/tree/ttcn3-tcpdump-start.sh and http://git.osmocom.org/osmo-ttcn3-hacks/tree/ttcn3-tcpdump-stop.sh executed from http://git.osmocom.org/osmo-ttcn3-hacks/tree/Common.cfg which we use as [ORDERED_INCLUDE] from the individual test suite configs
Re: Titan in Docker part 1 [message #1782095 is a reply to message #1782059] Sat, 17 February 2018 08:56 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Thank you ,Harald,

it's great to see Titan being put to good use.

Best regards
Elemer
Previous Topic:help,help,help,about repgen
Next Topic:isbound(component_reference) == false in 6.1.0?
Goto Forum:
  


Current Time: Tue Sep 25 06:43:26 GMT 2018

Powered by FUDForum. Page generated in 0.02100 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top