Live GIS Build

From OSGeo
Revision as of 04:57, 28 August 2009 by Wiki-Camerons (talk | contribs)
Jump to navigation Jump to search

About

GISVM is an Xubuntu based Virtual Machine which has been installed with a suite of the best Open Source Geospatial software. It is also used to build Arramagong, the Linux based Live DVD.

How to add your project or data to GISVM in 10 minutes

All that's required to add your favorite package into GISVM is to:

  • write a shell script which installs and configures your stable package into the current GISVM virtual machine (which will usually be the same as installing on Xubuntu or Ubuntu).
If you do not have write permission there feel free to send the script to the OSGeo live-demo mailing list as an attachment and we'll see that it makes it in.
  • Notify the GISVM team to test your script, and reference your script from main.sh.

The script may be as simple as:


install_mapserver.sh

#!/bin/sh
# Copyright (c) 2009 The Open Source Geospatial Foundation.
# Licensed under the GNU LGPL.
# 
# About:
# =====
# This script will install mapserver
#
# Running:
# =======
# sudo ./install_mapserver.sh

apt-get install cgi-mapserver

Projects that haven't been packaged yet are slightly more complicated:

install_udig.sh

#!/bin/sh
#################################################
# 
# Purpose: Installation of udig into Xubuntu
# Author:  Stefan Hansen <shansen@lisasoft.com>
#
#################################################
# Copyright (c) 2009 Open Geospatial Foundation
# Copyright (c) 2009 LISAsoft
#
# Licensed under the GNU LGPL.
# 
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 2.1 of the License,
# or any later version.  This library is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details, either
# in the "LICENSE.LGPL.txt" file distributed with this software or at
# web page "http://www.fsf.org/licenses/lgpl.html".
#

# About:
# =====
# This script will install udig into Xubuntu 

# Running:
# =======
# sudo ./install_udig.sh 

TMP="/tmp/udig_downloads"
INSTALL_FOLDER="/usr/lib"
DATA_FOLDER="/usr/local/share"
UDIG_FOLDER="$INSTALL_FOLDER/udig"
BIN="/usr/bin"
USER_NAME="user"
USER_HOME="/home/$USER_NAME"
 
## Setup things... ##
 
# check required tools are installed
if [ ! -x "`which wget`" ] ; then
   echo "ERROR: wget is required, please install it and try again" 
   exit 1
fi
# create tmp folders
mkdir $TMP
cd $TMP


## Install Application ##  

# get udig
if [ -f "udig-1.2-M6.linux.gtk.x86.tar.gz" ]
then
   echo "udig-1.2-M6.linux.gtk.x86.tar.gz has already been downloaded."
else
   wget http://udig.refractions.net/files/downloads/branches/udig-1.2-M6.linux.gtk.x86.tar.gz
fi
# unpack it and copy it to /usr/lib
tar -xzf udig-1.2-M6.linux.gtk.x86.tar.gz -C $INSTALL_FOLDER


## Configure Application ##

# Download modified startup script for udig
if [ -f "udig.sh" ]
then
   echo "udig.sh has already been downloaded."
else
   wget https://svn.osgeo.org/osgeo/livedvd/gisvm/trunk/udig-conf/udig.sh
fi
# copy it into the udig folder
cp udig.sh $UDIG_FOLDER 

# create link to startup script
ln -s $UDIG_FOLDER/udig.sh $BIN/udig 

# Download desktop icon
if [ -f "uDig.desktop" ]
then
   echo "uDig.desktop has already been downloaded."
else
   wget https://svn.osgeo.org/osgeo/livedvd/gisvm/trunk/udig-conf/uDig.desktop
fi
# copy it into the udig folder
cp uDig.desktop $USER_HOME/Desktop
chown $USER_NAME:$USER_NAME $USER_HOME/Desktop/uDig.desktop


## Sample Data ##

# Download udig's sample data
if [ -f "data-v1_1.zip" ]
then
   echo "data-v1_1.zip has already been downloaded."
else
   wget http://udig.refractions.net/docs/data-v1_1.zip
fi
#unzip the file into /usr/local/share/udig-data
mkdir $DATA_FOLDER/udig-data
unzip data-v1_1.zip -d $DATA_FOLDER/udig-data


## Documentation ##

# Download udig's documentation
if [ -f "udig-1.2-M5.html" ]
then
   echo "udig-1.2-M5.html has already been downloaded."
else
   wget http://udig.refractions.net/files/downloads/branches/udig-1.2-M5.html
fi

if [ -f "uDigWalkthrough1.pdf" ]
then
   echo "uDigWalkthrough1.pdf has already been downloaded."
else
   wget http://udig.refractions.net/docs/uDigWalkthrough1.pdf
fi

if [ -f "uDigWalkthrough2.pdf" ]
then
   echo "uDigWalkthrough2.pdf has already been downloaded."
else
   wget http://udig.refractions.net/docs/uDigWalkthrough2.pdf
fi

#copy into /usr/local/share/udig-docs
mkdir $DATA_FOLDER/udig-docs
cp udig-1.2-M5.html $DATA_FOLDER/udig-docs
cp uDigWalkthrough1.pdf $DATA_FOLDER/udig-docs
cp uDigWalkthrough1.pdf $DATA_FOLDER/udig-docs

Build Drivers

Which version?

The criteria used to select applications for GISVM is as follows:

  1. Priority goes to Ubuntu packaged software first, then Debian packaged software! This facilitates easy and reliable maintenance and update. Users will benefit from it. Programmers are encouraged to move their software into DebianGIS or UbuntuGIS repositories.
  2. Stable, always! GISVM users are mainly starters. So they obviously are better with stable software. They have enough problems already and will gladly be happier without software bugs.

For people who want the latest version, they can create an alternative upgrade script.

Low Memory

Both Virtual Machines, and a LiveDVD images are likely to be constrained by limited memory. So to reduce memory usage. Disk image size is not of major concern, as we can just distribute less data.

The following principles should be followed.

  1. Do not start applications upon power up. (Ie, don't start deamons, allow users to start them instead).
  2. Set up examples which, by default, don't depend on other applications. Less applications open, means less memory. Ie, Have GeoServer access a shapefile instead of PostGIS.
  3. Try to avoid scenarios which write data to disk, as disk space in the Live DVD is stored in RAM, and is not cleared afterward.

Directory Structure

  1. Temporary files (e.g., downloaded archives) go into /tmp. Please create a separate folder for your project.
  2. application are usually installed into /usr/lib
  3. things that get executed by the user such as startup scripts or links to them should go into /usr/bin
  4. startup/shutdown scripts for services (e.g., postgres, apache, tomcat) are stored in /etc/init.d
  5. sample data and documentation goes into /usr/local/share
  6. config files are stored in /etc
  7. user specific config files or working directories can go into /home/user/. However, it will be appreciated if you can keep the amount of things in the user's home folder as small as possible. Symlinks into /usr/local can be useful here.