def create_pbs_job_content(self, module, case):
        """
        Method creates pbs start script which will be passed to
        some qsub command

        :type case: scripts.yamlc.yaml_config.ConfigCase
        :type module: scripts.pbs.modules.pbs_tarkil_cesnet_cz
        :rtype : str
        """

        import pkgutil

        command = strings.replace_placeholders(
            runtest_command,
            python=sys.executable,
            script=pkgutil.get_loader('runtest').path,
            yaml=case.file,
            random_output_dir='' if not self.arg_options.random_output_dir else
            '--random-output-dir ' + str(self.arg_options.random_output_dir),
            limits="-n {case.proc} -m {case.memory_limit} -t {case.time_limit}"
            .format(case=case),
            args="" if not self.arg_options.rest else Command.to_string(
                self.arg_options.rest),
            dump_output=case.fs.dump_output,
            save_to_db=''
            if not self.arg_options.save_to_db else '--save-to-db',
            status_file=''
            if not self.arg_options.status_file else '--status-file',
            log_file=case.fs.job_output)

        template = strings.replace_placeholders(
            module.template, command=command, dump_output=case.fs.dump_output)

        return template
Beispiel #2
0
    def create_pbs_job_content(self, module, case):
        """
        Method creates pbs start script which will be passed to
        some qsub command

        :type case: scripts.config.yaml_config.ConfigCase
        :type module: scripts.pbs.modules.pbs_tarkil_cesnet_cz
        :rtype : str
        """

        import pkgutil

        command = strings.replace_placeholders(
            runtest_command,

            python=sys.executable,
            script=pkgutil.get_loader('runtest').filename,
            yaml=case.file,
            limits="-n {case.proc} -m {case.memory_limit} -t {case.time_limit}".format(case=case),
            args="" if not self.rest else Command.to_string(self.rest),
            dump_output=case.fs.dump_output,
            log_file=case.fs.job_output
        )

        template = strings.replace_placeholders(
            module.template,
            command=command,
            dump_output=case.fs.dump_output
        )

        return template
    def create_pbs_job_content(self, module, case):
        """
        :type case: scripts.config.yaml_config.ConfigCase
        :type module: scripts.pbs.modules.pbs_tarkil_cesnet_cz
        :rtype : str
        """

        import pkgutil

        command = strings.replace_placeholders(
            exec_parallel_command,

            python=sys.executable,
            script=pkgutil.get_loader('exec_parallel').filename,
            limits="-n {case.proc} -m {case.memory_limit} -t {case.time_limit}".format(case=case),
            args="" if not self.rest else Command.to_string(self.rest),
            dump_output=case.fs.dump_output,
            log_file=case.fs.job_output
        )

        template = strings.replace_placeholders(
            module.template,
            command=command,
            dump_output=case.fs.dump_output  # TODO remove
        )

        return template
Beispiel #4
0
    def create_pbs_job_content(self, module, case):
        """
        Method creates pbs start script which will be passed to
        some qsub command

        :type case: scripts.config.yaml_config.ConfigCase
        :type module: scripts.pbs.modules.pbs_tarkil_cesnet_cz
        :rtype : str
        """

        import pkgutil

        command = strings.replace_placeholders(
            runtest_command,

            python=sys.executable,
            script=pkgutil.get_loader('runtest').filename,
            yaml=case.file,
            limits="-n {case.proc} -m {case.memory_limit} -t {case.time_limit}".format(case=case),
            args="" if not self.arg_options.rest else Command.to_string(self.arg_options.rest),
            dump_output=case.fs.dump_output,
            log_file=case.fs.job_output
        )

        template = strings.replace_placeholders(
            module.template,
            command=command,
            dump_output=case.fs.dump_output
        )

        return template
    def create_pbs_job_content(self, module, case):
        """
        :type case: scripts.config.yaml_config.ConfigCase
        :type module: scripts.pbs.modules.pbs_tarkil_cesnet_cz
        :rtype : str
        """

        import pkgutil

        command = strings.replace_placeholders(
            exec_parallel_command,
            python=sys.executable,
            script=pkgutil.get_loader('exec_parallel').filename,
            limits="-n {case.proc} -m {case.memory_limit} -t {case.time_limit}"
            .format(case=case),
            args="" if not self.arg_options.rest else Command.to_string(
                self.arg_options.rest),
            dump_output=case.fs.dump_output,
            log_file=case.fs.job_output)

        template = strings.replace_placeholders(
            module.template,
            command=command,
            dump_output=case.fs.dump_output  # TODO remove
        )

        return template
Beispiel #6
0
    def parse_yaml(self):
        # register yaml parser tags
        from scripts.artifacts.collector import Collector
        from scripts.artifacts.command import Command
        from scripts.artifacts.modules.mongodb import DatabaseMongo
        from scripts.artifacts.modules.lscpu import CommandLSCPU

        with open(self.yaml_file, "r") as fp:
            yaml_data = fp.read()

        yaml_data = strings.replace_placeholders(
            yaml_data,
            _format_="<{}>",
            root=Paths.flow123d_root(),
            time=System.time,
            date=System.date,
            datetime=System.datetime,
            rnd8=System.rnd8,
            rnd16=System.rnd16,
            rnd32=System.rnd32,
            rnd=System.rnd,
        )
        self.configuration = yaml.load(yaml_data) or {}
    def parse_yaml(self):
        # register yaml parser tags
        from scripts.artifacts.collector import Collector
        from scripts.artifacts.command import Command
        from scripts.artifacts.modules.mongodb import DatabaseMongo
        from scripts.artifacts.modules.lscpu import CommandLSCPU

        with open(self.yaml_file, 'r') as fp:
            yaml_data = fp.read()

        yaml_data = strings.replace_placeholders(
            yaml_data,
            _format_ = '<{}>',

            root=Paths.flow123d_root(),
            time=System.time,
            date=System.date,
            datetime=System.datetime,
            rnd8=System.rnd8,
            rnd16=System.rnd16,
            rnd32=System.rnd32,
            rnd=System.rnd,
        )
        self.configuration = yaml.load(yaml_data) or {}