User How-To - Use PackMan

This document describes how to register and use software packages within AliEn. AliEn packages can have different versions, and dependencies. The system will install all the dependencies of the packages that are required in the jdl. Here we will describe all the steps necessary to create a new package, and use it from a job.

 

 

Preconditions

 

  • You must be registered with one of AliEn Virtual Organisations
  • You must download and install AliEn client software

 

Creating a package

The first thing that you have to do to create a package is to compress all the files and libraries that you need in a tar file. In this example, we are going to make a package of ROOT.

 

bash-2.05a$ <b>ls -al</b>
total 72
drwxr-xr-x 14 psaiz z2 4096 Jul 6 14:24 .
drwxrwxrwt 20 root root 4096 Jul 6 14:24 ..
-rw-r--r-- 1 psaiz z2 1604 May 16 2000 LICENSE
drwxr-xr-x 2 psaiz z2 4096 Dec 17 2003 README
drwxr-xr-x 2 psaiz z2 4096 Feb 15 18:58 bin
drwxr-xr-x 5 psaiz z2 4096 Mar 25 18:12 cint
drwxr-xr-x 2 psaiz z2 4096 Dec 17 2003 etc
drwxr-xr-x 2 psaiz z2 4096 Oct 31 2003 fonts
drwxr-xr-x 2 psaiz z2 4096 Dec 17 2003 icons
drwxr-xr-x 2 psaiz z2 16384 Feb 15 19:19 include
drwxr-xr-x 2 psaiz z2 4096 Feb 15 18:57 lib
drwxr-xr-x 2 psaiz z2 4096 Oct 31 2003 macros
drwxr-xr-x 4 psaiz z2 4096 Mar 25 18:12 proof
drwxr-xr-x 3 psaiz z2 4096 Mar 25 18:12 test
drwxr-xr-x 2 psaiz z2 4096 Mar 25 18:12 tutorials
bash-2.05a$ <b>tar zcf /tmp/ROOT.tar.gz *</b>
bash-2.05a$

Once we have that, we register the file in the catalogue. There is a command called 'packman' that will help us through this procedure. To see the syntax, just type 'packman' from the alien prompt:

 

bash-2.05a$ <b>alien login</b>

