Пример #1
0
def create_simulation(nsdid, xtorname=None):
    '''
    Create a simulation in the project repository and start a job for it.
    nsdid - the id of the NSD for the new simulation
    Return the new sim object created.
    Raises ValueError if nsdid is not in database PR.SIM
    '''

    # Get the executor
    xtor = Manager.executor(xtorname)

    # create the simoutput object
    sim, url, simhome = create_simoutput(xtor, repo(), nsdid)

    logfile = create_logstatistics(simhome)

    # create the job
    Manager.create_job(xtor, url, simhome)
    return sim
Пример #2
0
    def submit_job(self):
        try:
            #url for the sim.json file arg in create_job
            root_url = "file:" + self.simfile
            #simhome is job's fileloc
            self.simhome = Manager.create_job(root_url)
        except:
            print("Failed submitting new job")

        self.download_plan(
            self.read_json_file_argument(self.nsdfile, "plan_id"))
        self.download_project(
            self.read_json_file_argument(self.nsdfile, "project_id"))

        try:
            #get job's id
            self.retrieve_job()
            Manager.copy_simfiles(self.nsdfile, self.simfile, self.simhome)
        except:
            print("Failed copying sim and nsd files to local path")