wiki:GENIEducation/SampleAssignments/InstallScripts/Procedure

Version 1 (modified by nriga@bbn.com, 10 years ago) (diff)

--

How to write install scripts

In this tutorial you are going to learn how to automate the customization of your node with install scripts. In this example you can learn how to automate:

  1. the installation of a webserver
  2. the installation of the click router software

Pick one and stick to it throughout this exercise

Step1. Reserve a minimum topology

In the first step you reserve the minimum topology you need in order to manually install and test your software. In our case this is just a single VM for both (a) and (b).

Reserve a VM in your EG rack.

Step2. Manually install your software

Once your VM is up, login and manually install your software.

Find out your operating system:

lbs_release -a

To figure out the kernel version run:

uname -r

Step2a. Manually install a webserver ==

You can read more about installing a webserver here: https://help.ubuntu.com/lts/serverguide/httpd.html

Essentially to install do:

sudo apt-get install apache2

Try and visit your web server.

Customize the server anyway you want.

Where would you put the welcome page of your server?

Step2b. Manually install the click router

Follow instructions here: http://www.read.cs.ucla.edu/click/download

Step3. Write your script

Once you are happy with the configuration of your node, write a script that will automate this process. Look here for instructions: http://groups.geni.net/geni/wiki/HowTo/WriteInstallScript

To see a history of what you have done in your node do:

history

Once you are happy with your script, make sure you have tested it, make a tar file of it:

 tar xvfz <tar name> <script name>

Step4. Upload your script to a web server

If you have a dropbox account you can just upload the compressed (tar.gz) script to Dropbox and get the public URL.

If not ask us for help.

Step5. Debug

Now that you have the script is a public place you can modify your rspec to download and install it in a new node.

Reserve a node and check that it worked. It probably haven't:-)

On IG look here for where to find logs: http://www.protogeni.net/wiki/ServicesFaq

On EG check the neuca logs at: /var/log/neuca/neuca-agent.log

See why it failed, fix it, upload it and try again

If it worked, congrats! You wrote you first install script!