(self)
Set singularity executable and related variables
Set singularity executable and related variables
Set singularity executable and related variables
def select_singularity(self):
        """Set singularity executable and related variables"""
        self.executable = Config.conf['use_singularity_executable']
        if self.executable != "UDOCKER" and not self.executable:
            self.executable = FileUtil("singularity").find_exec()

        if self.executable == "UDOCKER" or not self.executable:
            self.executable = ""
            arch = HostInfo().arch()
            image_list = []
            if arch == "amd64":
                image_list = ["singularity-x86_64", "singularity"]
            elif arch == "i386":
                image_list = ["singularity-x86", "singularity"]
            elif arch == "arm64":
                image_list = ["singularity-arm64", "singularity"]
            elif arch == "arm":
                image_list = ["singularity-arm", "singularity"]

            f_util = FileUtil(self.localrepo.bindir)
            self.executable = f_util.find_file_in_dir(image_list)

        if not os.path.exists(self.executable):
            Msg().err("Error: singularity executable not found")
            sys.exit(1)
def select_singularity ( self ) : self . executable = Config . conf [ 'use_singularity_executable' ] if self . executable != "UDOCKER" and not self . executable : self . executable = FileUtil ( "singularity" ) . find_exec ( ) if self . executable == "UDOCKER" or not self . executable : self . executable = "" arch = HostInfo ( ) . arch ( ) image_list = [ ] if arch == "amd64" : image_list = [ "singularity-x86_64" , "singularity" ] elif arch == "i386" : image_list = [ "singularity-x86" , "singularity" ] elif arch == "arm64" : image_list = [ "singularity-arm64" , "singularity" ] elif arch == "arm" : image_list = [ "singularity-arm" , "singularity" ] f_util = FileUtil ( self . localrepo . bindir ) self . executable = f_util . find_file_in_dir ( image_list ) if not os . path . exists ( self . executable ) : Msg ( ) . err ( "Error: singularity executable not found" ) sys . exit ( 1 )