Rebecca Pankow Supervisor: Veronique Lefebure CERN Summer Student Program 2010 Updating the Syntax of PAN Template Files.

Slides:



Advertisements
Similar presentations
Debugging ACL Scripts.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
1 OBJECTIVES To generate a web-based system enables to assemble model configurations. to submit these configurations on different.
1 The Shell and some useful administrative Unix Commands How Unix works along with some additional, useful administrative Unix commands you might need.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Input Validation For Free Text Fields ADD Project Members: Hagar Offer & Ran Mor Academic Advisor: Dr Gera Weiss Technical Advisors: Raffi Lipkin & Nadav.
Useful Tools for Testing
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
BizTalk Deployment using Visual Studio Release Management
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
BIAF Print Label software setup
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
Linux Operations and Administration
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Linux Operations and Administration
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Advanced Shell Programming. 2 Objectives Use techniques to ensure a script is employing the correct shell Set the default shell Configure Bash login and.
Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Login Screen This is the Sign In page for the Dashboard New User Registration Enter Id and Password to sign In.
INTRODUCTION TO C PROGRAMMING LANGUAGE Computer Programming Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 4 Manage Software for SUSE Linux Enterprise Server.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Unix Talk #2 (sed). 2 You have learned…  Regular expressions, grep, & egrep  grep & egrep are tools used to search for text in a file  AWK -- powerful.
Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Chapter 7 Advanced SQL Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
INFSOM-RI Juelich, 10 June 2008 ETICS - Maven From competition, to collaboration.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
RELATIONAL FAULT TOLERANT INTERFACE TO HETEROGENEOUS DISTRIBUTED DATABASES Prof. Osama Abulnaja Afraa Khalifah
Module 3: Creating Maps. Overview Lesson 1: Creating a BizTalk Map Lesson 2: Configuring Basic Functoids Lesson 3: Configuring Advanced Functoids.
Introduction to AFS IMSA Intersession 2003 AFS Servers and Clients Brian Sebby, IMSA ‘96 Copyright 2003 by Brian Sebby, Copies of these.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
Deployment work at CERN: installation and configuration tasks WP4 workshop Barcelona project conference 5/03 German Cancio CERN IT/FIO.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
Altman IM Ltd | | process | verify | convert | route | connect Prism Software’s solutions provide advanced workflow.
SPMA & SWRep: Basic exercises HEPiX hands-on, NIKHEF 5/03 German Cancio
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Chapter Six Introduction to Shell Script Programming.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington.
NMD202 Web Scripting Week2. Web site
Visual Source Safe –A Quick Tour. CONTENTS What is VSS ? How to install VSS ? How does VSS track versions? VSS Concepts & Features Utilities available.
ICS312 Introduction to Compilers Set 23. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
EGEE is a project funded by the European Union under contract IST Installation and configuration of gLite services Robert Harakaly, CERN,
Chapter 6 Testing and running a solution. Errors X Three types Syntax Logic Run-time.
Software Engineering Algorithms, Compilers, & Lifecycle.
1.Switch on the computer and wait for loading. 2.Select the Windows 7 OS at the end of the list. 3.Click on the link ‘Administrator’ 4.Enter the administrator.
Useful Tools for Testing
Connect:Direct for UNIX v4.2.x Silent Installation
Programming Concepts and Languages
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Building Web Applications
Tutorial of Unix Command & shell scriptS 5027
Lecture 5: Functions and Parameters
Intro to PHP.
EN Software Carpentry Python – A Crash Course Esoteric Sections Compiled Languages.
Presentation transcript:

Rebecca Pankow Supervisor: Veronique Lefebure CERN Summer Student Program 2010 Updating the Syntax of PAN Template Files

Introduction The CF-ASI section provides infrastructure and support for the QUATTOR framework used for installing, configuring and managing the 8000 machines of the computer center. PAN is a functional programming language that translates a high- level site configuration written by a system administrator in the pan configuration language to a machine-readable representation.

Introduction object template hello; '/message' = 'hello'; hello

