Difference between revisions of "Deploy Procedure in Kadeploy 3 and OAR"

From Supercomputación y Cálculo Científico UIS
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
__NOTOC__
  
To save the modified image
+
<div class="thumbnail img-thumbnail">http://wiki.sc3.uis.edu.co/images/a/a8/Logo_sc33.png</div>
 +
<p><div class="btn btn-primary"><i class="fa  fa-long-arrow-left"></i> [[Kadeploy]]</div></p>
  
In the machine execute these commands
+
<div class="col-md-14">
 +
    <div class="panel panel-darker-white-border">
 +
        <div class="panel-heading">
 +
            <h3 class="panel-title">Deploy Procedure in Kadeploy 3 and OAR</h3>
 +
        </div>
 +
        <div class="panel-body">
 +
            <p>
  
{{Command|<nowiki>rm /etc/udev/rules.d/70-persistent-net.rules</nowiki>}}
+
{{Note|<nowiki>
{{Command|<nowiki>mount -o bind / /mnt</nowiki>}}
+
There are two kinds of environments, private and public.  Private environments are only usable for the user that created them. Public environments are available for all users but they can only be created by root. It's important to note that difference and check whether an enviroment should be public or private when creating new ones.  Files for public environments should be created in public directories, even if those aren't available via permissions to all users.  This is a style norm. It's also important to note that the user that performs the operations related to deployments affects the visibility of said deployments. At the end of this page this will be clarified.
 +
</nowiki>}}
  
After exiting the machine, on the front-end execute the following commands:
+
'''Deploying a base image'''
  
{{Command|<nowiki>ssh root@guanexx "cd /mnt; tar --posix --numeric-owner --one-file-system -zcf - *" > archivoImagen.tgz</nowiki>}}
+
It's necessary to check the exact name of the environment to deploy.  The command kaenv3 -l allows to see all the environments available for the current user. 
 +
{{Command|<nowiki>kaenv3 -l</nowiki>}}
 +
{{Command|<nowiki>oarsub -I -t deploy</nowiki>}}
 +
In this example, the base image selected for deployment is 'squeeze-x32-base'.
 +
{{Command|<nowiki>kadeploy3 -e squeeze-x32-base -f $OAR_NODEFILE</nowiki>}}
 +
Then you can access the deployed node via ssh:
 +
{{Command|<nowiki>ssh root@nodoXX</nowiki>}}
  
 +
'''Saving the modified image'''
  
 +
In the machine execute these commands
  
Create the following file in an accessible location:
+
{{Command|<nowiki>rm /etc/udev/rules.d/70-persistent-net.rules</nowiki>}}
 
+
{{Command|<nowiki>mount -o bind / /mnt</nowiki>}}
 +
After exiting the machine, on the front-end execute the following commands, where xx is a numeric string between 01 and 16 (nodes availables at the moment) and archivoImagen.tgz is the filename of the image file:
 +
{{Command|<nowiki>ssh root@guanexx "cd /mnt; tar --posix --numeric-owner --one-file-system -zcf - *" > archivoImagen.tgz</nowiki>}}
 +
Create the following file (in this case ambiente.dsc) in an accessible location, taking into account the filename used and other similar parameters:
 +
{{File|ambiente.dsc|<pre><nowiki>
 +
name : ambiente
  
 +
version : 1
 +
author : usuario
 +
tarball : /home/usuario/archivoImagen.tgz|tgz
 +
kernel : /boot/vmlinuz-2.6.26-2-amd64
 +
initrd : /boot/initrd.img-2.6.26-2-amd64
 +
fdisktype : 83
 +
filesystem : ext3
 +
visibility : private
 +
demolishing_env : 0
 +
environment_kind : linux
 +
</nowiki></pre>}}
 +
In this case the image is going to be private, which means it can only be accessed and deployed by the user that created it.  If you want it to be public, root must do it, and must set the visibility parameter to public in the dsc file; also, it is advisable to copy the image file to /home/images, lest you want to set a complicated permissions scheme, then you have to change the path in the dsc file accordingly:
 
