Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csbase-dev
sgarest-daemon
Commits
ed38088f
Commit
ed38088f
authored
Nov 11, 2019
by
gabrielmanhaes
Browse files
Adaptar SGA Slurm para mudanças do branch [SOMA-2598][SOMA-1327]
parent
25f1a306
Changes
1
Hide whitespace changes
Inline
Side-by-side
sga/driver/slurm.lua
View file @
ed38088f
...
...
@@ -4,7 +4,6 @@ local safer = require("safer")
local
util
=
require
(
"sga.util"
)
local
exec
=
require
(
"sga.exec"
)
local
schema
=
require
(
"schema"
)
local
posix
=
require
(
"posix"
)
local
cmds
=
{
sbatch
=
"sbatch "
,
...
...
@@ -35,14 +34,13 @@ function slurm.execute_command(self, job, cmd_string)
local
err_filename
=
self
.
config
.
runtime_data_dir
..
"/sbatch_"
..
job
.
jid
..
".err"
for
_
,
sandbox_path
in
ipairs
(
job
.
sandboxes
)
do
local
ok
,
err
=
lfs
.
mk
dir
(
sandbox_path
)
local
ok
,
err
=
self
.
exec
:
create_
dir
(
sandbox_path
)
if
not
ok
then
local
attr
=
lfs
.
attributes
(
sandbox_path
)
if
not
(
attr
and
attr
.
mode
==
"directory"
)
then
if
not
self
.
exec
:
is_dir
(
sandbox_path
)
then
return
nil
,
"Failed creating job's sandbox "
..
sandbox_path
end
end
posix
.
chmod
(
sandbox_path
,
"rwxrwxrwx"
)
self
.
exec
:
chmod
(
sandbox_path
,
"rwxrwxrwx"
)
end
local
optional_params
=
""
...
...
@@ -78,14 +76,13 @@ function slurm.execute_command(self, job, cmd_string)
end
function
slurm
.
cleanup_job
(
self
,
job
)
self
.
exec
:
remove
(
job
.
data
.
script_filename
)
self
.
exec
:
remove
(
job
.
data
.
out_filename
)
self
.
exec
:
remove
(
job
.
data
.
err_filename
)
self
.
exec
:
remove
_file
(
job
.
data
.
script_filename
)
self
.
exec
:
remove
_file
(
job
.
data
.
out_filename
)
self
.
exec
:
remove
_file
(
job
.
data
.
err_filename
)
for
_
,
sandbox_path
in
ipairs
(
job
.
sandboxes
)
do
local
attr
=
lfs
.
attributes
(
sandbox_path
)
if
(
attr
and
attr
.
mode
==
"directory"
)
then
local
ok
,
err
=
util
.
removedir
(
sandbox_path
)
if
self
.
exec
:
is_dir
(
sandbox_path
)
then
local
ok
,
err
=
self
.
exec
:
remove_dir
(
sandbox_path
)
if
not
ok
then
self
.
logger
:
error
(
"Failed removing job's sandbox "
..
sandbox_path
)
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment