MSO4SC / cloudify-hpc-plugin

Plugin to allow Cloudify to deploy and orchestrate HPC resources
Apache License 2.0
8 stars 8 forks source link

Make slurm job name accesible in all tasks #67

Open Trophime opened 6 years ago

Trophime commented 6 years ago

Hi, would it be possible to somehow get the slurm_id_job out of the submission to be able to notify the user of the output of the slurm job by, for instance, sending email in the revert step?

for instance in workload_manager.py in submit_job method :

        output, exit_code = self._execute_shell_command(ssh_client,
                                                        call,
                                                        workdir=workdir,
                                                        wait_result=True)
        if exit_code is not 0:
            logger.error("Job submission '" + call + "' exited with code " +
                         str(exit_code) + ":\n" + output)
            return False        
        else:
            slurm_job_id = output.replace("Submitted batch job ",'').strip()
            logger.info("slurm_job_id=%s"%slurm_job_id)

the trouble is how to get slurm_job_id accessible from the rest of the code...