<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Ah, thanks so much. I'm still a slurm newbie and I've barely used srun. I'm not sure how long it would have taken me to find and understand those parameters from the docs. Thanks!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> slurm-users <slurm-users-bounces@lists.schedmd.com> on behalf of Jeffrey T Frey <frey@udel.edu><br>
<b>Sent:</b> Wednesday, February 8, 2023 10:01 AM<br>
<b>To:</b> Slurm User Community List <slurm-users@lists.schedmd.com><br>
<b>Subject:</b> Re: [slurm-users] slurm and singularity</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" style="border:0; display:table; width:100%; table-layout:fixed; border-collapse:seperate; float:none">
<tbody style="display:block">
<tr>
<td valign="middle" width="1px" bgcolor="#A6A6A6" cellpadding="7px 2px 7px 2px" style="padding:7px 2px 7px 2px; background-color:#A6A6A6">
</td>
<td valign="middle" width="100%" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 15px" color="#212121" style="width:100%; background-color:#EAEAEA; padding:7px 5px 7px 15px; font-family:wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:#212121; text-align:left; word-wrap:break-word">
<div>You don't often get email from frey@udel.edu. <a href="https://aka.ms/LearnAboutSenderIdentification">
Learn why this is important</a></div>
</td>
<td valign="middle" align="left" width="75px" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 5px" color="#212121" style="width:75px; background-color:#EAEAEA; padding:7px 5px 7px 5px; font-family:wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:#212121; text-align:left; word-wrap:break-word">
</td>
</tr>
</tbody>
</table>
<div>You may need srun to allocate a pty for the command. The InteractiveStepOptions we use (that are handed to srun when no explicit command is given to salloc) are:
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<blockquote class="" style="margin:0 0 0 40px; border:none; padding:0px">
<div class="">--interactive --pty --export=TERM</div>
</blockquote>
<div class="">
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">E.g. without those flags a bare srun gives a promptless session:</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
<blockquote class="" style="margin:0 0 0 40px; border:none; padding:0px">
<div class="">
<div class=""><b class="">[(it_nss:frey)@login00.darwin ~]$ salloc -p idle srun /opt/shared/singularity/3.10.0/bin/singularity shell /opt/shared/singularity/prebuilt/postgresql/13.2.simg</b></div>
</div>
<div class="">
<div class="">salloc: Granted job allocation 3953722</div>
</div>
<div class="">
<div class="">salloc: Waiting for resource configuration</div>
</div>
<div class="">
<div class="">salloc: Nodes r1n00 are ready for job</div>
</div>
<div class="">ls -l<br class="">
total 437343<br class="">
-rw-r--r-- 1 frey it_nss 180419 Oct 26 16:56 amd.cache<br class="">
-rw-r--r-- 1 frey it_nss 72 Oct 26 16:52 amd.conf<br class="">
-rw-r--r-- 1 frey everyone 715 Nov 12 23:39 anaconda-activate.sh<br class="">
drwxr-xr-x 2 frey everyone 4 Apr 11 2022 bin</div>
<div class=""> :</div>
</blockquote>
<div class="">
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">With the --pty flag added:</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
<blockquote class="" style="margin:0 0 0 40px; border:none; padding:0px">
<div class="">
<div class=""><b class="">[(it_nss:frey)@login00.darwin ~]$ salloc -p idle srun --pty /opt/shared/singularity/3.10.0/bin/singularity shell /opt/shared/singularity/prebuilt/postgresql/13.2.simg</b></div>
</div>
<div class="">
<div class="">salloc: Granted job allocation 3953723</div>
</div>
<div class="">
<div class="">salloc: Waiting for resource configuration</div>
</div>
<div class="">
<div class="">salloc: Nodes r1n00 are ready for job</div>
</div>
<div class="">
<div class="">Singularity></div>
</div>
</blockquote>
<div class="">
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<blockquote type="cite" class="">On Feb 8, 2023, at 09:47 , Groner, Rob <<a href="mailto:rug262@psu.edu" class="">rug262@psu.edu</a>> wrote:<br class="">
<br class="">
I tried that, and it says the nodes have been allocated, but it never comes to an apptainer prompt.<br class="">
<br class="">
I then tried doing them in separate steps. Doing salloc works, I get a prompt on the node that was allocated. I can then run "singularity shell <sif>" and get the apptainer prompt. If I prefix that command with "srun", then it just hangs and I never get the
prompt. So that seems to be the sticking point. I'll have to do some experiments running singularity with srun.<br class="">
<br class="">
From: slurm-users <<a href="mailto:slurm-users-bounces@lists.schedmd.com" class="">slurm-users-bounces@lists.schedmd.com</a>> on behalf of Jeffrey T Frey <frey@udel.edu><br class="">
Sent: Tuesday, February 7, 2023 6:16 PM<br class="">
To: Slurm User Community List <slurm-users@lists.schedmd.com><br class="">
Subject: Re: [slurm-users] slurm and singularity<br class="">
<br class="">
You don't often get email from frey@udel.edu. Learn why this is important<br class="">
<blockquote type="cite" class="">The remaining issue then is how to put them into an allocation that is actually running a singularity container. I don't get how what I'm doing now is resulting in an allocation where I'm in a container on the submit node still!<br class="">
</blockquote>
<br class="">
Try prefixing the singularity command with "srun" e.g.<br class="">
<br class="">
<br class="">
salloc <salloc-parameters> srun <srun-parameters> /usr/bin/singularity shell <path to sif><br class="">
</blockquote>
<br class="">
</div>
</div>
</div>
</div>
</body>
</html>