Continuous Integration and Automatic Testing for the FLUKA release using Jenkins (and Docker) Vittorio BOCCONE DECTRIS Ltd. 5405 Baden-Daettwil Switzerland www.dectris.com
Definitions Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. At each iteration the code is then verified by an automated build system, allowing teams to detect problems early. Continuous Delivery (CD) is a design practice used in software development to automate and improve the process of software delivery
The Integration Eldorado
Continuous Integration tools Continuous Integration tools (CI) are software packages which orchestrate the build process and automate the building, testing, archiving and (eventually) deploy procedures. Functions: - Automate repetitive and error prone task; - Automate builds and test for each commit; - Execute test; - Archive artifacts; - Handle and log building report. - Report failure and possible culprits.
CI implementation Reliable Builds: - Creation a new expandable builders (Docker containers); - The builder live only the time to build the code and than is purged. Avoid dependencies misalignment: - Encode the dependencies source code; - Satisfy the dependencies just before building using the packages in the YUM repository; - Dependencies will also be inherited by the produced RPM package; A positive byproduct is that we could define a fluka-toolchain package whose dependencies solve the installation problems for the most common distributions (RH-like and Debian-like) Monitor and Evaluate the code development: - Handle the testing of the code; - Monitor the code health status; - Log the Building, Testing and Error reports.
report Test commit fetch Example of CI implementation at DECTRIS Git SCM fetch Fresh Builders CI Tool Example @ DECTRIS Main Software Components jaun eiger YUM RPM Repositories dectris-corelib dectris-boost dectris-hdf5 eiger-firmware eiger-tools jaun-ui Testing
Why Jenkins? Why Docker? Jenkins (automation tool) - Relatively OS independent as it works on everything where an SSH connection or a Java apps can be run; - Integrate with SVN/Git and bug tracking tools (Jira) - Free version extendable to an Enterprise version. Cost is based on the size of the CI infrastructure; - Easy to install, setup and maintain (no hidden cost for IT); - Fastest growing tool in CI community, yet stable. Docker (lightweight Linux container alternative to VMs) - Fresh Linux container (Ubuntu, CentOS, Fedora...) in matter of seconds; - Free version extendable with plugins; - Easy to install, setup and maintain (no hidden manpower cost); - Easy to use, new clean development environment on the fly (no it needed to request a dedicated VMs); - Fastest growing tool in VM community, yet stable.
Continuous Integration @Dectris Tools - Jenkins as Continuous Integration manager. - Docker for the Linux builder infrastructure. Requirements - Each component must be in a versioning scheme and in a SCM; - Each (meaningful) build should be tracked and defined. - The components workflow should be defined and clear; Automatic Testing - Unit, Integration and Functional testing. - Test with real simulation input files batteries - Report generation Debugging - Automatic reporting and identification of culprits. Important: Tools are just tools and we should be flexible in case we would need to replace one tool with another
Continuous Integration @Dectris Continuous integration and Science - Dectris is PSI spin-off and produces X-Ray detectors for the synchrotron, laboratory and industry market; - Application of Continuous Integration methods does not only apply strictly to software development but also to simulation and calibration projects; Scientific Software Development @Dectris - Software Core Team:6 developers (mostly physicist) + 1 (IT); - 60-70 packages supported (external customers + internal user) + hundreds of scripts for detector and sensor testing and calibration; - Scientific software and simulation support to the other groups (Development, Support and Production groups); - Need reliable quality assurance methods in the production phase.
Minimal CI workflow Commit to SCM Automated Procedure Trigger Build Build Pass U/F Test Pass Archive Artifact (RPM) Fail Notify Build Failure Fail Notify Test Failure Trigger Code Test Test #1 Report Generation ` Test [...] YUM RPM Repository Test #N
Extended CI workflow Automated Procedure Commit to SCM Trigger Build Build Pass U/F Test Pass Trigger Code Test Fail Fail Notify Build Failure Notify Test Failure YUM RPM Repository Report Generation Archive Artifact (RPM) Notify Integration Failure Fail Pass Release? Result Test #1 Test [...] Test #N
Example: FLUKA deployment test Process - Take the generated artifacts (RPMS and tarballs) - Apply the installation procedure: - rpm: yum install <package> - tarball: tar -zxvf <tarball> export FLUPRO=/path/to/fluka export FLUFOR=g77/gfortran make RPM Jenkins s job - Matrix job with two axis OS (centos6, centos7) and the artifact ARCHITECTURE (32 and 64bit) - Use Docker to provide clean OS containers mkdir fluka mv "ARCHITECTURE="${ARCHITECTURE}/*.rpm fluka/ docker run --rm -v $(pwd)/fluka:/fluka -t centos:$os bash -c 'yum \ install -y /fluka/*.rpm'
Example: FLUKA RPM deployment test Results Each job execution is nicely logged in its own console log accessible in the job s menu - CentOS6 (64bit): - FLUKA g77 (32bit) works out of the box - FLUKA gfortran (64bit) requires new gfortran which is not provided by the standard repositories --> Finished Dependency Resolution Error: Package: fluka-2011.2c-3.x86_64 (/fluka-2011.2c-3.x86_64) Requires: libgfortran.so.3(gfortran_1.4)(64bit) Error: Package: fluka-2011.2c-3.x86_64 (/fluka-2011.2c-3.x86_64) Requires: libquadmath.so.0()(64bit) Error: Package: fluka-2011.2c-3.x86_64 (/fluka-2011.2c-3.x86_64) Requires: libc.so.6(glibc_2.14)(64bit) - CentOS7 (64bit) - FLUKA gfortran (64bit) works out of the box - FLUKA g77 (32bit) requires cross compilation packages which are not included in the dependencies (and discontinued) --> Finished Dependency Resolution Error: Package: fluka-2011.2c-3.i686 (/fluka-2011.2c-3.i686) Requires: compat-gcc-34
Other FLUKA-related applications FLUKA Benchmarking/Testing - Run predefined test simulation for each version and monitor execution and result; - Trigger the analysis of the output data and provide a reliable logging of the operation. Large Projects/Simulations: - Monitor a release branch of a large scale simulation project and trigger (and analyse) test simulation (short runs) as soon a commit appears. - Identify implementation errors (i.e. geometry, settings) Flair/Geoviewer FLUPIX automatic ISO file generation Handle FLUKA development version - FLUKA collaboration members could pick them up directly from the Jenkins server. My 2cents https://github.com/drbokko/docked-fluka-builders
Testing Examples
Monitoring Jobs
Testing Example
Testing Examples
Thank you for your attention! www.dectris.com DECTRIS Ltd. 5405 Baden-Daettwil Switzerland www.dectris.com