Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Titan 6.4.0 Docker images published in DockerHub(Titan in Docker part 2)
Titan 6.4.0 Docker images published in DockerHub [message #1792243] Fri, 13 July 2018 07:36 Go to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Dear all,


for those of you who wish to play with Titan in the form of a docker image,

we have published two such images in DockerHub:

https://hub.docker.com/u/eclipsetitan/


https://hub.docker.com/r/eclipsetitan/titan-alpine/
A minimal Docker image for Eclipse Titan 6.4.0 based on Alpine Linux.

pull with:

docker pull eclipsetitan/titan-alpine:6.4.0


https://hub.docker.com/r/eclipsetitan/titan-ubuntu/
A Docker image for Eclipse Titan 6.4.0 based on Ubuntu 18.04 LTS.

pull with:

docker pull eclipsetitan/titan-ubuntu:6.4.0


The Dockerfiles used to generate these images:

FROM alpine:edge
MAINTAINER Aron Simon <aron.simon@sigmatechnology.se>

## INSTALL DEPENDENCIES
RUN apk update && \
    apk add --no-cache sudo make git g++ diffutils expect openssl-dev libxml2-dev libxml2-utils ncurses-dev flex bison perl libexecinfo-dev bash

## CREATE SUDOER USER
RUN adduser -S -D -G root -h /home/titan -s /bin/bash titan && \
    echo "titan:titan" | chpasswd && \
    echo "titan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER titan

## SETUP .BASHRC TO SETUP HOSTS FILE AT THE BOOT TIME
RUN echo 'sudo sh -c "cp /etc/hosts /etc/append && (echo \"127.0.1.1  $HOSTNAME\"; cat /etc/append) > /etc/hosts"' >> /home/titan/.bashrc
RUN echo 'sh' >> /home/titan/.bashrc

## SET UP ENV VARIABLES
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
    LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

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

## SET FLAGS
RUN echo 'ALPINE_LINUX := yes \n\
          TTCN3_DIR := /home/titan/titan.core/Install \n\
          XMLDIR := /usr \n\
          OPENSSL_DIR := /usr \n\
          JNI := no \n\
          GEN_PDF := no' >> Makefile.personal

## BUILD TITAN
RUN make install

ENTRYPOINT /bin/bash 


and

FROM ubuntu:18.04
MAINTAINER Aron Simon <aron.simon@sigmatechnology.se>

ENV DEBIAN_FRONTEND=noninteractive

## INSTALL DEPENDENCIES
RUN apt-get update && \
    apt-get install -yq \
                    git gdb curl expect g++ make libssl-dev \
                    libxml2-dev libncurses5-dev flex bison \
                    xutils-dev ant xsltproc automake perl sudo

## CREATE SUDOER USER
RUN useradd --create-home --shell /bin/bash titan && \
    adduser --disabled-password titan sudo && \
    echo "titan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER titan

## SETUP .BASHRC TO SETUP HOSTS FILE AT THE BOOT TIME 150.132.184.69
RUN echo 'sudo sh -c "cp /etc/hosts /etc/append && (echo \"127.0.1.1  $HOSTNAME\"; cat /etc/append) > /etc/hosts"' >> /home/titan/.bashrc

## SET UP ENV VARIABLES
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
    LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

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

## SET FLAGS
RUN echo 'TTCN3_DIR := /home/titan/titan.core/Install' >> Makefile.personal
RUN echo 'XMLDIR := /usr' >> Makefile.personal
RUN echo 'OPENSSL_DIR := /usr' >> Makefile.personal
RUN echo 'JNI := no' >> Makefile.personal
RUN echo 'GEN_PDF := no' >> Makefile.personal

## BUILD TITAN
RUN make install 



For some other examples of Dockerfiles , please see :

Titan in Docker part 1
https://www.eclipse.org/forums/index.php/t/1091625/


Looking forward to your feedback

Best regards
Elemer

[Updated on: Fri, 13 July 2018 16:29]

Report message to a moderator

Re: Titan 6.4.0 Docker images published in DockerHub [message #1792537 is a reply to message #1792243] Thu, 19 July 2018 09:00 Go to previous messageGo to next message
Aron Simon is currently offline Aron SimonFriend
Messages: 1
Registered: July 2018
Junior Member
Dear all,


As time passes, we acquire more experience with the Titan images published and we update them regularly;
hence we recommend pulling them again from time to time, as we will indicate in this forum.

Although the interactive mode of the images works perfectly, there might be some glitches in the non-interactive one;
on Tuesday I tried to use the published Titan images in non-interactive mode, as below:

docker run eclipsetitan/titan-alpine ls


The created container executed without the expected logs. I tried to fix it as soon as possible as the non-interactive mode is the basis of the automated builds.

The reason of the problem is a conflict between the Docker CMD and our personalized bash initial mechanism, which we tried to fix the hosts file with:
## SETUP .BASHRC TO SETUP HOSTS FILE AT THE BOOT TIME
RUN echo 'sudo sh -c "cp /etc/hosts /etc/append && (echo \"127.0.1.1  $HOSTNAME\"; cat /etc/append) > /etc/hosts"' >> /home/titan/.bashrc

...

ENTRYPOINT /bin/bash


We gave up this modification for now, so the non-interactive mode is working again.

Without this fix, the following feature is not working yet in TTCN3 (create component explicitly in "localhost"):

var MyComponentType myNewComponent := MyComponentType.create("My component name", "localhost")


The relevant test is here.

An example of how to run the Titan demo-project in Docker using non-interactive mode:
docker run eclipsetitan/titan-alpine sh -c 'cd TTCN3_DIR/demo && make && ttcn3_start MyExample MyExample.cfg'


The simplified Dockerfile for titan-alpine:
FROM alpine:edge
MAINTAINER Aron Simon <aron.simon@sigmatechnology.se>

## INSTALL DEPENDENCIES
RUN apk update && \
    apk add --no-cache \
        sudo make git g++ diffutils expect openssl-dev \
        libxml2-dev libxml2-utils ncurses-dev flex bison \
        perl libexecinfo-dev bash

## CREATE SUDOER USER
RUN adduser -S -D -G root -h /home/titan titan && \
    echo "titan:titan" | chpasswd && \
    echo "titan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER titan

## SET UP ENV VARIABLES
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
    LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

## CLONE TITAN
WORKDIR /home/titan
RUN git clone https://github.com/eclipse/titan.core.git
# Checkout release 6.4.0
WORKDIR /home/titan/titan.core/
RUN git checkout tags/6.4.0

## SET Makefile.personal
# ALPINE_LINUX := yes
# TTCN3_DIR := /home/titan/titan.core/Install
# XMLDIR := /usr
# OPENSSL_DIR := /usr
# JNI := no
# GEN_PDF := no
COPY Makefile.personal-alpine Makefile.personal

## BUILD TITAN
RUN make install

WORKDIR /home/titan
CMD compiler -v && /bin/sh


The simplified Dockerfile for titan-ubuntu:
FROM ubuntu:18.04
MAINTAINER Aron Simon <aron.simon@sigmatechnology.se>

ENV DEBIAN_FRONTEND=noninteractive

## INSTALL DEPENDENCIES
RUN apt-get update && \
    apt-get install -yq \
                    git gdb curl expect g++ make libssl-dev \
                    libxml2-dev libncurses5-dev flex bison \
                    xutils-dev ant xsltproc automake perl sudo

## CREATE SUDOER USER
RUN useradd --create-home --shell /bin/bash titan && \
    adduser --disabled-password titan sudo && \
    echo "titan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER titan

## SET UP ENV VARIABLES
ENV TTCN3_DIR=/home/titan/titan.core/Install
ENV PATH=$TTCN3_DIR/bin:$PATH \
    LD_LIBRARY_PATH=$TTCN3_DIR/lib:$LD_LIBRARY_PATH

## CLONE TITAN
WORKDIR /home/titan/
RUN git clone https://github.com/eclipse/titan.core.git
# Checkout release 6.4.0
WORKDIR /home/titan/titan.core
RUN git checkout tags/6.4.0

## SET Makefile.personal
# TTCN3_DIR := /home/titan/titan.core/Install
# XMLDIR := /usr
# OPENSSL_DIR := /usr
# JNI := no
# GEN_PDF := no
COPY Makefile.personal-ubuntu Makefile.personal

## BUILD TITAN
RUN make install

WORKDIR /home/titan
CMD compiler -v && /bin/bash


Looking forward to your feedback

Best regards,
Aron
Re: Titan 6.4.0 Docker images published in DockerHub [message #1796393 is a reply to message #1792537] Fri, 12 October 2018 10:10 Go to previous messageGo to next message
Alexander Kaiser is currently offline Alexander KaiserFriend
Messages: 28
Registered: May 2017
Junior Member
Hello Aron and Elemer,

First, I would like to thank you for your commitment in this direction. This step makes this great technology even more easily accessible for the community, especially for laypersons according to TTCN-3.

Within the IoT-Testware project, we were also evaluating Docker for "virtualizing" Titan. Finally, we decided to use Titan Docker image as our base image and extend from this one to provide the IoT-Testware in a dockerized container.

To support Titan and Titan's "dockerization" I decided to share our learnings with you and the community and give a short instruction on how the Titan docker image can be used to run the MQTT Test Suite and describe a minor issue I found.

How to:
1. start the Titan docker container in interactive-mode
docker run -ti eclipsetitan/titan-ubuntu /bin/bash


2. Clone the IoT-Testware main repository
git clone https://github.com/eclipse/iottestware.git
cd iottestware


3. Try to install the MQTT Test Suite from the IoT-Testware via the installation script
python3 install.py -p mqtt -b


This will produce the following compile error
IPL4asp_PT.hh:50:10: fatal error: netinet/sctp.h: No such file or directory

Obviously, libsctp-dev is missing. The following command solves the problem.
sudo apt-get install libsctp-dev


4. Install the MQTT Test Suite from the IoT-Testware via the installation script
python3 install.py -p mqtt -b

Now, you should be able to find the executable test suite (ETS) in the following folder
/home/titan/Titan/IoT-Testware/iottestware.mqtt/bin


5. Run the ETS with the examplary configuration
cd /home/titan/Titan/IoT-Testware/iottestware.mqtt
ttcn3_start ./bin/iottestware.mqtt ./cfg/BasicConfig.cfg


Happy testing and stay tuned.

Best regards,
Alexander

Re: Titan 6.4.0 Docker images published in DockerHub [message #1796444 is a reply to message #1796393] Sat, 13 October 2018 06:41 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
Thank you , Alex

BR

Elemer
Previous Topic:Manual build on Eclipse
Next Topic:Performance Testing of OPC-UA
Goto Forum:
  


Current Time: Fri Mar 29 13:59:10 GMT 2024

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

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

Back to the top