The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) GILDA VM Liferay V1.3
VM Requirements Virtualization –VMWare (Player(free), Workstation, etc …) Hosting Machine –X86_64 CPU Arch. (Overrides 4Gb of RAM limit) –1,9 Gb Disk space for compressed VMX –4 GB RAM Virtul Machine –1,5 GB RAM –20 GB Virtual disk (about 3GB at first boot) –NAT Network (default and suggested)
VM Services Liferay on Glassfish 3.1 Liferay plugins sdk MySql v5 VMWare tools (Enables directory sharing) NTP for time synchronization mini_httpd JSAGA GridEngine 1.3.7
VM Users&Credentials (MySQL) Glassfish/Liferay ’ database backend
VM Users&Credentials (Glassfish) Glassfish administrator user credentials Administration page Web Address
VM Users&Credentials (Liferay) Liferay home page Administrator user credentials
VM Users&Credentials (ROOT) VM ROOT user credentials
VM Users&Credentials (liferayadmin) VM liferayadmin user credentials Used to develop Liferay portlets This user has been included in ‘sudoers’ users VM liferayadmin user credentials Used to develop Liferay portlets This user has been included in ‘sudoers’ users
Glassfish User: liferayadmin Password: liferayadmin
Glassfish (Control Panel) Configure the Application server: Resources,Pool DB Connections, Log, other settings …
Liferay (Sign In) User: Password:
Liferay (Application Space)
Liferay (MyJobs)
Liferay (ServerLog)
Grid Engine Takes care of any Grid Transaction –JAVA APIs + Users Tracking Database Acces to the UsersTrackingDB – mysql -utracking_user -pusertracking userstracking GridEngine tables | Tables_in_userstracking | | ActiveGridInteractions | | GridInteractions | | GridOperations | GridOperation (for tests) | id | portal | description | | 9 | liferay.com | DevelApp | GridEngine Library: –/opt/glassfish3/glassfish/domains/liferay/lib/jsaga-job- management jar
Development Environment (Working Directory) 1 st Define a VM shared folder link 2 nd Define links to existing liferay-plugin-sdk and liferay libraries –ln -s /opt/liferay-plugins-sdk-6.0.6/ \ /mnt/hgfs/ /liferay-plugins-sdk –ln -s /opt/glassfish3/glassfish/domains/liferay/lib/ /mnt/hgfs/ /liferay-lib –WARNING: –On Windows machines VMWare’ hgfs do not allow the creation of symlinks Copy the whole content of directories: /opt/liferay-plugins-sdk-6.0.6/ /opt/glassfish3/glassfish/domains/liferay/lib/ –On Machintosh you may use MacFusion to share directories via SSH 3 rd Define a VM readable hostname (optional, only with NAT) –Insert into VM hosting machine /etc/hosts file the entry As root add: ‘ gildavm' For Windows machines add the same entru inside: %SystemRoot%\system32\drivers\etc\hosts
Development Environment (IDE) High level development tools can be integrated with the VM exploiting the shared directory; ( NetBeans or Eclipse) See point 7 th of hostname-portlet See point 7 th of hostname-portlet
Compile your portlets As liferayadmin user connect to the VM and ‘cd’ to the liferay-plugin-sdk/portlets/ ; then type: –ant deploy During the compilation, have a look on the produced server log with: –tail -f /opt/glassfish3/glassfish/domains/liferay/logs/server.log WARNING: Compilation may fail even the ant deploy command tells that the deployment is successful; pay attention to the produced log
Brief intro to hostname portlet Many Grid applications have the same requirements to run over a distributed environment: –Specify the Executable –Define Std-Out/Err files –Speficy files for the Input and Output Sandoboxes –Provide a BASH shell script that pilots the application execution on the remote host –Configure distributed infrastructure services All these requirements have been collected into the hostname portlet: (Historically the hostname Job its’ the ‘hello-world’ test application for Grids)
hostname portlet (MrBayes) First Grid application (proof of concept) First Grid application (proof of concept)
hostname portlet (GATE) Prototyping the first experience
hostname portlet (Template) Portlet Template It just executes the hostname on the remote machine Display information like: Working directory, Home directory and produces a file
hostname portlet (preferences) Portlet Template Preferences Information System Resource Manager ROBOT prroxy server Virtual Organization Proxy role Application Id (GridEngine) Requirements Pilot Script Portlet Template Preferences Information System Resource Manager ROBOT prroxy server Virtual Organization Proxy role Application Id (GridEngine) Requirements Pilot Script WARNING When the portlet first installs do not forget to place here the application pilot script WARNING When the portlet first installs do not forget to place here the application pilot script
hostname portlet (about) Portlet Template About Licence Information Versioning Info … Portlet Template About Licence Information Versioning Info …
Portlet workflow JSP page doView ProcessAction ACTION/VIEW Architecture Hostname code provides two Enum types: Actions and Views For each Action a different View can be selected and easily managed by switch statements The two enumerated types used to manage the portlet behavior Between portlet methods: ‘doView and ProcessAction’. doView JSP page ProcessAction JSP page default
Testing VM Connect the VM as liferayadmin user Extract from GILDA software repository the ‘hostname- portlet’: –svn checkout –The hostname-portlet is already available in standard GILDA VM. Change directory to ‘hostname-portlet’ and compile: –ant deploy Open the Server Log and wait until appears the message: Connect to the Liferay Page, install and test the portlet Do little changes first and do several tests [#| T12:26: |INFO|glassfish3.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.co mmon|_ThreadID=138;_ThreadName=Thread-1;|[AutoDeploy] Successfully autodeployed : /opt/glassfish3/glassfish/domains/liferay/autodeploy/hostname-portlet.war.|#]
Advanced topics: Liferay domain How to start/stop/restart Liferay –Liferay and Glassish automatically start upon boot. These services (together) can be managed through: /etc/init.d/liferay –Glassfish may be managed by root user though the utility /opt/glassfish3/glassfish/bin/asadmin Start/Stop Glassfish+Liferay: asadmin start-domain (liferay) Asadmin stop-domain (liferay) Show installed web applications asadmin --port -u list-applications Undeploy portlets sh asadmin --port --user undeploy Create domain asadmin create-domain --portbase Getting help asadmin --help
Advanced topics: Robot proxy server simulator Liferay GILDA VM simulates internally a Robot Proxy server Production portlets work since /etc/hosts/ includes the defautl proxy server: myproxy.ct.infn.it The GILDA VM uses a mini_httpd server to emulate the Robot Proxy server start/stop/status for mini_httpd services –/etc/init.d/mini_httpd You may use your own personal certificate proxy coping it to the file: –/etc/GILDA/eToken/proxy.txt –Copy a generated proxy from UI (use of a personal certificate) scp :/tmp/x509up_u501 /etc/GILDA/eToken/proxy.txt
Advanced topics: Network Checker The VM provides a service able to restart the network as soon as network connection changes More useful when operating the VM in Bridged mode Called on startup by /etc/inittab Script: /etc/GILDA/NetworkChecker.sh Once network settings change boot and ssh login messages will change accordingly
References GILDA VM – GILDA VM Instructions – hostname portlet template –
Questions?