Introduction object template nfsserver.example.org; '/hardware/location/rack' = 'IBM04'; '/hardware/location/slot' = 25; '/hardware/ram' = 2048; '/hardware/cpu/model' = 'Intel Xeon'; '/hardware/cpu/speed' = 2.5; '/hardware/cpu/arch' = 'x86_64'; '/hardware/cpu/cores' = 4; '/hardware/cpu/number' = 2;

Project Details An upcoming release of the PAN compiler used by QUATTOR changes the PAN programming language syntax This requires an update of 30,000 pre-existing PAN configuration files. Need to search for the following within each file and make appropriate change: – include x;  include { ‘x’ }; – type “x” = …  bind “x” = …

Updating the Syntax Originally tried to update the syntax by parsing the files (faster to run) Final solution uses regular expressions for more flexibility (slower to run) if ($curr_line =~ /^\s*include\s+([\w\/-]+)\s*;/) { $add_line = "include {'$1'};\n"; } elsif ($curr_line =~ /^\s*type\s+["']([\w\/- ]+)["']\s*=\s*([\w\/-]+)\s*;/) { $add_line = "bind '$1' = $2;\n"; }

Verifying Solution Correctness The code in each template file generates an XML file If the regular expressions are correct, there should be no difference between the XML files generated by the updated template files and the XML files generated by the original template files

Verifying Solution Correctness Wrote a small script to loop through all the files and run a diff between the original XML files and the XML files generated by the updated template files Updated template files now generate identical XML files as compared to the original XML files

swrep-soap-client archive The swrep-soap-client should have a way to tell whether or not a rpm is archived Accomplished by using a predefined function to identify whether an rpm is archived or not Appended information on archived status to output of command

Uploading rpms to all platforms Allow users to upload a particular RPM to all known platforms inside SWrep, without having to extract them via "listplatforms" and then manually specifying them on the command line Client code modified by getting the list of all platforms available and looping the uploading code through the list

Extracting correct substring from differently formatted strings Two different servers return different strings when the following command is called: temp=`cat $TMPFILE | grep URL | head -1 | cut "-d " -f5 | cut '-d"' -f2` Error due to different string formats in $TMPFILE Format for lxplus : – :03:34 URL: 2101::::P203_ID:1005 [23443] -> "f?p=116:203: ::::P203_ID:1005.html“ 2101::::P203_ID:1005 – Returns “->” (incorrect) Format for lxadm : – 10:56:12 URL: 7197::::P203_ID:1002 [25146] -> "f?p=116:203: ::::P203_ID:1002.html“ 7197::::P203_ID:1002 – Returns “f?p=116:203: ::::P203_ID:1002.html” (correct) Solution: Change expression to temp= `cat $TMPFILE | grep URL | sed 's/^.*"f?p/f?p/' | sed 's/".*$//'`

Automatic file deletion Add code that will automatically deleted selected files based on time stamp in file name: Example file names: SDBofflinecopy zip SDBofflinecopy-YYYYMMDD-HH24MI.zip

Automatic file deletion deletecopy_filename="SDBofflinecopy-`date +%Y%m%d --date '2 month ago'`-`date +%H`*" old_copy="${full_path}/${deletecopy_filename}" rm -f $old_copy If $full_path already has a '/' at the end then the line should be changed to: old_copy="${full_path}${deletecopy_filename}"

tpl_viewer.php A php script used to generate links to template files does not work with certain template files Example line from template file: $line = "include { if (exists('customization/'+ELFMS_RESOURCE+'/'+ELFMS_PROJECT+'/'+ELFMS_CUSTOMIZATION +'/config')) 'customization/'+ELFMS_RESOURCE+'/'+ELFMS_PROJECT+'/'+ELFMS_CUSTOMIZATION+'/conf ig' };"; Links are generated via regular expressions Previous line does not correctly match any regular expressions in tpl_viewer.php Regular expressions will need to be updated to correctly match all lines

Cultural Experiences

Acknowledgements Veronique Lefebure Homer Neal Jean Krisch Jeremy Herr CERN National Science Foundation University of Michigan