Warning: No valid proxy. Trying SSH key...
Feb 8 15:30:19 notice Starting remotequeue...
Feb 8 15:30:19 info Using default TTL value: 12 hours
Feb 8 15:30:19 info
[
Requirements = ( other.Type == "Job" );
CloseSE =
{
"EGEE::CERN::scratch"
};
CE = "EGEE::CERN::pcegee02";
Host = "pcegee02";
LocalDiskSpace = 7824836;
WNHost = "pcegee02.cern.ch";
TTL = 43200;
Type = "machine";
Uname = "2.4.21-15.0.3.EL.cernsmp"
]
[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ &gt <b>packman define ROOT 3.10.02 /tmp/root.tar.gz</b>
Feb 8 15:31:09 info Adding a new package
Feb 8 15:31:09 info Tag already exists
Feb 8 15:31:09 info Registering the file file://pcegee02.cern.ch/tmp/root.tar.gz in EGEE::CERN::SRMCastor
Feb 8 15:31:11 info In gridftp, putting the file gridftp://lxb1432.cern.ch:9999/home/alien2/upload.104 \
29.1107873071?SUBJECT=/C//CH/O//CERN/OU//GRID/CN//CE/lxn5210.cern.ch
Feb 8 15:31:11 info Doing globus-url-copy -p 5 -tcp-bs 5000 -ds "/C=CH/O=CERN/OU=GRID/CN=CE/lxn5210.ce \
rn.ch" file://pcegee02.cern.ch/tmp/root.tar.gz gsiftp://lxb1432.cern.ch:9999/home/alien2/upload.10429.11078 \
73071
Feb 8 15:31:15 info File uploaded successfuly
Feb 8 15:31:15 info Copying a file into an SE
Feb 8 15:31:24 info Getting the file srm://gridftp05.cern.ch:8443/castor/cern.ch/user/g/gproduct/EGEET \
EST/SE/07/54974/173193FA-79DE-11D9-AF50-D2BB22BE5185.1107873076 of size 30539757
Feb 8 15:31:24 info File /egee/user/p/psaiz/packages/ROOT/3.10.02/Linux-i686 inserted in the catalog
Feb 8 15:31:24 info Package /egee/user/p/psaiz/packages/ROOT/3.10.02/Linux-i686 added!!
[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ &gt;

With this we have defined a new package! We can check now if the package is included in the list of packages:

 

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ &gt <b> packman list</b>
Feb 8 15:34:30 info The PackMan has the following packages:
andrew@DaVinci::v12r0
[...]
psaiz@ROOT::3.10.02
[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ &gt

 

Installing and testing packages

At the moment, the package is defined, but it is not installed in any cache. The installation of a package will be automatically performed whenever a job requests a package that is not present. At the same time, we can also trigger the installation (and removal) of packages manually. This is done also with 'packman'.

 

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman install ROOT</b>
Feb 8 15:39:31 error Package is being installed

Feb 8 15:39:31 info Error talking to the PackMan
[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

This means that the package is being installed at the moment. The installation can take a while, depending on the size of the package and the load of the machine where it is being installed.

At any moment, we can get the log of the installation:

 

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman installLog ROOT</b>
Feb 8 15:41:49 info The installation log is

=========================================================
Feb 8 15:39:31 info Installing package ROOT (V 3.10.02)
Feb 8 15:39:32 info The guid is 173193FA-79DE-11D9-AF50-D2BB22BE5185
Feb 8 15:39:32 info Getting the pfn from EGEE::CERN::SRMCastor
Feb 8 15:39:32 info Asking the SE at http://lxb1432.cern.ch:8000
Feb 8 15:39:32 info In getfile, with EGEE::CERN::SRMCastor
Feb 8 15:39:32 info Getting the file srm://lxb1432.cern.ch/...
Feb 8 15:39:32 info We are not authenticated to get the file :(

X509_CERT_DIR=/opt/glite/etc/alien-certs/certificates/
Feb 8 15:39:34 info Transferring file with /opt/globus//bin/globus-url-copy -p 5 -tcp-bs 5000 ...
Feb 8 15:39:39 info File transfer using GRIDFTP with error: 0
Feb 8 15:39:40 info Everything worked and got /tmp/EGEE/cache/173193FA-...
And the file is /tmp/EGEE/cache/173193FA-...
Feb 8 15:39:40 info Starting the uncompress...
Feb 8 15:40:47 info Configuring the package ROOT (v 3.10.02)
Feb 8 15:40:47 info Returning 1 and ()
Feb 8 15:40:48 info Package ROOT installed successfully!
=========================================================

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

If we list the packages that are currently installed, we should also be able to see it:

 

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman listInstalled</b>
Feb 8 15:42:23 info The PackMan has the following packages Installed:
cmunro@ORCA::8_7_1
[..]
psaiz@ROOT::3.10.02
[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

Finally, we can also test the package

 

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman test ROOT</b>

Feb 8 15:49:08 info The package (version 3.10.02) has been installed properly
The package has the following metainformation
$VAR1 = undef;

Feb 8 15:49:08 info This is how the directory of the package looks like:
total 62
drwxrwxrwx 14 gproduct gm 2048 Feb 8 15:40 .
drwxrwxrwx 3 gproduct gm 2048 Feb 8 15:39 ..
drwxr-xr-x 2 gproduct gm 2048 Feb 15 2004 bin
drwxr-xr-x 5 gproduct gm 2048 Mar 25 2004 cint
drwxr-xr-x 2 gproduct gm 2048 Dec 17 2003 etc
drwxr-xr-x 2 gproduct gm 2048 Oct 31 2003 fonts
drwxr-xr-x 2 gproduct gm 6144 Dec 17 2003 icons
drwxr-xr-x 2 gproduct gm 24576 Feb 15 2004 include
drwxr-xr-x 2 gproduct gm 2048 Feb 15 2004 lib
-rw-r--r-- 1 gproduct gm 1604 May 16 2000 LICENSE
drwxr-xr-x 2 gproduct gm 2048 Oct 31 2003 macros
drwxr-xr-x 4 gproduct gm 2048 Mar 25 2004 proof
drwxr-xr-x 2 gproduct gm 2048 Dec 17 2003 README
drwxr-xr-x 3 gproduct gm 2048 Mar 25 2004 test
drwxr-xr-x 2 gproduct gm 8192 Mar 25 2004 tutorials

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

For the time being, ignore the line about the metainformation.

 

Packages and Environment variables

The first problem that we encounter once a package is installed is to know in which directory the package is installed. For example, 'ROOT' always depends on the environment variable 'ROOTSYS', which specifies where the different libraries can be found. The way we have created the package before, the user will have to know in advance where the package is, so that (s)he can set the proper value to 'ROOTSYS'. This is not a convenient solution.

This is where the initalization scripts for the package comes into the game. If your package contains a file called '.alienEnvironment', this file will be executed before the job starts using the package. The package is called getting as the first argument the directory where the package is installed, and the rest of the arguments are the command to execute.

 

Coming back to the ROOT example, let's go again through all the steps of defining the package, with this '.alienEnvironment' file:

 

  1. Create the .alienEnvironment file

     

    bash-2.05a$ cat ><b> .alienEnvironment &lt;&lt;EOF</b>
    ><b> export ROOTSYS=\$1</b>
    ><b> echo "ROOTSYS set to \$ROOTSYS"</b>
    ><b> shift</b>

    ><b> \$*</b>
    ><b> EOF</b>
    bash-2.05a$

     

  2. Create the tar file:

     

    bash-2.05a$ <b>ls -al</b>
    bash-2.05b$ ls -al
    total 80
    drwxr-xr-x 14 psaiz z2 4096 Feb 8 15:51 .
    drwxrwxrwt 49 root root 8192 Feb 8 15:52 ..
    drwxr-xr-x 2 psaiz z2 4096 Feb 15 2004 bin
    drwxr-xr-x 5 psaiz z2 4096 Mar 25 2004 cint
    drwxr-xr-x 2 psaiz z2 4096 Dec 17 2003 etc
    drwxr-xr-x 2 psaiz z2 4096 Oct 31 2003 fonts
    -rw-r--r-- 1 psaiz z2 52 Feb 8 15:52 .alienEnvironment
    drwxr-xr-x 2 psaiz z2 4096 Dec 17 2003 icons
    drwxr-xr-x 2 psaiz z2 16384 Feb 15 2004 include
    drwxr-xr-x 2 psaiz z2 4096 Feb 15 2004 lib
    -rw-r--r-- 1 psaiz z2 1604 May 16 2000 LICENSE
    drwxr-xr-x 2 psaiz z2 4096 Oct 31 2003 macros
    drwxr-xr-x 4 psaiz z2 4096 Mar 25 2004 proof
    drwxr-xr-x 2 psaiz z2 4096 Dec 17 2003 README
    drwxr-xr-x 3 psaiz z2 4096 Mar 25 2004 test
    drwxr-xr-x 2 psaiz z2 4096 Mar 25 2004 tutorials
    bash-2.05b$ <b>rm /tmp/root.tar.gz</b>
    bash-2.05a$ <b>tar zcf /tmp/ROOT.tar.gz .alienEnvironment *</b>

    bash-2.05a$

     

  3. Connect to alien:

    bash-2.05b$ <b>alien login</b>
    Feb 8 15:52:53 notice Starting remotequeue...
    Feb 8 15:52:53 info Using default TTL value: 12 hours
    Feb 8 15:52:53 info
    [
    Requirements = ( other.Type == "Job" );
    CloseSE =
    {
    "EGEE::CERN::scratch"
    };
    CE = "EGEE::CERN::pcegee02";
    Host = "pcegee02";
    LocalDiskSpace = 7824532;
    WNHost = "pcegee02.cern.ch";
    TTL = 43200;
    Type = "machine";
    Uname = "2.4.21-15.0.3.EL.cernsmp"
    ]
    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

     

  4. Undefine the package ROOT (we have to do this because we had already defined this package with the same version. If you define a new package, you will not have to do this)

    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ ><b> packman undefine ROOT 3.10.02</b>
    Feb 8 15:53:24 info Undefining a package
    Feb 8 15:53:24 info Package /egee/user/p/psaiz/packages/ROOT/3.10.02/Linux-i686 undefined!!
    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

     

  5. Define the package ROOT

     

    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ ><b> packman define ROOT 3.10.02 /tmp/root.tar.gz</b>
    Feb 8 15:54:55 info Adding a new package
    [..]
    Feb 8 15:55:12 info Package /egee/user/p/psaiz/packages/ROOT/3.10.02/Linux-i686 added!!
    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

This has created the package. Let's check that everything is working properly. First, let's install the package

 

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ ><b> packman install ROOT</b>
Feb 8 16:04:36 error Package is being installed

Feb 8 16:04:37 info Error talking to the PackMan
[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

The installation can take some time.

 

Note that now when we call 'packman test', we get back the environment the way a job will see it. Note as well that the variable 'ROOTSYS' will be defined.

 

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ ><b> packman test ROOT</b>
Feb 8 16:20:06 info The package (version 3.10.02) has been installed properly
The package has the following metainformation
$VAR1 = undef;

Feb 8 16:20:06 info This is how the directory of the package looks like:
total 63
drwxrwxrwx 14 gproduct gm 2048 Feb 8 16:14 .
drwxrwxrwx 3 gproduct gm 2048 Feb 8 16:12 ..
drwxr-xr-x 2 gproduct gm 2048 Feb 15 2004 bin
drwxr-xr-x 5 gproduct gm 2048 Mar 25 2004 cint
drwxr-xr-x 2 gproduct gm 2048 Dec 17 2003 etc
drwxr-xr-x 2 gproduct gm 2048 Oct 31 2003 fonts
-rwxr-xr-x 1 gproduct gm 58 Feb 8 16:14 .alienEnvironment
drwxr-xr-x 2 gproduct gm 6144 Dec 17 2003 icons
drwxr-xr-x 2 gproduct gm 24576 Feb 15 2004 include
drwxr-xr-x 2 gproduct gm 2048 Feb 15 2004 lib
-rw-r--r-- 1 gproduct gm 1604 May 16 2000 LICENSE
drwxr-xr-x 2 gproduct gm 2048 Oct 31 2003 macros
drwxr-xr-x 4 gproduct gm 2048 Mar 25 2004 proof
drwxr-xr-x 2 gproduct gm 2048 Dec 17 2003 README
drwxr-xr-x 3 gproduct gm 2048 Mar 25 2004 test
drwxr-xr-x 2 gproduct gm 8192 Mar 25 2004 tutorials

Feb 8 16:20:06 info The package will configure the environment to something similar to:
ROOTSYS set to /home/gproduct/.alien/packages/psaiz/ROOT/3.10.02
NNTPSERVER=news.cern.ch
MANPATH=/home/gproduct/man:/usr/sue/man:/afs/cern.ch/group/gm/man::/usr/local/man:/cern/man
HOSTNAME=lxn5210.cern.ch
[..]
ROOTSYS=/home/gproduct/.alien/packages/psaiz/ROOT/3.10.02
ALIEN_PERL=/opt/glite/bin/alien-perl
[..]
_=/usr/bin/env

[lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

Note that now that the file has a '.gliteEnvironment' file, the command 'packman test' executes it and returns the environment variables that will be set when the package is configured. Some of the environment variables might change slightly (for instance, HOSTNAME will contain the name of the WN that executes the job), but the important environment variables will identical to the ones displayed by the command.

 

Dependencies

We can also define a package that depends on another package. When a package is used, all of its dependencies will also be installed.

 

In this example, we are going to define a new package, AliROOT, which depends on the package that we have defined previously. Let's go again through the process of defining the package

 

 

  1. Create the .alienEnvironment file

     

    bash-2.05a$ cat ><b> .alienEnvironment &lt;&lt;EOF</b>
    ><b> export ALICE_ROOT=\$1</b>
    ><b> shift </b>
    ><b> export ALICE_TARGET=\`uname\`</b>
    ><b> PATH=\$ALICE_ROOT}/bin/tgt_\${ALICE_TARGET}:\${PATH}</b>
    ><b> LD_LIBRARY_PATH=\${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}/:\${LD_LIBRARY_PATH}</b>
    ><b> echo "Setting ALICE_ROOT to \$ALICE_ROOT"</b>
    ><b> \$*</b>

    ><b> EOF</b>
    bash-2.05a$

     

  2. Create the tar file:

    bash-2.05a$ <b>ls -al</b>
    total 168
    drwxr-xr-x 41 psaiz z2 4096 Feb 8 16:49 .
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 ..
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 ALIFAST
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 AliFluka
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 ANALYSIS
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 bin
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 CRT
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 data
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 DISPLAY
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 DPMJET
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 EMCAL
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 Euclid
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 EVGEN
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 FASTSIM
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 FLOW
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 FMD
    -rwxr-xr-x 1 psaiz z2 202 Feb 8 16:52 .alienEnvironment
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 HBTAN
    drwxr-xr-x 5 psaiz z2 4096 Feb 8 16:42 HLT
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 include
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 ITS
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 LHC
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 lib
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 macros
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 MONITOR
    drwxr-xr-x 4 psaiz z2 4096 Feb 8 16:42 MUON
    drwxr-xr-x 4 psaiz z2 4096 Feb 8 16:42 PDF
    drwxr-xr-x 4 psaiz z2 4096 Feb 8 16:42 PHOS
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 picts
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 PMD
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 RAW
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 RICH
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 START
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 STEER
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 STRUCT
    drwxr-xr-x 3 psaiz z2 4096 Feb 8 16:42 TFluka
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 TOF
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 TPC
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 TPHIC
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 TRD
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 VZERO
    drwxr-xr-x 2 psaiz z2 4096 Feb 8 16:42 ZDC
    bash-2.05a$ <b>tar zcf /tmp/AliROOT.tar.gz .alienEnvironment *</b>
    bash-2.05a$

     

  3. Connect to alien:

    bash-2.05b$ alien login
    Feb 8 16:56:14 notice Starting remotequeue...
    Feb 8 16:56:14 info Using default TTL value: 12 hours
    Feb 8 16:56:14 info
    [
    Requirements = ( other.Type == "Job" );
    CloseSE =
    {
    "EGEE::CERN::scratch"
    };
    CE = "EGEE::CERN::pcegee02";
    Host = "pcegee02";
    LocalDiskSpace = 6976088;
    WNHost = "pcegee02.cern.ch";
    TTL = 43200;
    Type = "machine";
    Uname = "2.4.21-15.0.3.EL.cernsmp"
    ]
    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

     

  4. Define the package AliROOT

    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman define AliROOT v4-01-Rev-04 /tmp/Al \
    iROOT.tar.gz dependencies='ROOT'</b>
    Feb 8 16:57:08 info Adding a new package
    [..]
    Feb 8 16:59:25 info Package /egee/user/p/psaiz/packages/AliROOT/v4-01-Rev-04/Linux-i686 added!!
    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >
    </ol>

    The package has been defined!! Let's install the package and test it:

     

    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman install AliROOT</b>
    Feb 8 17:01:06 error Package is being installed

    Feb 8 17:01:06 info Error talking to the PackMan
    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >
    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman installLog AliROOT</b>

    Feb 8 17:19:35 info The installation log is

    =========================================================
    Feb 8 17:01:07 info Installing package AliROOT (V v4-01-Rev-04)
    Feb 8 17:01:07 info The guid is 491E6314-79EA-11D9-85DC-D2BB22BE5185
    Feb 8 17:01:07 info Getting the pfn from EGEE::CERN::SRMCastor
    Feb 8 17:01:08 info Asking the SE at http://lxb1432.cern.ch:8000
    Feb 8 17:01:08 info In getfile, with EGEE::CERN::SRMCastor
    Feb 8 17:01:08 info Getting the file srm://lxb1432.cern.ch/...
    Feb 8 17:01:08 info We are not authenticated to get the file :(
    X509_CERT_DIR=/opt/glite/etc/alien-certs/certificates/
    Feb 8 17:01:10 info Transferring file with /opt/globus//bin/globus-url-copy -p 5 -tcp-bs 5000...
    Feb 8 17:02:02 info File transfer using GRIDFTP with error: 0
    Feb 8 17:02:03 info Everything worked and got /tmp/EGEE/cache/491E6314..
    And the file is /tmp/EGEE/cache/491E6314...
    Feb 8 17:02:03 info Starting the uncompress...
    Feb 8 17:05:04 info Configuring the package AliROOT (v v4-01-Rev-04)
    Feb 8 17:05:04 info Executing ./home/gproduct/.alien/packages/psaiz/AliROOT/v4-01-Rev-04/.gliteEnvironment
    Feb 8 17:05:04 info Package AliROOT installed successfully!

    =========================================================

    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman test AliROOT</b>
    Feb 8 17:25:32 info The package (version v4-01-Rev-04) has been installed properly
    The package has the following metainformation
    $VAR1 = {
    'compile' => '',
    'post_install' => '',
    'file' => '/egee/user/p/psaiz/packages/AliROOT/v4-01-Rev-04/',
    'dependencies' => 'ROOT',
    'unpack' => '',
    'md5sum' => '',
    'size' => '',
    'shared' => '',
    'executable' => '',
    'post_rm' => '',
    'pre_install' => '',
    'offset' => '',
    'entryId' => '19',
    'install' => '',
    'path' => '',
    'description' => '',
    'setup' => '',
    'config' => '',
    'pre_rm' => ''
    };

    Feb 8 17:25:32 info This is how the directory of the package looks like:
    total 95
    drwxrwxrwx 41 gproduct gm 2048 Feb 8 17:25 .
    drwxrwxrwx 3 gproduct gm 2048 Feb 8 17:01 ..
    drwxr-xr-x 2 gproduct gm 2048 Feb 8 16:42 ALIFAST
    drwxr-xr-x 3 gproduct gm 2048 Feb 8 16:42 AliFluka
    [..]
    drwxr-xr-x 2 gproduct gm 2048 Feb 8 16:42 ZDC

    Feb 8 17:25:32 info The package will configure the environment to something similar to:
    ROOTSYS set to /home/gproduct/.alien/packages/psaiz/ROOT/3.10.02
    Setting ALICE_ROOT to /home/gproduct/.alien/packages/psaiz/AliROOT/v4-01-Rev-04
    MANPATH=/home/gproduct/man:/usr/sue/man:/afs/cern.ch/group/gm/man::/usr/local/man:/cern/man
    [..]

    ROOTSYS=/home/gproduct/.alien/packages/psaiz/ROOT/3.10.02
    ALICE_TARGET=Linux
    ALICE_ROOT=/home/gproduct/.alien/packages/psaiz/AliROOT/v4-01-Rev-04
    LD_LIBRARY_PATH=/home/gproduct/.alien/packages/psaiz/AliROOT/v4-01-Rev-04/lib/tgt_Linux/...
    _=/usr/bin/env

    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

     

    Note that 'packman test AliROOT' returns also some metadata information. At the moment, the only metadata information used is 'dependencies', which is set to the packages that AliROOT depend on. We will see the rest of the fields in the next section.

    Note as well that at the beginning of the execution, both the environment of ROOT and the environment of AliROOT are setup.

     

    Using Packages

    Once you have defined a package, you can use it from any of your jobs. The system will install any packages that are defined in the 'Packages' item of your jdl. For instance, the following jdl:

    Executable="date";
    Packages="ROOT";

    will install a version of ROOT in the machine where your job runs. You can specify a specific version of a package if you put <package>::<version>, for instance ROOT::3.10.02.

    If the package is not installed in your machine before the execution, the system will install it. You can also specify the line:

     

    PackagesPreInstalled=1

    and then only the CE which have the package already installed will be able to execute the job.

    You can also use a package defined by another user:

    Packages="psaiz@ROOT";

    You can also require a list of packages, as alist of values:

     

    Packages={"ROOT", "&lt;any other package>"};

    Note that whenever you require a package, all of its dependenceis will be automatically included. Therefore, 'Packages={"ROOT","AliROOT"}' is equivalent to 'Packages="AliROOT"';

     

    Package metainformation

    In Dependencies we already saw one of the fields of the metainformation of the package. These fields can be seen with the command 'packman test':

     

    [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman test psaiz@AliROOT</b>
    Feb 8 17:25:32 info The package (version v4-01-Rev-04) has been installed properly
    The package has the following metainformation
    $VAR1 = {
    'compile' => '',
    'post_install' => '',
    'file' => '/egee/user/p/psaiz/packages/AliROOT/v4-01-Rev-04/',
    'dependencies' => 'ROOT',
    'unpack' => '',
    'md5sum' => '',
    'size' => '',
    'shared' => '',
    'executable' => '',
    'post_rm' => '',
    'pre_install' => '',
    'offset' => '',
    'entryId' => '19',
    'install' => '',
    'path' => '',
    'description' => '',
    'setup' => '',
    'config' => '',
    'pre_rm' => ''
    };
    [..]

    Dependencies describes the packages that will be installed and configured when this package is used. Now we are going to see the fields 'pre_install', 'post_install', 'pre_rm', and 'post_rm'. These fields can point to actions that will be executed respectively before and after package installation or deletion. They have to point to lfn already registered in the catalogue.

    Out of the four scripts, 'post_install' is usually the most interesting. For instance, lets supposse that a package only contains the source code. We could put in this 'post_install' all the necessary steps to compile the code in the machine where the package is being installed. Another scenario where the 'post_install' helps is when we receive the tar files from someone else, and we do not want to untar it just to put in it the '.gliteEnvironment' file. We could make the post_install script create the .alienEnvironment file, and use the tar file without having to modify it.

    In the next example, we are going to use the 'post_install' to generate the .alienEnvironment file of a package (thanks to S. Paterson for this example).

     

    1. Create the post_install script:

      bash-2.05b$ cat <<EOF >/tmp/post_install
      > #!/bin/bash
      >
      > echo "This script will create the .alienEnvironment file for DaVinci"
      >
      > cat >>.alienEnvironment <<MYEOF
      > #!/bin/csh
      >
      >
      > echo "In DV glite setting DaVinci \\\$1"
      > setenv DAVINCIROOT \\\$1/DaVinci/v12r3
      > setenv DAVINCIVERS v12r3
      > setenv APPVERSION v12r3
      > setenv LD_LIBRARY_PATH \\\${DAVINCIROOT}/lib:\\\${LD_LIBRARY_PATH}
      > setenv DAVINCIOPTS \$DAVINCIROOT/options
      > shift
      > \\\$*
      > MYEOF
      >
      > EOF

      bash-2.05b$

    2. Let's assume that we got the package DaVinci as a tar file from our librarian, and it's in /tmp/DaVinci.tar.gz
    3. Connect to alien

       

      bash-2.05b$ <b>alien login</b>
      Feb 8 17:57:49 notice Starting remotequeue...
      Feb 8 17:57:49 info Using default TTL value: 12 hours
      Feb 8 17:57:49 info
      [
      Requirements = ( other.Type == "Job" );
      CloseSE =
      {
      "EGEE::CERN::scratch"
      };
      CE = "EGEE::CERN::pcegee02";
      Host = "pcegee02";
      LocalDiskSpace = 6975388;
      WNHost = "pcegee02.cern.ch";
      TTL = 43200;
      Type = "machine";
      Uname = "2.4.21-15.0.3.EL.cernsmp"
      ]

       

    4. Add the post_install script to the catalogue

       

      [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>add DaVinci_post_install /tmp/post_install</b>
      Feb 8 17:58:25 info Registering the file file://pcegee02.cern.ch/tmp/post_install in EGEE::CERN::SRMCastor
      Feb 8 17:58:25 info Initializing Service
      [..]
      Feb 8 17:58:31 info File /egee/user/p/psaiz/DaVinci_post_install inserted in the catalog

       

    5. Define the package

      [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ > <b>packman define DaVinci v12r3
      /tmp/EGEE/cache/60B23CEE-7535-11D9-875D-D2BB22BE5185.1107360810.197031107881969.141841107881990 depen \
      dencies='LHCB,Gaudi,XmlDDDB,ParamFiles,FieldMap'
      post_install='/egee/user/p/psaiz/DaVinci_post_install'</b>

      Feb 8 18:02:29 info Adding a new package
      Feb 8 18:02:30 info Tag already exists
      Feb 8 18:02:30 info Registering the file file://pcegee02.cern.ch/tmp/EGEE/cache/60B23CEE...
      [..]
      Feb 8 18:04:02 info File /egee/user/p/psaiz/packages/DaVinci/v12r3/Linux-i686 inserted in the catalog
      Feb 8 18:04:03 info We have HASH(0x8cd1740) and post_install file dependencies
      Feb 8 18:04:03 info Package /egee/user/p/psaiz/packages/DaVinci/v12r3/Linux-i686 added!!
      [lxb2075.cern.ch:3308] /egee/user/p/psaiz/ >

       

    Note that the package DaVinci depends on other packages (let's assume that we have already defined them). If we do 'packman install DaVinci', all the dependencies will be installed, then the tar file of DaVinci will be uncompress and finally the 'post_install' script will be executed.