@@ -107,7 +107,7 @@ def main(argv):
107
107
#print 'current UID: ',os.getuid(),'\t Current GID: ',os.getgid()
108
108
109
109
# Checking for docker on the system
110
- p = subprocess .Popen ('docker --version' ,shell = True ,stdout = subprocess .PIPE ,stderr = subprocess .PIPE )
110
+ p = subprocess .Popen ('/usr/bin/ docker --version' ,shell = True ,stdout = subprocess .PIPE ,stderr = subprocess .PIPE )
111
111
out ,err = p .communicate ()
112
112
#print 'return out and err',out,err
113
113
if p .returncode != 0 :
@@ -184,7 +184,7 @@ def main(argv):
184
184
sys .exit (2 )
185
185
186
186
# Compose the docker command
187
- dockercmd = 'docker run --name=' + cid + ' -d -u ' + str (user )+ ':' + str (group )
187
+ dockercmd = '/usr/bin/ docker run --name=' + cid + ' -d -u ' + str (user )+ ':' + str (group )
188
188
if slurm_job_id :
189
189
dockercmd += ' -v $SCRATCH:$SCRATCH -e SCRATCH=$SCRATCH'
190
190
dockercmd += ' -v /work/:/work/ -v ' + PWD + ':' + PWD + ' -v ' + home + ':' + home + ' -w ' + PWD + ' -e HOME=' + home + ' ' + img
@@ -211,7 +211,7 @@ def main(argv):
211
211
212
212
if slurm_job_id :
213
213
# Get the container's PID
214
- cpid = int (subprocess .Popen ("docker inspect -f '{{ .State.Pid }}' " + cid ,\
214
+ cpid = int (subprocess .Popen ("/usr/bin/ docker inspect -f '{{ .State.Pid }}' " + cid ,\
215
215
shell = True , stdout = subprocess .PIPE ).stdout .read ().strip ())
216
216
#print 'container PID: ', cpid
217
217
# Classify the container process (and all of it's children) to the Slurm's cgroups assigned to the job
@@ -223,10 +223,10 @@ def main(argv):
223
223
224
224
if verbose :
225
225
print 'waiting for the container to exit...\n '
226
- subprocess .Popen ('docker wait ' + cid , shell = True , stdout = subprocess .PIPE ).stdout .read ()
226
+ subprocess .Popen ('/usr/bin/ docker wait ' + cid , shell = True , stdout = subprocess .PIPE ).stdout .read ()
227
227
228
228
# After the container exit's, capture it's output
229
- clog = subprocess .Popen ("docker inspect -f '{{.LogPath}}' " + str (cid ), shell = True , stdout = subprocess .PIPE ).stdout .read ().rstrip ()
229
+ clog = subprocess .Popen ("/usr/bin/ docker inspect -f '{{.LogPath}}' " + str (cid ), shell = True , stdout = subprocess .PIPE ).stdout .read ().rstrip ()
230
230
with open (clog ,'r' ) as f :
231
231
if verbose :
232
232
print 'container output:\n '
@@ -238,7 +238,7 @@ def main(argv):
238
238
sys .stdout .write (d ['log' ])
239
239
if verbose :
240
240
print '\n removing the container...\n '
241
- subprocess .Popen ('docker rm ' + cid , shell = True , stdout = subprocess .PIPE ).stdout .read ()
241
+ subprocess .Popen ('/usr/bin/ docker rm ' + cid , shell = True , stdout = subprocess .PIPE ).stdout .read ()
242
242
243
243
if __name__ == "__main__" :
244
244
main (sys .argv [1 :])
0 commit comments