{{File|ambiente.dsc|<pre><nowiki>
 
{{File|ambiente.dsc|<pre><nowiki>
 
name : ambiente
 
name : ambiente
Line 21: Line 55:
 
version : 1  
 
version : 1  
 
author : usuario  
 
author : usuario  
tarball : /home/usuario/ambiente.tgz|tgz  
+
tarball : /home/images/archivoImagen.tgz|tgz  
 
kernel : /boot/vmlinuz-2.6.26-2-amd64  
 
kernel : /boot/vmlinuz-2.6.26-2-amd64  
 
initrd : /boot/initrd.img-2.6.26-2-amd64  
 
initrd : /boot/initrd.img-2.6.26-2-amd64  
 
fdisktype : 83  
 
fdisktype : 83  
 
filesystem : ext3  
 
filesystem : ext3  
visibility : private
+
visibility : public
 
demolishing_env : 0  
 
demolishing_env : 0  
 
environment_kind : linux  
 
environment_kind : linux  
 
</nowiki></pre>}}
 
</nowiki></pre>}}
 +
{{Note|<nowiki>
 +
It is important to check the kernel and initrd.  Usually the same ones from the base image will work but if you upgrade the distro (or just the kernel) you have to be careful.
 +
</nowiki>}}
 +
After the dsc file is ready you must run the following command to add the environment:
 +
{{Command|<nowiki>kaenv3 -a ambiente.dsc</nowiki>}}
 +
Remember checking the dsc file name and path. Now can check with:
 +
{{Command|<nowiki>kaenv3 -l</nowiki>}}
 +
And the new environment must appear in the list. It will be ready to use.
 +
 +
            </p>
 +
        </div>
 +
    </div>
 +
</div>

Latest revision as of 21:01, 9 April 2015


Logo_sc33.png

Deploy Procedure in Kadeploy 3 and OAR

NOTE: There are two kinds of environments, private and public. Private environments are only usable for the user that created them. Public environments are available for all users but they can only be created by root. It's important to note that difference and check whether an enviroment should be public or private when creating new ones. Files for public environments should be created in public directories, even if those aren't available via permissions to all users. This is a style norm. It's also important to note that the user that performs the operations related to deployments affects the visibility of said deployments. At the end of this page this will be clarified.


Deploying a base image

It's necessary to check the exact name of the environment to deploy. The command kaenv3 -l allows to see all the environments available for the current user.

kaenv3 -l
oarsub -I -t deploy

In this example, the base image selected for deployment is 'squeeze-x32-base'.

kadeploy3 -e squeeze-x32-base -f $OAR_NODEFILE

Then you can access the deployed node via ssh:

ssh root@nodoXX


Saving the modified image

In the machine execute these commands

rm /etc/udev/rules.d/70-persistent-net.rules
mount -o bind / /mnt

After exiting the machine, on the front-end execute the following commands, where xx is a numeric string between 01 and 16 (nodes availables at the moment) and archivoImagen.tgz is the filename of the image file:

ssh root@guanexx "cd /mnt; tar --posix --numeric-owner --one-file-system -zcf - *" > archivoImagen.tgz

Create the following file (in this case ambiente.dsc) in an accessible location, taking into account the filename used and other similar parameters:

File: ambiente.dsc
name : ambiente

version : 1 
author : usuario 
tarball : /home/usuario/archivoImagen.tgz|tgz 
kernel : /boot/vmlinuz-2.6.26-2-amd64 
initrd : /boot/initrd.img-2.6.26-2-amd64 
fdisktype : 83 
filesystem : ext3 
visibility : private 
demolishing_env : 0 
environment_kind : linux 

In this case the image is going to be private, which means it can only be accessed and deployed by the user that created it. If you want it to be public, root must do it, and must set the visibility parameter to public in the dsc file; also, it is advisable to copy the image file to /home/images, lest you want to set a complicated permissions scheme, then you have to change the path in the dsc file accordingly:

File: ambiente.dsc
name : ambiente

version : 1 
author : usuario 
tarball : /home/images/archivoImagen.tgz|tgz 
kernel : /boot/vmlinuz-2.6.26-2-amd64 
initrd : /boot/initrd.img-2.6.26-2-amd64 
fdisktype : 83 
filesystem : ext3 
visibility : public 
demolishing_env : 0 
environment_kind : linux 
NOTE: It is important to check the kernel and initrd. Usually the same ones from the base image will work but if you upgrade the distro (or just the kernel) you have to be careful.

After the dsc file is ready you must run the following command to add the environment:

kaenv3 -a ambiente.dsc

Remember checking the dsc file name and path. Now can check with:

kaenv3 -l

And the new environment must appear in the list. It will be ready to use.