Max Bureck, 21. June 2017 FROM NOTHING TO COMPLETE ENVIRONMENT WITH MAVEN, OOMPH & DOCKER
Max Bureck, 21. June 2017
FROM NOTHING TO COMPLETE ENVIRONMENTWITH MAVEN, OOMPH & DOCKER
2
1. Disclaimer
2. Motivation
3. Demo
4. Recap, Conclusion, and Future Possibilities
© Fraunhofer FOKUS
FROM NOTHING TO COMPLETE ENVIRONMENT
3© Fraunhofer FOKUShttp://memegenerator.net/instance/78175637
FROM NOTHING TO COMPLETE ENVIRONMENT
4
Disclaimer: Prerequisites are Maven, Oomph & Docker 😲
© Fraunhofer FOKUS
Maven >= 3.0
Latest Eclipse installer
Docker
FROM (ALMOST) NOTHING TO COMPLETE ENVIRONMENT
5
Windows 10: Easiest Way to Make Docker Daemon Accessible From Eclipse
© Fraunhofer FOKUS
FROM NOTHING TO COMPLETE ENVIRONMENT
6
Motivation: Target Domain Introduction
© Fraunhofer FOKUS
FROM NOTHING TO COMPLETE ENVIRONMENT
Writing a transformation service
7
Motivation: Target Domain Introduction
© Fraunhofer FOKUS
Developing ModelBus services should be simple
Usually first task for new team member:
Read ModelBus user guide
Create example ModelBus services
FROM NOTHING TO COMPLETE ENVIRONMENT
8
Motivation: Setup Experience, Step 1
© Fraunhofer FOKUS
Setup Action:
Install ModelBus server
Configure ModelBus server
Problems:
User forgets to set mandatory environment variable
User forgets to add SVN plugins (for legal reasons not part of ModelBus distro)
FROM NOTHING TO COMPLETE ENVIRONMENT
9
Motivation: Setup Experience, Step 2
© Fraunhofer FOKUS
Setup Actions:
Install Eclipse
Install ModelBus TeamProvider plugins
Configure TeamProvider and target platform
Problem:
User does not add plugins for standalone services to target platform
FROM NOTHING TO COMPLETE ENVIRONMENT
10
Motivation: Setup Experience, Step 3
© Fraunhofer FOKUS
Setup Action:
Create projects for service interface,
provider - and consumer service
Problem:
User forgets to add mandatory plugin dependency
FROM NOTHING TO COMPLETE ENVIRONMENT
11
Motivation: Setup Experience, Step 4
© Fraunhofer FOKUS
Setup Action:
User creates launch configurations
for provider and consumer projects
Problem:
User forgets to set one or more start-levels for plugins
FROM NOTHING TO COMPLETE ENVIRONMENT
12
Motivation: Setup Experience, Step 5
© Fraunhofer FOKUS
Setup Action:
User creates product definition
for services (for standalone executable)
Problems:
User forgets to set one or more start-levels for plugins (again)
Forgotten plugins in product definition
FROM NOTHING TO COMPLETE ENVIRONMENT
13
Motivation: Setup Experience, Step 6
© Fraunhofer FOKUS
Bonus Action:
Create Maven Tycho build scripts
Problems:
Bundle IDs / Feature IDs have to match POM artifactIds
FROM NOTHING TO COMPLETE ENVIRONMENT<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.modelbus.demo.service</groupId>
<artifactId>org.modelbus.demo.service.releng</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>org.modelbus.demo.service.releng</name><description>ModelBus Demo Service Release Engineering</description>
<properties><tycho-version>1.0.0</tycho-version>
<project.encoding>UTF-8</project.encoding>
<project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding><java.version>1.8</java.version>
<project.source.version>${java.version}</project.source.version>
<project.target.version>${java.version}</project.target.version><organization.name>Fraunhofer FOKUS</organization.name>
<organization.url>http://www.fokus.fraunhofer.de</organization.url>
<organization.cc.name>System Quality Engineering (SQC)</organization.cc.name><organization.cc.url>http://www.fokus.fraunhofer.de/sqc</organization.cc.url>
<!-- Skip the deployment here, submodules can override this property -->
<maven.deploy.skip>true</maven.deploy.skip><timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd-HHmm</maven.build.timestamp.format>
</properties>
<profiles>
<profile>
<id>all-modules</id>
<activation><activeByDefault>true</activeByDefault>
</activation>
<modules><module>../../plugins/org.modelbus.demo.service</module>
<module>
../../plugins/org.modelbus.demo.service.consumer</module>
<module>
../../plugins/org.modelbus.demo.service.provider</module>
<module>
../../features/org.modelbus.demo.consumer.dependencies.feature</module>
<module>
../../features/org.modelbus.demo.service.consumer.feature</module>
<module>
../../p2/org.modelbus.demo.service.consumer.product</module>
<module>
../../features/org.modelbus.demo.service.provider.dependencies.feature</module>
<module>
../../features/org.modelbus.demo.service.provider.feature</module>
<module>
../../p2/org.modelbus.demo.service.provider.product</module>
</modules>
</profile>
<profile>
<id>provider-only</id><modules>
<module>../../plugins/org.modelbus.demo.service</module>
<module>../../plugins/org.modelbus.demo.service.provider
</module>
<module>../../features/org.modelbus.demo.service.provider.dependencies.feature
</module>
<module>../../features/org.modelbus.demo.service.provider.feature
</module>
<module>../../p2/org.modelbus.demo.service.provider.product
</module>
</modules></profile>
<profile><id>consumer-only</id>
<modules>
<module>../../plugins/org.modelbus.demo.service</module><module>
../../plugins/org.modelbus.demo.service.consumer
</module><module>
../../features/org.modelbus.demo.consumer.dependencies.feature
</module><module>
../../features/org.modelbus.demo.service.consumer.feature
</module><module>
../../p2/org.modelbus.demo.service.consumer.product
</module></modules>
</profile>
</profiles>
<repositories><!-- eclipse neon repository -->
<repository>
<id>Neon</id><layout>p2</layout>
<url>http://download.eclipse.org/releases/neon/</url>
</repository><!-- eclipse emf repository -->
<repository>
<id>EMF</id><layout>p2</layout>
<url>http://download.eclipse.org/modeling/emf/updates/releases/</url>
</repository><!-- modelbus repository -->
<repository>
<id>ModelBus</id><layout>p2</layout>
<url>http://www.modelbus.org/updatesite/modelbus/current/site</url>
</repository></repositories>
<build><plugins>
<!-- enable tycho build extension -->
<plugin><groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version><extensions>true</extensions>
</plugin>
<!-- To generate Javadox -->
<plugin>
<groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
</plugin>
<!-- To customize the artifact name -->
<plugin><groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version><configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
</configuration></plugin>
<plugin><groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version><configuration>
<environments>
<environment><os>linux</os>
<ws>gtk</ws>
<arch>x86</arch></environment>
<environment>
<os>linux</os><ws>gtk</ws>
<arch>x86_64</arch>
</environment><environment>
<os>macosx</os>
<ws>cocoa</ws><arch>x86_64</arch>
</environment>
<environment><os>win32</os>
<ws>win32</ws>
<arch>x86</arch></environment>
<environment>
<os>win32</os><ws>win32</ws>
<arch>x86_64</arch>
</environment></environments>
<dependency-resolution><optionalDependencies>ignore</optionalDependencies>
</dependency-resolution>
</configuration></plugin>
</plugins>
</build></project>
14
Motivation: Setup Experience Conclusion
© Fraunhofer FOKUS
FROM NOTHING TO COMPLETE ENVIRONMENT
https://imgflip.com/i/1qsphq
15
Motivation: Improving Setup Experience
© Fraunhofer FOKUS
Use automation to get rid of error prone manual tasks of
Installation of ModelBus server
Installation and configuration of Eclipse + plugins
Creation of service interface, provider, and consumer plugins
Creation of launch configs and product definition
Creation of Maven Tycho build scripts
FROM NOTHING TO COMPLETE ENVIRONMENT
23© Fraunhofer FOKUS
Demo
FROM NOTHING TO COMPLETE ENVIRONMENT
24
Recap, Part 1
© Fraunhofer FOKUS
We used Maven archetype to generate
Projects (service interface, provider, consumer, features, products)
Maven build scripts
Oomph setup file
Dockerfiles for ModelBus server, provider service, consumer service
Launch configs for build, run, debug
FROM NOTHING TO COMPLETE ENVIRONMENT
25
Recap, Part 2
© Fraunhofer FOKUS
We used generated Oomph setup to
Install Eclipse
Install plugins into Eclipse
Configure Eclipse + plugins
Configure target platform
FROM NOTHING TO COMPLETE ENVIRONMENT
26
Conclusion
© Fraunhofer FOKUS
If your platform is based on OSGi / Eclipse tech: Consider Maven archetypes
Use Oomph for (reproducible) Eclipse setups
Consider Docker if your Eclipse based platform integrates with network services
FROM NOTHING TO COMPLETE ENVIRONMENT
27
Going Even Further (When Possible)
© Fraunhofer FOKUS
Install prerequisites via package managers (apt, chocolatey, homebrew, etc.)
Single shell script call for setup, literally starting from nothing
Starting eclipse installer with Oomph setup file from command line
Generating CI configuration (Jenkinsfile, .travis.yml, .gitlab-ci.yml, etc.)
FROM NOTHING TO COMPLETE ENVIRONMENT
28
Please Vote and Leave Comments
© Fraunhofer FOKUS
FROM NOTHING TO COMPLETE ENVIRONMENT
29© Fraunhofer FOKUS
Thanks!Questions?
FROM NOTHING TO COMPLETE ENVIRONMENT
30
Fraunhofer FOKUS
Kaiserin-Augusta-Allee 31
10589 Berlin, Germany
www.fokus.fraunhofer.de
Max Bureck
Senior Researcher
Tel. +49 (0)30 3463-7321
© Fraunhofer FOKUS
CONTACT