Generals UVa Net Setup & Management
From VCGR Wiki
Contents |
Refer to the wiki for a list of the General machines.
Starting a Net from Scratch
I have chosen Cicero to be the root of the UVa net. Log into Cicero using the
gbg account. I have indicated the required directory for each step and noted the
duration if it is significant.
Checkout Source from SVN
We start in /home/gbg/GeniiNet/GenesisII-src (which is a link to the local disk location: /localtmp/gbg/GenesisII-src).
Checkout latest GenesisII trunk from SVN (3 mins)
GenesisII-src>svn checkout svn://mamba.cs.virginia.edu:9002/GenesisII/trunk <name:GenesisII.date>
Note: I will refer to the <name:GenesisII.date> location as GenesisII.
Build using Ant (2 mins)
GenesisII-src>cd <name:GenesisII.date> GenesisII>ant
Create Installer with Correct Security for UVa Grid
(create script that do these steps)
Populate keystores, Create trust stores. This script takes following seven
parameters: <deployment path> <net root CA pass> <container group CA pass> <admin
pass> <installer pass> <container pass> <trust store pass>
GenesisII>./initialize-new-net-security deployments/GeniiNetBootstrapContainer netroot containergrp admin installer container trusted
Copy above created public+private key stores
GenesisII>cd deployments/GeniiNetFullContainer/security security>ls (ensure dir is empty) security>cp ../../GeniiNetBootstrapContainer/security/trusted.pfx trusted.pfx security>cp ../../GeniiNetBootstrapContainer/security/installer.pfx installer.pfx
Check the installer release number and update appropriately
security>cd ../../../installer installer>vi release.properties
Edit the number as desired. For this change to be persistent, you need to check it into SVN.
Build installer for the UVa net with the newly added credentials (2 mins)
installer>ant
Copy created installer to shared FS
installer>cd installers installers>cp GenesisII-GeniiNetFullContainer-installer-0.x.0.jar ~/GeniiNet/UVaNetInstaller-0.x.0.jar
Upload the installer onto the webpage:
Create a directory for the build if needed:
ssh mamba.cs.virginia.edu -l vcgr cd public_html/genesisII/downloads mkdir Build_<BuildNumer>
Transfer installer file:
cd Build_<BuildNumer> scp gbg@cicero:~/GeniiNet/*.jar installer.jar
Starting a Net From an Installer
Once you have created a GenesisII installer as specified above or if you already have one...
Install Root Net
To run the installer in this phase you will need to be able to view the GUI
installer pop-up. (Create .xml install description in the future to automate
this.) Make sure no java process is already running
ps auxww | grep java
Delete old files
GeniiNet>./clean.sh
Run installer
GeniiNet>java -jar UvaNetInstaller-0.x.0.jar
At this point the GUI installer will pop-up. Select to install
*Core *Example JSDL Documents *Documentation
Be sure to set the install path to
/gbg/GeniiNet/GeniiNetInstall
(You should be notified that this directory does already exist.)
Start Root Container and Bootstrap
We start the container by running the install container wrapper script. It takes the following two arguments: <deployment name> <container service name>
GeniiNet>cd GeniiNetInstall GeniiNetInstall>./InstallContainerWrapper GeniiNetBootstrapContainer GeniiNetContainer
Check that the log file indicates that the Container Started
GeniiNetInstall>tail -f ~/.genesisII/GeniiNetContainer/wrapper.log
We bootstrap the grid with the appropriate UVa net settings by running the script tool with the following arguments to specify the GENII_INSTALL_DIR, DEPLOYMENT_NAME, and location of the bootstrap.xml script. (2 mins)
GeniiNetInstall>./grid vcgr:$>script GENII_INSTALL_DIR=/home/gbg/GeniiNet/GeniiNetInstall DEPLOYMENT_NAME=GeniiNetBootstrapContainer deployments/GeniiNetBootstrapContainer/configuration/bootstrap.xml
We need to copy the context.xml file that was created to be publicly available for other who may want to connect to this UVa net. (create script for this)
vcgr:$>quit GeniiNetInstall>scp context.xml vcgr@mamba:~/public_html/GeniiNet/root.xml
Leave the connection to the root node up while you add other nodes so that you can monitor success.
Adding Linux Containers
Connect to another Linux general (Titus, Sulla, or Camillus).
Make sure no java process is already running
>ps auxww | grep java
Delete old files
GeniiNet>./clean.sh
Run the installer. Note the install options differ from the install for the root container. (5 mins)
GeniiNet>java -jar UvaNetInstaller-0.x.0.jar install-desc.xml
A new smaller popup window will appear after about 30 seconds. You will be prompted to enter a password. It is imperative you type this correctly as there is no backspace. If you do mistype something, you will need to wipe the state for this container entirely (see the uninstall steps) and restart at the beginning. After this, you will be asked to enter the installer password a second time. Please do so as before.
Password for the installer.pfx:installer
As the script finishes, a good sign that the container setups correctly is if 'setting security' takes some time for each step.
To test if the new container has been properly hooked into the UVa Net, go back to the connection on the root and check if the newly added container appears.
GeniiNetInstall>./grid vcgr:$>ls /containers vcgr:$>ls -ls /container/<container name>
Adding Windows Containers
To add a Windows Container to the UVa net, you need to get the installer for the net, run it, and make sure everything looks good. If the correct options are selected, the installer will do all the work!
First we check that no Genesis II service is up and running on this machine already. This is a good check if there is any chance that Genesis II has been run on this machine before. Go to
Start->All Programs->Administrative Tools->Services.
Make sure that no service starting with the name "Genesis II" appears.
Next we need to get the installer jar with all the security settings for the current UVa net. To do this you can get the installer from the downloads website if it has been updated or bring up Cygwin and scp directly from the gbg home folder:
>cd Desktop >scp gbg@cicero:~/GeniiNet/*.jar installer.jar
Run the installer (double-click!). Note the install options differ from the install above for the root container. The installation will take around 5 minutes.
Select to install the following:
*Core *Example JSDL Documents *Documentation *Start GeniiFullContainer
Make sure the install path contains no parens:
Program Files/Genesis II(You should be
notified that this directory does not yet exist.)
A new smaller popup window will appear. When prompted, enter:
Password for the installer.pfx:installer
Then you will be prompted again to enter the password for the machine you are on. This is referring to the windows password you used to log into that machine. If you mistype either of these passwords, you will need to uninstall GenesisII and then start the installation from the beginning. You will be asked a second time for the installer password. Use the same value that you typed in the first time (not the windows user password). You can uninstall with the following command:
Genesis II>uninstall-container.bat GeniiNetFullContainer GeniiNetContainer
Make sure the container setups correctly. A good sign is if 'setting security' takes some time for each step.
To test if the new container has been properly hooked into the UVa Net, open up the net and check if the newly added container appears.
Genesis II>grid.bat vcgr:$>ls /containers vcgr:$>ls -ls /container/<container name>
Testing the Net
Once the UVa net is setup, running some of the example jobs is a good way to test if things are working. One way to do this is to start up a net on your own machine and connect to the UVa net to run the jobs. For these instructions I'll be assuming you're creating a net on a Windows machine.
Get a copy of the installer used above to setup a local net.
scp gbg@cicero.cs.virignia.edu:~Geniinet/*.jar startup.jar
Install the net via the GUI. Make sure to select the example files for download. Do not select to start the NetFullContainer.
Go to where you installed the net and run the grid by selecting the grid.bat file.
Connect to the UVa net:
vcgr:$>connect "http://www.cs.virginia.edu/~vcgr/GeniiNet/root.xml" "deployments/GeniiNetFullContainer"
Login using your UVa certificate.
vcgr:$>login --file=<filename.pfx> --password=<> --no-gui
When you ls now you should see the net with all the containers.
vcgr:$>ls
Running a job will create output. Go to your personal directory so that you will have the needed permissions to save a file.
vcgr:$>cd /home/<personaldir>
For each Linux container, you can run the following job:
vcgr:$>run --jsdl=example-jsdl/example-posix-jsdl.xml /bes-containers/<linux_container_name>
A file, sum.dat, should be created.
vcgr:$>cat sum.dat
The value 49 should appear.
For each Windows container, you can run the following job:
vcgr:$>run --jsdl=example-jsdl/win-posix-jsdl.xml /bes-containers/<windows_container_name>
A file, job1.stdout, should be created.
vcgr:$>cat job1.stdout
The value 7 should appear.
Tearing Down a Net
The following instructions describe how to nicely tear down the net. The root container should be torn down last. If after following these steps, the containers are still running, feel free to:
kill -9 -1
Tearing Down Linux Containers
The GeniiNetContainer-manage-script is used to tear down a Linux container.
GeniiNet/GeniiNetInstall>./GeniiNetContainer-manage-script stop
When run, the script should display "Stopped VCGR Container"
Check that indeed no java process is running:
anywhere>ps auxww | grep java
Delete the old system state files by running the clean script:
GeniiNet>./clean.sh
Tearing Down Windows Containers
Connect to the windows maching using remote desktop. Don't forget to logoff and not just close the remote desktop connection when you are done.
In a command window, run the uninstall-container script with the following parameters:
Genesis II>uninstall-container.bat GeniiNetFullContainer GeniiNetContainer
Check that no Genesis II service is up and running. Go to
Start->All Programs->Administrative Tools->Services.
Open up Cygwin and delete the old system state files by running the clean script:
Documents and Settings>./clean.sh
Tearing Down the Root Container
To tear down the root container, follow the Tearing Down Linux Containers instructions after tearing down all the other containers of the net.
Restarting a Container
If one of the containers on the net goes down, it can be restarted using the GeniiNetContainer-manage-script with the following the argument start or restart:
GeniiNet/GeniiNetInstall>./GeniiNetContainer-manage-script start
or
GeniiNet/GeniiNetInstall>./GeniiNetContainer-manage-script restart
