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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
nomad-lab
nomad-FAIR
Commits
9437842b
Commit
9437842b
authored
Sep 25, 2018
by
Markus Scheidgen
Browse files
Added logs to gui.
parent
89171aff
Changes
4
Hide whitespace changes
Inline
Side-by-side
gui/src/api.js
View file @
9437842b
...
...
@@ -144,6 +144,22 @@ function archive(uploadHash, calcHash) {
.
then
(
response
=>
response
.
json
())
}
function
calcProcLog
(
uploadHash
,
calcHash
)
{
return
fetch
(
`
${
apiBase
}
/logs/
${
uploadHash
}
/
${
calcHash
}
`
)
.
catch
(
networkError
)
.
then
(
response
=>
{
if
(
!
response
.
ok
)
{
if
(
response
.
status
===
404
)
{
return
''
}
else
{
return
handleResponseErrors
(
response
)
}
}
else
{
return
response
.
text
()
}
})
}
function
archiveUrl
(
uploadHash
,
calcHash
)
{
return
`
${
apiBase
}
/archive/
${
uploadHash
}
/
${
calcHash
}
`
}
...
...
@@ -236,6 +252,7 @@ const api = {
unstageUpload
:
unstageUpload
,
getUploads
:
getUploads
,
archive
:
archive
,
calcProcLog
:
calcProcLog
,
archiveUrl
:
archiveUrl
,
repo
:
repo
,
repoAll
:
repoAll
,
...
...
gui/src/components/ArchiveCalc.js
View file @
9437842b
...
...
@@ -18,6 +18,10 @@ class ArchiveCalc extends React.Component {
calcData
:
{
padding
:
theme
.
spacing
.
unit
},
logs
:
{
marginTop
:
theme
.
spacing
.
unit
*
2
,
padding
:
theme
.
spacing
.
unit
},
metaInfo
:
{
height
:
120
,
padding
:
theme
.
spacing
.
unit
*
2
,
...
...
@@ -37,6 +41,7 @@ class ArchiveCalc extends React.Component {
super
(
props
)
this
.
state
=
{
data
:
null
,
logs
:
null
,
metaInfo
:
null
,
showMetaInfo
:
false
}
...
...
@@ -51,6 +56,12 @@ class ArchiveCalc extends React.Component {
this
.
props
.
raiseError
(
error
)
})
api
.
calcProcLog
(
uploadHash
,
calcHash
).
then
(
logs
=>
{
if
(
logs
&&
logs
!==
''
)
{
this
.
setState
({
logs
:
logs
})
}
})
api
.
getMetaInfo
().
then
(
metaInfo
=>
{
this
.
setState
({
metaInfo
:
metaInfo
})
}).
catch
(
error
=>
{
...
...
@@ -112,6 +123,14 @@ class ArchiveCalc extends React.Component {
:
<
LinearProgress
variant
=
"
query
"
/>
}
<
/Paper
>
{
this
.
state
.
logs
?
<
Paper
className
=
{
classes
.
logs
}
>
<
pre
>
{
this
.
state
.
logs
}
<
/pre
>
<
/Paper
>
:
''
}
<
/div
>
)
...
...
nomad/files.py
View file @
9437842b
...
...
@@ -69,6 +69,7 @@ class Objects:
path_segments
=
file_name
.
split
(
'/'
)
path
=
os
.
path
.
join
(
*
([
config
.
fs
.
objects
,
bucket
]
+
path_segments
))
directory
=
os
.
path
.
dirname
(
path
)
if
not
os
.
path
.
isdir
(
directory
):
os
.
makedirs
(
directory
)
...
...
nomad/processing/data.py
View file @
9437842b
...
...
@@ -142,7 +142,7 @@ class Calc(Proc):
self
.
normalizing
()
self
.
archiving
()
finally
:
# close
open
loghandler
# close loghandler
that was not closed due to failures
try
:
if
self
.
_loghandler
is
not
None
:
self
.
_loghandler
.
close
()
...
...
@@ -196,6 +196,11 @@ class Calc(Proc):
with
ArchiveFile
(
self
.
archive_id
).
write_archive_json
()
as
out
:
self
.
_parser_backend
.
write_json
(
out
,
pretty
=
True
)
# close loghandler
if
self
.
_loghandler
is
not
None
:
self
.
_loghandler
.
close
()
self
.
_loghandler
=
None
class
Upload
(
Chord
):
"""
...
...
Write
Preview
Markdown
is supported
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