280 likes | 501 Views
Automating the Build and Deployment Process of EAServer Components. Marty Jones Senior Software Engineer Marty_Jones@DailyAccess.com Doug Porter Programmer Doug_Porter@DailyAccess.com August 17, 2004. Who We Are….
E N D
Automating the Build and Deployment Process of EAServer Components Marty Jones Senior Software Engineer Marty_Jones@DailyAccess.com Doug Porter Programmer Doug_Porter@DailyAccess.com August 17, 2004
Who We Are… • DailyAccess Corporation (www.dailyaccess.com) is a leading Third-Party RecordKeeper for retirement plans with holdings in excess of $2.1 Billion • Specialize in EAServer, PowerBuilder, and Java technologies, automating back-office aspects of mutual-fund trading, settlement, and management • Certified Developers on Staff • PowerBuilder • Java
Agenda • Automated Builds – What? Why? • Project Scope and Expectations • Automation Overview • Setup Requirements • Build Process • Interactive Demonstration • Future Direction and Enhancements • References • Technologies Used • Questions? • Contact Information
Automation Candidates Automated Builds – What? Typical EAServer Development Cycle Design Implementation Fail Build / Unit Test Deploy Q.A. Pass Integration Test Production Release
Automated Builds – Why? • Build Integrity • The build process will highlight any components affected by IDL changes in existing components • Consistency • Repeatable, consistent builds are critical for quality assurance • Integrated Unit Testing • Suites of Unit Tests can be applied as part of the build process to ensure source code correctness and prevent regression bugs • Time Savings • Saves an enormous amount of time building a complete server from a version control system • Allows for continuous integration: periodic builds highlight integration issues early
CORBA-Java PowerBuilder NVO Enterprise JavaBeans (EJB) C++ ActiveX Project Scope and Expectations • PowerBuilder source stored at PBL-level (StarTeam integration) • IDL is considered “contractual” design • No overloaded methods; IDL-mangling discouraged • Camelback naming convention Component Models Supported Not Supported
Interface Definitions Define Entity Generate Stubs and Proxies Stubs and Proxies Package/Component Properties Package / Component Implementation Generate Skeletons class Automation Overview - Java Source Control Build Server
Define Entity Interface Definitions Generate Proxies and Stubs Implementation PowerBuilder Deployment PBD Package / Component Package/Component Properties Re-deploy properties Automation Overview - PowerBuilder Source Control Build Server Proxies and Stubs
Setup Requirements • EAServer: Baseline build server • “Clean” copies of the following folders: • <EAServer Install Dir>/Java/Classes • <EAServer Install Dir>/Repository/Component • <EAServer Install Dir>/Repository/Package • <EAServer Install Dir>/Repository/Server • <EAServer Install Dir>/Repository/IDL These “clean” copies are used to revert the build server to a known good baseline installation. Note: Registry settings are *not* preserved as part of this “clean” server, and are not generally recommended for use in component development.
Setup Requirements (Cont.) • Source Control Folder Layout • Create a directory structure that will hold the package and component source to be retrieved from the version control system. Below is an example of this directory structure.
Build Process • Define Master Component Processing File • Establish baseline “clean” server • Create IDL Definitions on EAServer • Generate Stubs and PowerBuilder Proxy libraries • Component Compilation and Deployment • (Optional) Recreate IDL Definitions for correctness • Re-deploy Component props (PB only) • Synchronize build server to target deployment server
Build Process (Cont.) • Define Master Component Processing File • Create an XML file that contains the packages and components that are to be deployed to Jaguar. • This file is used for Stub generation as well as Package and Component generation.
Build Process (Cont.) • Establish baseline “clean” server • Shutdown the Build Jaguar server if it is currently running • Delete the following folders: • <EAServer Install Dir>/java/classes • <EAServer Install Dir>/Repository/Server • <EAServer Install Dir>/Repository/Package • <EAServer Install Dir>/Repository/Component • <EAServer Install Dir>/Repository/IDL • Copy the following “clean” folders to the <EAServer Install Dir> • /java/classes • /Repository/Server • /Repository/Package • /Repository/Component • /Repository/IDL • Start Build Jaguar server.
Build Process (Cont.) • Create IDL Definitions on EAServer • Retrieve IDL files from Project in Version Control. • Use custom Ant task to define IDL within the Build Jaguar Server. This Ant task takes into account any IDL dependencies and will define all dependent IDL entities prior to defining the parent entity. • IDL dependencies are determined by parsing the parent IDL file and retrieving all the include directives. • For each dependency, the Repository is checked for its existence. • If no IDL exists for this dependency, then the task defines the IDL entity.
Build Process (Cont.) • Generate Stubs and PowerBuilder Proxy libraries • Use custom Ant task to iterate the Master Component Processing file. • Use custom Ant task to generate Java Stubs for each package entry that is found within the file. A custom Ant task is needed here because JagAnt does not support generating stubs from a “Module” entity type. The Java Stubs are compiled directly into the Build Jaguar Server. • Use custom Ant task to generate a PowerBuilder Proxy library. • Create temporary PowerBuilder library with an application object • Create proxy project object and import it into temporary PowerBuilder library file • Retrieve proxies from Build Jaguar Server into new PowerBuilder library by executing the proxy project object
Build Process (Cont.) • Component Compilation and Deployment • Use custom Ant task to iterate the Master Component Processing file. • Use JagAnt to create Package entities on Build Jaguar Server. • Java Components • Source code is retrieved from Version Control and compiled into the /java/classes folder of the Build Jaguar Server. • PowerBuilder Components • Source code is retrieved from Version Control. • Any project objects listed within the target are deployed using the OrcaScript • command interpreter (orcascr9.exe) to the Build Jaguar Server.
Build Process (Cont.) • (Optional) Recreate IDL Definitions for correctness • This step is only necessary if you deploy PowerBuilder component and care about keeping consistent IDL naming conventions • The deployment of PowerBuilder Components will change the IDL to have lower case method names and data types • Use custom Ant task to overwrite the current IDL for the package being processed. • This process occurs on a package level if a PowerBuilder component was processed within that package. • Re-deploy Component props (PB only) • Use JagAnt task to update component’s properties • Any user defined or system defined properties that are not supported by PowerBuilder’s deployment process. Ex: Maximum number of pooled components property.
Build Process (Cont.) • Synchronize build server to target deployment server • Use custom Ant task to iterate the Master Component Processing file. • Use JagAnt task to synchronize each package within the Master Component Processing file.
Interactive Demonstration Client EAServer LoanProcessing/InterestCalculator (PB) PowerBuilder Client calculateInterest double principal double duration getRate calculateInterest double principal double duration PowerBuilder Client used to determine total interest on a loan. Client calls calculateInterest method on LoanProcessing/InterestCalculator component passing loan principal and duration. InterestCalculator component makes an intercomponent call to Util/InterestRate component getRate method to determine interest rate of loan. Run Client Util/InterestRate (Java) getRate
Scenario 1 Client EAServer LoanProcessing/InterestCalculator (PB) PowerBuilder Client calculateInterest double principal double duration getRate calculateInterest double principal double duration Util/InterestRate –getRate( ) method modified to accept amount argument of type double. IDL and implementation change. Outcome: LoanProcessing/InterestCalculator will raise BuildException since intercomponent call in LoanProcessing/InterestCalculator component calculateInterest( ) method not updated to reflect new argument. Util/InterestRate (Java) getRate double amount
Scenario 2 Client EAServer LoanProcessing/InterestCalculator (PB) PowerBuilder Client calculateInterest double principal double duration getRate double amount calculateInterest double principal double duration LoanProcessing/InterestCalculator – calculateInterest( ) method intercomponent call to Util/InterestRate getRate( ) method updated to match Util/InterestRate method signature. Outcome: Successful Server Components Build Util/InterestRate (Java) getRate double amount
Scenario 3 Client EAServer LoanProcessing/InterestCalculator (PB) PowerBuilder Client calculateInterest double principal double duration string frequency getRate double amount calculateInterest double principal double duration LoanProcessing/InterestCalculator – calculateInterest( ) method modified to accept new frequency argument of type string. IDL and implementation change. Outcome: PowerBuilder client will fail with BuildException Util/InterestRate (Java) getRate double amount
Scenario 4 Client EAServer LoanProcessing/InterestCalculator (PB) PowerBuilder Client calculateInterest double principal double duration string frequency getRate double amount calculateInterest double principal double duration string frequency PowerBuilder Client – update call to LoanProcessing/InterestCalculator component calculateInterest( ) method to match component method signature Outcome: Successful Client Build Util/InterestRate (Java) getRate double amount
Future Direction and Enhancements • Add support for EJBs • Add a user interface to allow a user to selectively choose a version / branch from source control for building • Add full integration testing support for components • PowerBuilder – build “local” component as a Jaguar JAR • PowerBuilder – option to generate pbd only • jagtool – create stubs for “Module” entity type, not just “Package” and “Component” entity types • jagtool – start server
References • Ant Web site • http://ant.apache.org • Orca SDK download • http://powerbuilder.codexchange.sybase.com/servlets/ProjectDocumentList?folderID=465 • OrcaScript reference • http://sybooks.sybase.com/onlinebooks/group-pb/pbg0900e/pbug/@Generic__BookTextView/56982 • Command-Line Deployment With OrcaScript article • http://www.samspublishing.com/articles/article.asp?p=98852&seqNum=4 • Benefits of Continuous Integration (article by Martin Fowler) • http://www.martinfowler.com/articles/continuousIntegration.html
Technologies Used • Apache Ant 1.6.1 • Open source Java-based build tool, similar to “make” • Sybase EAServer 5.1 Build # 51016 • jagtool – Command-line deployment/development automation tool • jagant – EAServer extensions to Ant, providing access to jagtool • Sybase PowerBuilder 9.01 Build # 6533 • pborc90.dll - native dll that exposes, via ORCA (Open Repository Case API), PowerBuilder IDE functionality that is not available via command line (import, export). • orcascr9.exe – ORCAscript command processor which can sequentially process ORCA commands stored in a text file • Borland StarTeam 5.3 Build # 214 • Enterprise version control system • JDK 1.4.2_03
Questions? • Will you be releasing any of this as open-source?
Contact Information • Send E-mail and Questions to: • marty_jones@dailyaccess.com • doug_porter@dailyaccess.com • Visit Our Website: www.dailyaccess.com • To download this presentation and related code: www.dailyaccess.com/corp/techwave2004.vm