Upgrading the Interface and Developer Tools of the Trigger
Total Page:16
File Type:pdf, Size:1020Kb
FACULTY OF ENGINEERING TECHNOLOGY TECHNOLOGY CAMPUS GEEL Upgrading the Interface and Developer Tools of the Trigger Supervisor Software Framework of the CMS experiment at CERN Glenn DIRKX CERN-THESIS-2016-303 27/06/2016 Supervisor: Peter Karsmakers Master Thesis submitted to obtain the degree of Master of Science in Engineering Technology: Co-supervisor: Christos Lazaridis Master of Science in Electronics Engineering Internet Computing Academic Year 2015 - 2016 This page is intentionally left almost blank c Copyright KU Leuven Without written permission of the supervisor(s) and the author(s) it is forbidden to reproduce or adapt in any form or by any means any part of this publication. Requests for obtaining the right to reproduce or utilise parts of this publication should be addressed to KU Leuven, Technology Campus Geel, Kleinhoefstraat 4, B-2440 Geel, +32 14 56 23 10 or via e-mail [email protected]. A written permission of the supervisor(s) is also required to use the methods, products, schematics and programs described in this work for industrial or commercial use, and for submitting this publication in scientific contests. This page is intentionally left almost blank Acknowledgements I would like to thank the following people for their assistance during this project: Christos Lazaridis for being a great mentor and for not getting mad when I break the nightlies or even SVN itself. Alessandro Thea for his advice on how to proceed with implementing new functionalities and his supply of motivation and inspiration. Evangelos Paradas for his guidance trough the architecture of the TS and pointing me to useful resources. Simone Bologna for his enthusiasm and patience when finding bugs, and his steady supply of ideas. Furthermore I would like to express my thanks to the entire Online Software team for the freedom and trust I’ve been given that allowed this project to get as far as it has. V This page is intentionally left almost blank Abstract The Compact Muon Solenoid (CMS) Trigger Supervisor (TS) is a software framework that has been designed to handle the CMS Level-1 trigger setup, configuration and monitoring during data taking as well as all communications with the main run control of CMS. The interface consists of a web-based GUI rendered by a back-end C++ framework (AjaXell) and a front-end JavaScript framework (Dojo). These provide developers with the tools they need to to write their own custom control panels. However, currently there is much frustration with this framework given the age of the Dojo library and the various hacks needed to implement modern use cases. The task at hand is to renew this library and its developer tools, updating it to use the newest standards and technologies, while maintaining full compatibility with legacy code. This document describes the requirements, development process, and changes to this framework that were included in the upgrade from v2.x to v3.x. Keywords: CERN, CMS, L1 Trigger, C++, Polymer, Web Components. VII This page is intentionally left almost blank Contents 1 The Compact Muon Solenoid experiment 1 1.1 The structure of CMS . .1 1.1.1 Silicon Tracker . .1 1.1.2 Electromagnetic Calorimeter . .2 1.1.3 Hadronic Calorimeter . .2 1.1.4 Superconducting Solenoid . .3 1.1.5 Muon Chambers . .3 2 The Level-1 Trigger Online Software 5 2.1 The Level-1 Trigger . .5 2.2 The CMS Experiment Control System . .7 2.3 The Trigger Supervisor . .7 2.4 SWATCH . .7 3 Problems with TS 2.0 9 3.1 Browser compatibility . .9 3.1.1 Evergreen browsers . .9 3.1.2 Interface degradation . 10 3.1.3 Dojo 0.4 . 11 3.2 Increasing development time . 11 3.2.1 Maintainability . 12 3.2.2 Large input problem . 12 4 TS 3.0 upgrade requirements 15 4.1 Legacy code compatibility . 15 4.2 Ability to migrate code . 15 4.3 Future proof . 15 4.3.1 Polyfills . 16 4.4 Rich functionality . 16 4.5 Faster development . 16 4.6 Stability . 17 IX X CONTENTS 4.7 Reduced code footprint . 17 4.8 Better maintainability . 17 4.9 Better documentation . 17 4.10 i18n . 17 4.11 Browser compatibility . 18 5 TS upgrade options 19 5.1 Server-side interface engine . 19 5.2 Client-side interface library . 19 5.2.1 Upgrading Dojo . 19 5.2.2 jQuery . 20 5.2.3 AngularJS . 21 5.2.4 Web Components . 22 5.2.5 React.js . 24 5.3 Chosen upgrade path . 24 5.3.1 Front-end library . 24 5.3.2 Back-end C++ codebase . 24 6 TS upgrade roadmap 27 6.1 Interface upgrade . 27 6.1.1 The legacy interface structure . 27 6.1.2 The new page structure . 29 6.1.3 Emulation of the legacy structure in the new page . 29 6.2 New session management . 29 6.2.1 Material Design . 29 6.3 Handling large input . 30 6.4 Additions to the page builder classes . 30 6.5 Upgraded event system . 31 6.6 New JSON library . 31 6.7 Memory-leak problem . 31 6.7.1 Memory-leak patterns . 31 6.7.2 Memory leaks in Dojo . 33 6.7.3 Memory leaks in Polymer . 34 7 Development process 37 7.1 Scrum . 37 7.1.1 Kanban . 38 7.1.2 Workflow . 38 7.2 Version Control . 39 8 Polymer 41 CONTENTS XI 8.1 From C++ to Polymer . 41 8.2 From Polymer to C++ . 41 8.3 Polymer features . 43 8.3.1 Properties . 43 8.3.2 Data binding . 44 8.3.3 Lifecycle callbacks . 44 8.3.4 Styling . 44 8.3.5 Events . 45 8.3.6 Behaviors . 45 9 The renewed panel SDK 47 9.1 Packages available to panel developers . 47 9.1.1 Bower Components . 47 9.1.2 common-elements . 49 9.1.3 JsonCpp . 52 9.2 New Cell structure . 53 9.3 Separation of Concerns . 53 9.4 Grunt build system . 54 9.4.1 JavaScript processing . 54 9.4.2 CSS processing . 54 9.4.3 HTML processing . 55 9.5 Templates . 55 9.6 Panel registration system . 55 9.6.1 Eager loading and lazy loading . 55 10 Documentation 57 10.1 Inline documentation . 57 10.1.1 JSDocs . 57 10.2 Global level . 58 10.2.1 Goals . ..