“--defaultsURL" doesn't work in pilot dirac-install.py

40 views
Skip to first unread message

zhangx...@ihep.ac.cn

unread,
Sep 8, 2021, 11:18:09 PM9/8/21
to diracgrid-forum
Dear experts,

  "/cvmfs/dirac.egi.eu/admin/globalDefaults.cfg" is used as the first config in pilot "dirac-install.py". However, when user wants to pass customized "globalDefaults.cfg" by "--defatulsURL" parameters, it seems that "dirac-install.py" will still use "/cvmfs/dirac.egi.eu/admin/globalDefaults.cfg" rather than user's own config.

  It may be caused by "__loadGlobalDefaults" function. User's config is stored in "self.globalDefaultsURL” but the cvmfs path is prior to "self.globalDefaultsURL”, so the defaulted cvmfs config will always be used if cvmfs is accessible to computing site.

  I think the priority list should be like: "user custom config (if there is) > cvmfs path > original default url" but the present priority list seems to be like: "cvmfs path > user custom config > original defatul url".

  Would you please have a look on it and modify the priority? 

Thanks,
Xuantong

Federico Stagni

unread,
Sep 14, 2021, 9:16:21 AM9/14/21
to zhangx...@ihep.ac.cn, diracgrid-forum
Hi,
indeed that's the case as of now. I suspect that this was done after the discussion in https://github.com/DIRACGrid/DIRAC/issues/4604

Now, considering that
- it's pretty easy to modify the "default" GlobalDefaults.cfg https://github.com/DIRACGrid/management/blob/master/globalDefaults.cfg
- dirac-install.py is becoming quickly legacy code (see also https://github.com/DIRACGrid/DIRAC/issues/4860)

I am reluctant to change the code of dirac-install.py. What is your use case?

Cheers,
Federico


--
You received this message because you are subscribed to the Google Groups "diracgrid-forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diracgrid-for...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/diracgrid-forum/e6c30358-7bef-451c-b136-d739dab337e5n%40googlegroups.com.

zhangx...@ihep.ac.cn

unread,
Sep 14, 2021, 12:17:24 PM9/14/21
to diracgrid-forum
Dear Federico,

Thanks for your reply. 

In my use case, I have a computing site which can only access cvmfs but not any other public IPs. When I use the defaulted "/cvmfs/dirac.egi.eu/admin/globalDefaults.cfg" , it leads site to access "http://diracproject.web.cern.ch/diracproject/dirac.cfg" for DIRAC project installation, but my site cannot access "http://diracproject.web.cern.ch" to get the "dirac.cfg" so then it reports an installation failure. 

As a result, I need to modify my "dirac-install.py" to check whether I can access "diracproject.web.cern.ch". If not, it will use my local "dirac.cfg" to get the following configs, including "BaseURL" and "DIRACOS" which also need to access "diracproject.web.cern.ch" in "dirac.cfg" . Just like:

  def __loadGlobalDefaults(self):

    globalDefaultsCVMFSPath = "/cvmfs/dirac.egi.eu/admin/globalDefaults.cfg"

    ### I add these ###
    import requests
    try:
      r = requests.get(url, timeout = 5)
    except requests.exceptions.ConnectionError:
    ### end ###

    self.__dbgMsg("Loading global defaults from: %s" % globalDefaultsCVMFSPath)
    result = self.__loadCFGFromURL(globalDefaultsCVMFSPath)

What I mean is that I know DIRAC can get all its installation components from cvmfs, but it looks like that the installation config files cannot be got from cvmfs directly. So I guess if the priority list for "globalDefaults.cfg" is "user custom config > cvmfs path > original default url", I only need to maintain a simple customized "globalDefaults.cfg" by “--defaultsURL" parameter rather than modifing the "__loadGlobalDefaults" function in "dirac-install.py". That is the reason why I make this conversation.

Hope to get your suggestion. Thanks.

Regards,
Xuantong

Federico Stagni

unread,
Sep 15, 2021, 6:59:55 AM9/15/21
to zhangx...@ihep.ac.cn, diracgrid-forum
If it gets globalDefaults.cfg from CVMFS, then it would get the "next" config file (e.g. the one containing "BaseURL") depending on the VO name. Is the VO listed in https://github.com/DIRACGrid/management/blob/master/globalDefaults.cfg?


Cheers,
Federico

zhangx...@ihep.ac.cn

unread,
Sep 15, 2021, 11:38:18 AM9/15/21
to diracgrid-forum
Yes, in my case it will get IHEP project (VO=IHEP), but the IHEP project depends on DIRAC project. 

"dirac-install.py" will check the dependence at https://github.com/DIRACGrid/Pilot/blob/master/Pilot/dirac-install.py#L778 and reload the "globalDefaults.cfg" by iterating "loadProjectRelease" function at https://github.com/DIRACGrid/Pilot/blob/master/Pilot/dirac-install.py#L799 to search the DIRAC project config in  "globalDefaults.cfg". Then, because my site cannot access diracproject web site, it reports a failure.

Ragards,
Xuantong
Reply all
Reply to author
Forward
0 new messages