Skip to content

COMDIRAC Configuration

Andrei Tsaregorodtsev edited this page Jun 20, 2023 · 1 revision

The following assumes that the DIRAC client is already installed and configured in the user's environment

COMDIRAC Client Configuration

Second thing to do, is to configure your user's defaults. You can use dconfig command to fill a minimal configuration file:

$ dconfig --minimal
It will be located in ~/.dirac/dcommands.conf and will look like:
[global]
default_profile = dirac_user

[dirac_user]
group_name = dirac_user
home_dir = /
default_se = DIRAC-USER
This setup is not very useful yet, but allows you to run other COMDIRAC commands.

The main idea behind this configuration file is that users can record several profiles, each with its own default settings. In many DIRAC instance, users belong to several groups/VOs. You may want to create at least one profile for your daily work. Here is an example [fg] profile one can add to its ~/.dirac/dcommnands.conf:

[fg]
group_name = fvo.france-grilles.fr
home_dir = /vo.france-grilles/user/p/pgay
You can make this profile your default, by setting it in the [global] section:
[global]
default_profile = fg
You can also ask dconfig command to generate very basic profiiles based on DIRAC groups you belong to:
dconfig --guess
This will create a profile for each of your groups. You can then customize each profile following your needs.

New in v0r17: sometimes, section names configured by dconfig --guesss are not very handy. Renaming them is not always a perfect solution. You can now configure aliases for each section. For example, if you want to refer indifferently dirac or du for configured section dirac_user, you can write the following:

[dirac_user]
aliases = dirac,du
...

There are many options to configure in the dcommands.conf file. We will see some of them in the following.

Additionnally, you can easily see the content of your dcommands.conf with dconfig command.

Session Initialization

With your configuration file set, you can now initialize a COMDIRAC session:

$ dinit
Enter Certificate password:
subject      : /O=GRID-FR/C=FR/O=BORDEAUXI/OU=DRIMM/CN=Pierre Gay/CN=proxy
issuer       : /O=GRID-FR/C=FR/O=BORDEAUXI/OU=DRIMM/CN=Pierre Gay
identity     : /O=GRID-FR/C=FR/O=BORDEAUXI/OU=DRIMM/CN=Pierre Gay
timeleft     : 23:59:59
DIRAC group  : frangrilles_user
path         : /tmp/x509up_u1000
username     : pgay
properties   : NormalUser
This command initializes a proxy, as this was done in the [DIRAC Client Installation procedure](https://github.com/DIRACGrid/DIRAC/wiki/ClientInstallation). The dinit commands does one other thing. It creates a COMDIRAC session. You can see it as a shell environment variables set dedicated to your COMDIRAC session.

The COMDIRAC session are copied from dcommands.conf [global] section into your environment. Then, options from the profile you chose are in turn copied into your environment. This means that you can put in the [global] section a set options shared by all profiles (unless overriden in the profile section itself).

You can look what's stored in your current session with:

$ dgetenv
default_profile = fg
default_se=DIRAC-USER
cwd=/vo.france-grilles.fr/user/p/pgay
profile_name=frangrilles_user
home_dir=/vo.france-grilles.fr/user/p/pgay
group_name=frangrilles_user

You can see that a couple of options were added to the original profile options by dinit. * profile_name helps you to remember what profile is currently loaded. * cwd comes from home_dir and is your File Catalog current working directory (we will learn about this in the following). * default_profile comes from the [global] section.

Session manipulation

At any moment after dinit you can see what's in your session options with dgetenv. You can also look for a specific option value. For example:

$ dgetenv profile_name
frangrilles_user

Using dsetenv, you can modify session options. For example, if we want to change the value of default_se, we can do:

$ dgetenv default_se
DIRAC-USER
$ dsetenv default_se=M3PEC-disk
$ dgetenv default_se
M3PEC-disk
Clone this wiki locally