View
73
Download
3
Category
Preview:
Citation preview
Rapid Deployment Models for uPortal -or- "Fast Times at Portal
High"
Tom FreestoneSenior Developer
Brigham Young University
2011 Jasig ConferenceApril 12, 2023
Do More with Less
• Portals ran on large, beefy, expensive machines
• Developed Deployment Anti-patterns
1. Deploy “Handraulically”
• Involves Install Cookbooks• Boring and Repetitive = Errors• Requires a Jedi Master to Debug– Don’t Get Hit by a Bus Anti-Pattern
• Not a Good Use of Resources
2. But it Worked in Development …
• Assume Development Environment is the Same as Production.
• Assumptions = Killer
3. One of these is not like the Others …
• Servers have Personalities• Manual Configuration / Debugging• Changes are not Propagated• Unable to Reproduce Errors
Virtual Machines
• Mass produce “Servers”• Problem of Sprawl– 125% year increase in servers
• How do you deal with configuration differences between dev, test, stage, prod?
Continuous Delivery (Jez Humble, David Farley)
• Empower our Portal Teams• Reduce Errors• Lower Stress• Flexibility• Everyone can Deploy Quickly
1. Automate Everything Possible
• Continuous Integration– Prove your software works with each commit
• Benefits– Build is Repeatable– Early Warning of Problems– Wiring and Configuration that Works– Effective Teams
• Use Continuous Integration with Portal and Portlets
2. Keep Everything in Version Control
• An Application is composed of Binaries, Data and Configuration.
• Artifact Repositories–Maven – Yum (rpm)
Maven Resource Filtering(Maven Resource Plugin)
1. Enable maven resource plugin <project> ... <name>My Resources Plugin Practice Project</name> ... <build> ... <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering></resource> ... </resources> ... </build> ... </project>
2. HelloWorld.txt
Hello ${name}
3. Command Line mvn resources:resources
Output : Hello My Resources Plugin Practice Project
External Resource Filtering (Maven War Plugin)
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <webResource> <directory>${basedir}/src/main/webapp/WEB-INF</directory> <includes> <include>web.xml</include> </includes> <targetPath>WEB-INF</targetPath> <filtering>true</filtering> </webResource> </webResources> </configuration> </plugin> </plugins> </build>
Build Profiles
1. pom.xml
<profiles> <profile> <id>development</id> <properties>
<greeting>Welcome to Jasig</greeting> <properties> </profile> <profile> <id>production</id> <properties>
<greeting>Welcome to Denver</greeting> <properties> </profile>
</profiles>
2. helloWorld.text
Hello ${greeting}
3. Command Line
mvn package -P production -> Hello Welcome to Denver
mvn package -P development -> Hello Welcome to Jasig
Maven Overlay(Maven War Plugin)
<build> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <warName>someWar</warName> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>edu.someUniversity</groupId> <artifactId>someWar</artifactId> <version>${someWar.version}</version> <type>war</type> <scope>runtime</scope> </dependency> </dependencies> <properties> <someWar.version>3.4.2</someWar.version> </properties>
Building an RPM
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>rpm-maven-plugin</artifactId> <version>2.1-alpha-1</version> <extensions>true</extensions> ... <configuration> ... <mappings> <mapping> <directory>/tmp</directory> </mapping> </mappings> ... </configuration> ...</plugin> </plugins> </build>
<packaging>rpm</packaging>
Examples
• CAS• Portlets• uPortal as a rpm
Questions?
Recommended