Construction/Modification of a Grid5000 image
From WikiOAR
In this Tutorial I describe how I have constructed the lenny2.6.26-OAR2.4.0 image...But a similar procedure can be used to modify an already constructed environment...(for example make new additions on the lenny2.6.26-OAR2.4.0 image).
For this you need just only one node and the procedure is simple 1)you reserve a
node , 2)you deploy an already created environment , 3)you connect to the node ,
you do your modifications/installations and whatever you want , 4)you save the
environment and copy it to the frontal node 5) you register the environment and
finally 6) you can deploy your new environment with all the modifications on
all the nodes you want to ....
lets see the procedure in detail now:
Contents |
Reservation of one node
I) You allocate one node for deployment
oarsub -l /nodes=1,walltime=4 -p 'cluster="griffon"' -t deploy
Base Environment Deployment
II)then you deploy a basic environment
~/bin/katapult --min-deployed-nodes 1 --max-deploy-runs 30 --deploy-env lenny-x64-base-0.9 --deploy-part sda3 --file $OAR_NODEFILE
Connection to the node for installation/modifications
IV)you connect to the node:
ssh root@griffon-X.nancy
with password grid5000
and now you are ready to do whatever changes you want to ...
you can install debian packages by:
apt-get update apt-get install
For the case of lenny2.6.26-OAR2.4.0 image I have started by upgrading the kernel to version 2.6.26 and then added all packages needed for OAR (soon with extra details...)
Construct a .tgz image of the environment
V)ok once you have made the necessary changes you are ready to save your environement by creating an image of it... for that you have to become root
sudo su
and then you do the following command
tar zcf lenny2.6.26-OAR2.4.0 --numeric-owner --one-file-system --exclude=lenny2.6.26-OAR2.4.0.tgz /
where in the place of lenny2.6.26-OAR2.4.0 you can put whatever name you want...
this procedure will take some minutes to finish...
Copy and register the new environment to the frontal
VI) Once the last procedure is finished you have to copy the .tgz image file on the nancy frontal server you can create a directory to keep all images on every different Grid5000 site:
mkdir ~/Images
for example and then you copy the environment image you created on this directory...
cd Images scp g5k@griffon-X.nancy:~/lenny2.6.26-OAR2.4.0.tgz
VII)afterwards you can register your environement... for this you need to create a description file for your environement ... you can just copy one of mines actually:
cp ../../ygeorgiou/Images/lenny2.6.26-OAR2.4.0.dsc .
and you make the neccesary changes: if you write : vi lenny2.6.26-OAR2.4.0.dsc you will take this:
#lenny2.6.26-OAR2.4.0 name = lenny2.6.26-OAR2.4.0 id = 14 version = 1 description = lenny-x64-base-0.9 with kernel 2.6.26 and OAR 2.4.0 author = yiannis.georgiou@imag.fr filebase = file:///home/grenoble/ygeorgiou/Images/lenny2.6.26-OAR2.4.0.tgz filesite = file:///grid5000/postinstalls/lenny-x64-base-0.9-post.tgz size = 1000 initrdpath = /boot/initrd-2.6.26 kernelpath = /boot/vmlinuz-2.6.26 kernelparam = fdisktype = 83 filesystem = ext2 siteid = 1 optsupport = 0 user = ygeorgiou
so then you change the name the author, the description , the filebase (very important you have to put the path where the image is saved) and the user ....the rest you leave as is...
VII)and now you are ready to register the environement so that you can be able to use it...for this you write :
karecordenv -fe lenny2.6.26-OAR2.4.0.dsc
and it should tell you that it was succesfull! so then you can be happy!
Deploy the new environement on a number of nodes
VIII)Now you are ready to deploy your new environment on how many nodes you want to and perform your tests....do a reservation of 4 nodes and do then test the new environment by executing the deployment
by the way to do the deployment the command will be like this now:
~/katapult/katapult --min-deployed-nodes 4 --max-deploy-runs 30 --deploy-env lenny --file $OAR_NODEFILE --deploy-user USERNAME