(self, dsl=None, submit_conf=None, callback_func=None)
return job_id, data
dsl_path = None
        with tempfile.TemporaryDirectory() as job_dir:
            if dsl:
                dsl_path = os.path.join(job_dir, "job_dsl.json")
                # pprint.pprint(dsl)
                LOGGER.debug(f"submit dsl is: \n {json.dumps(dsl, indent=4, ensure_ascii=False)}")
                with open(dsl_path, "w") as fout:
                    fout.write(json.dumps(dsl))
            LOGGER.debug(f"submit conf is: \n {json.dumps(submit_conf, indent=4, ensure_ascii=False)}")
            submit_path = os.path.join(job_dir, "job_runtime_conf.json")
            with open(submit_path, "w") as fout:
                fout.write(json.dumps(submit_conf))

            result = self.client.job.submit(conf_path=submit_path, dsl_path=dsl_path)
            if callback_func is not None:
                callback_func(result)
            try:
                if 'retcode' not in result or result["retcode"] != 0:
                    raise ValueError(f"retcode err")

                if "jobId" not in result:
                    raise ValueError(f"jobID not in result: {result}")

                job_id = result["jobId"]
                data = result["data"]
            except ValueError:
                raise ValueError("job submit failed, err msg: {}".format(result))
dsl_path = None
        with tempfile.TemporaryDirectory() as job_dir:
            if dsl:
                dsl_path = os.path.join(job_dir, "job_dsl.json")
                # pprint.pprint(dsl)
                LOGGER.debug(f"submit dsl is: \n {json.dumps(dsl, indent=4, ensure_ascii=False)}")
                with open(dsl_path, "w") as fout:
                    fout.write(json.dumps(dsl))
            LOGGER.debug(f"submit conf is: \n {json.dumps(submit_conf, indent=4, ensure_ascii=False)}")
            submit_path = os.path.join(job_dir, "job_runtime_conf.json")
            with open(submit_path, "w") as fout:
                fout.write(json.dumps(submit_conf))
dsl_path = None with tempfile . TemporaryDirectory () as job_dir : if dsl : dsl_path = os . path . join ( job_dir job_dsl . json ) # pprint . pprint ( dsl ) LOGGER . debug ( f submit dsl is : \ n { json . dumps ( dsl indent = 4 ensure_ascii = False ) } ) with open ( dsl_path w ) as fout : fout . write ( json . dumps ( dsl )) LOGGER . debug ( f submit conf is : \ n { json . dumps ( submit_conf indent = 4 ensure_ascii = False ) } ) submit_path = os . path . join ( job_dir job_runtime_conf . json ) with open ( submit_path w ) as fout : fout . write ( json . dumps ( submit_conf ))
def submit_job(self, dsl=None, submit_conf=None, callback_func=None):
        """
        dsl_path = None
        with tempfile.TemporaryDirectory() as job_dir:
            if dsl:
                dsl_path = os.path.join(job_dir, "job_dsl.json")
                # pprint.pprint(dsl)
                LOGGER.debug(f"submit dsl is: \n {json.dumps(dsl, indent=4, ensure_ascii=False)}")
                with open(dsl_path, "w") as fout:
                    fout.write(json.dumps(dsl))
            LOGGER.debug(f"submit conf is: \n {json.dumps(submit_conf, indent=4, ensure_ascii=False)}")
            submit_path = os.path.join(job_dir, "job_runtime_conf.json")
            with open(submit_path, "w") as fout:
                fout.write(json.dumps(submit_conf))

            result = self.client.job.submit(conf_path=submit_path, dsl_path=dsl_path)
            if callback_func is not None:
                callback_func(result)
            try:
                if 'retcode' not in result or result["retcode"] != 0:
                    raise ValueError(f"retcode err")

                if "jobId" not in result:
                    raise ValueError(f"jobID not in result: {result}")

                job_id = result["jobId"]
                data = result["data"]
            except ValueError:
                raise ValueError("job submit failed, err msg: {}".format(result))
        """
        LOGGER.debug(f"submit dsl is: \n {json.dumps(dsl, indent=4, ensure_ascii=False)}")
        LOGGER.debug(f"submit conf is: \n {json.dumps(submit_conf, indent=4, ensure_ascii=False)}")
        result = self.client.job.submit(config_data=submit_conf, dsl_data=dsl)
        if callback_func is not None:
            callback_func(result)
        try:
            if 'retcode' not in result or result["retcode"] != 0:
                raise ValueError(f"retcode err")

            if "jobId" not in result:
                raise ValueError(f"jobID not in result: {result}")

            job_id = result["jobId"]
            data = result["data"]
        except ValueError:
            raise ValueError("job submit failed, err msg: {}".format(result))
        return job_id, data
def submit_job ( self , dsl = None , submit_conf = None , callback_func = None ) : LOGGER . debug ( f"submit dsl is: \n {json.dumps(dsl, indent=4, ensure_ascii=False)}" ) LOGGER . debug ( f"submit conf is: \n {json.dumps(submit_conf, indent=4, ensure_ascii=False)}" ) result = self . client . job . submit ( config_data = submit_conf , dsl_data = dsl ) if callback_func is not None : callback_func ( result ) try : if 'retcode' not in result or result [ "retcode" ] != 0 : raise ValueError ( f"retcode err" ) if "jobId" not in result : raise ValueError ( f"jobID not in result: {result}" ) job_id = result [ "jobId" ] data = result [ "data" ] except ValueError : raise ValueError ( "job submit failed, err msg: {}" . format ( result ) ) return job_id , data