Add a bind mount for /etc/hosts in Singularity
Here the request from Dirk:
There is a bug (feature?) in singularity that affects using the node /etc/hosts. https://github.com/sylabs/singularity/issues/1707 Basically, if you pass --contain (which we do), the singularity container ignores the nodes /etc/hosts. This bites you in the behind if the nodes have host information in /etc/hosts that is not available in DNS. We run into this problem at TACC. Could the wrapper be changed to include --bind /etc/hosts ? Cheers Dirk
There is a mitigation for this: GlideinWMS provided script has also these 3 variables that can help here.
These can be set in the attributes section (<attrs>) of the Factory or Frontend:
GLIDEIN_SINGULARITY_BINDPATH_DEFAULT - to add a bind mounth in the Factory
GLIDEIN_SINGULARITY_BINDPATH - same in the Frontend
GLIDEIN_SINGULARITY_OPTS - Extra options for the singularity command
See http://glideinwms.fnal.gov/doc.prd/factory/custom_vars.html#singularity_vars for more info
E.g. Add in the TACC entry in the factory:
<attr const="True" glidein_publish="True" job_publish="True" name="GLIDEIN_SINGULARITY_BINDPATH_DEFAULT" parameter="True" publish="True" type="string" value="/etc/hosts" />
Note also that Dave pointed out to me that older 3.x versions of Singularity were failing it the same destination is mounted twice (this is just a warning in 2.x and 3.1.1).